From ad210ff0fb495c4e55f29c7ebde0d6022316d15f Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 16:14:49 +0530
Subject: [PATCH 001/166] Update build.gradle
---
build.gradle | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 7e1d4b6..cf23668 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,6 +2,9 @@ plugins {
id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
+ id 'java-gradle-plugin'
+ id 'groovy'
+ id 'maven-publish'
}
group = 'com.kkjavatutorials'
@@ -9,7 +12,7 @@ version = '0.0.1-SNAPSHOT'
sourceCompatibility = '8'
repositories {
- mavenCentral()
+ mavenCentral("http://35.188.92.10/#artifact/io.buildpacks.example/sample")
}
dependencies {
From 13f3ae93a6e4ca77be86f1c96e328c6dd95de9b4 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 16:21:20 +0530
Subject: [PATCH 002/166] Update build.gradle
---
build.gradle | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/build.gradle b/build.gradle
index cf23668..00315f6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -11,9 +11,15 @@ group = 'com.kkjavatutorials'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '8'
-repositories {
+/* repositories {
mavenCentral("http://35.188.92.10/#artifact/io.buildpacks.example/sample")
-}
+} */
+
+repositories {
+ maven {
+ url "https://maven.google.com"
+ }
+ }
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
From 77b8748f1043e83350fd2f7da7558231728a093d Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 16:23:23 +0530
Subject: [PATCH 003/166] Update build.gradle
---
build.gradle | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 00315f6..c8589c1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -21,11 +21,23 @@ repositories {
}
}
-dependencies {
+/* dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
+} */
+
+dependencies {
+ implementation 'org.springframework.boot:spring-boot-starter-web'
+ compileOnly 'com.android.tools.build:gradle:3.3.2'
+ compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
+ testImplementation localGroovy()
+ testImplementation 'junit:junit:4.12'
+ testImplementation 'org.hamcrest:hamcrest-all:1.3'
+ testImplementation('org.springframework.boot:spring-boot-starter-test') {
+ exclude module : 'groovy-all'
+ }
}
test {
From 71de4853c298154b05bad28b146916961ce529a6 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 16:26:27 +0530
Subject: [PATCH 004/166] Update build.gradle
---
build.gradle | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/build.gradle b/build.gradle
index c8589c1..3679e41 100644
--- a/build.gradle
+++ b/build.gradle
@@ -21,24 +21,15 @@ repositories {
}
}
-/* dependencies {
+dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
- testImplementation('org.springframework.boot:spring-boot-starter-test') {
- exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
+ compile group: 'foo', name: 'foo', version: '0.1'
+ testImplementation('org.springframework.boot:spring-boot-starter-test') {
+ exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
-} */
+}
+
-dependencies {
- implementation 'org.springframework.boot:spring-boot-starter-web'
- compileOnly 'com.android.tools.build:gradle:3.3.2'
- compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
- testImplementation localGroovy()
- testImplementation 'junit:junit:4.12'
- testImplementation 'org.hamcrest:hamcrest-all:1.3'
- testImplementation('org.springframework.boot:spring-boot-starter-test') {
- exclude module : 'groovy-all'
- }
-}
test {
useJUnitPlatform()
From ee3b9097cca58266c432e6da73de59b8dc84109d Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 16:45:14 +0530
Subject: [PATCH 005/166] Update build.gradle
---
build.gradle | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/build.gradle b/build.gradle
index 3679e41..7d57ed7 100644
--- a/build.gradle
+++ b/build.gradle
@@ -11,19 +11,19 @@ group = 'com.kkjavatutorials'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '8'
-/* repositories {
- mavenCentral("http://35.188.92.10/#artifact/io.buildpacks.example/sample")
-} */
+ repositories {
+ mavenCentral()
+}
-repositories {
+/* repositories {
maven {
url "https://maven.google.com"
}
- }
+ } */
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
- compile group: 'foo', name: 'foo', version: '0.1'
+ // compile group: 'foo', name: 'foo', version: '0.1'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
From 09895568ea647cbed062fb07fecdb8d220360048 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 16:48:08 +0530
Subject: [PATCH 006/166] Update build.gradle
---
build.gradle | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/build.gradle b/build.gradle
index 7d57ed7..7e1d4b6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,34 +2,22 @@ plugins {
id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
- id 'java-gradle-plugin'
- id 'groovy'
- id 'maven-publish'
}
group = 'com.kkjavatutorials'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '8'
- repositories {
+repositories {
mavenCentral()
-}
-
-/* repositories {
- maven {
- url "https://maven.google.com"
- }
- } */
+}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
- // compile group: 'foo', name: 'foo', version: '0.1'
- testImplementation('org.springframework.boot:spring-boot-starter-test') {
- exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
+ testImplementation('org.springframework.boot:spring-boot-starter-test') {
+ exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
-}
-
-
+}
test {
useJUnitPlatform()
From ac621bde4fe73eb77fdcecc02c739ed40cf12f6e Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:03:55 +0530
Subject: [PATCH 007/166] Create gradle.yml
---
.github/workflows/gradle.yml | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 .github/workflows/gradle.yml
diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
new file mode 100644
index 0000000..58e1c59
--- /dev/null
+++ b/.github/workflows/gradle.yml
@@ -0,0 +1,26 @@
+# This workflow will build a Java project with Gradle
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
+
+name: Java CI with Gradle
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.8
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+ - name: Build with Gradle
+ run: ./gradlew build
From 29ee2047a067a6d97ffcd98d40827ddba0e53682 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:08:55 +0530
Subject: [PATCH 008/166] Create gradle.yaml
---
gradle.yaml | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 gradle.yaml
diff --git a/gradle.yaml b/gradle.yaml
new file mode 100644
index 0000000..58e1c59
--- /dev/null
+++ b/gradle.yaml
@@ -0,0 +1,26 @@
+# This workflow will build a Java project with Gradle
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
+
+name: Java CI with Gradle
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.8
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+ - name: Build with Gradle
+ run: ./gradlew build
From accabca4d01ad74da9cb8285bf9fe290da682244 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:09:32 +0530
Subject: [PATCH 009/166] Rename gradle.yaml to gradle.yml
---
gradle.yaml => gradle.yml | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename gradle.yaml => gradle.yml (100%)
diff --git a/gradle.yaml b/gradle.yml
similarity index 100%
rename from gradle.yaml
rename to gradle.yml
From 7c8f27912931821135d54fdd40ef8a8e48f2f51e Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:25:21 +0530
Subject: [PATCH 010/166] Update build.gradle
---
build.gradle | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/build.gradle b/build.gradle
index 7e1d4b6..020e4fa 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,12 +8,22 @@ group = 'com.kkjavatutorials'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '8'
+task wrapper(type: Wrapper) {
+ gradleVersion = "6.8";
+}
+
repositories {
mavenCentral()
}
+configurations {
+ // configuration that holds jars to include in the jar
+ extraLibs
+}
+
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
+ configurations.compile.extendsFrom(configurations.extraLibs)
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
@@ -22,3 +32,9 @@ dependencies {
test {
useJUnitPlatform()
}
+
+jar {
+ from {
+ configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
+ }
+}
From 7c9803f87f3d252afca3543ff25243c3563cccde Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:26:50 +0530
Subject: [PATCH 011/166] Update build.gradle
---
build.gradle | 3 ---
1 file changed, 3 deletions(-)
diff --git a/build.gradle b/build.gradle
index 020e4fa..1a691e1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,9 +8,6 @@ group = 'com.kkjavatutorials'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '8'
-task wrapper(type: Wrapper) {
- gradleVersion = "6.8";
-}
repositories {
mavenCentral()
From b4e0eed2a2ba696d7eceb64bc955f443bf5ffd84 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:30:25 +0530
Subject: [PATCH 012/166] Update build.gradle
---
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 1a691e1..9ecd3b5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -22,7 +22,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
configurations.compile.extendsFrom(configurations.extraLibs)
testImplementation('org.springframework.boot:spring-boot-starter-test') {
- exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
+ //exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
From fbe2ea895ef4d69c08797ccb5a724c61d83d51fe Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:33:15 +0530
Subject: [PATCH 013/166] Update build.gradle
---
build.gradle | 2 ++
1 file changed, 2 insertions(+)
diff --git a/build.gradle b/build.gradle
index 9ecd3b5..472c112 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,6 +2,7 @@ plugins {
id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
+ id 'com.github.onslip.gradle-one-jar'
}
group = 'com.kkjavatutorials'
@@ -21,6 +22,7 @@ configurations {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
configurations.compile.extendsFrom(configurations.extraLibs)
+ classpath "gradle.plugin.com.github.onslip:gradle-one-jar:1.0.6"
testImplementation('org.springframework.boot:spring-boot-starter-test') {
//exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
From 373bc116e9067c940bb39ab1ae1641daf2c6f928 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:34:16 +0530
Subject: [PATCH 014/166] Update build.gradle
---
build.gradle | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 472c112..3cecf02 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,7 +2,7 @@ plugins {
id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
- id 'com.github.onslip.gradle-one-jar'
+
}
group = 'com.kkjavatutorials'
@@ -37,3 +37,5 @@ jar {
configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
}
}
+
+apply plugin: "com.github.onslip.gradle-one-jar"
From 23f028b0fe9fee75903cc147de016445813a60e3 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:35:27 +0530
Subject: [PATCH 015/166] Update build.gradle
---
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 3cecf02..f5e4fa9 100644
--- a/build.gradle
+++ b/build.gradle
@@ -38,4 +38,4 @@ jar {
}
}
-apply plugin: "com.github.onslip.gradle-one-jar"
+
From 8c1cb4cb261fb62ea50683742bb4a4340a48beeb Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:36:27 +0530
Subject: [PATCH 016/166] Update build.gradle
---
build.gradle | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/build.gradle b/build.gradle
index f5e4fa9..db5642f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -22,9 +22,9 @@ configurations {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
configurations.compile.extendsFrom(configurations.extraLibs)
- classpath "gradle.plugin.com.github.onslip:gradle-one-jar:1.0.6"
+ //classpath "gradle.plugin.com.github.onslip:gradle-one-jar:1.0.6"
testImplementation('org.springframework.boot:spring-boot-starter-test') {
- //exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
+ exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
From e66726326da9fde646ba0d27ef6377bfd2714f31 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 17:38:29 +0530
Subject: [PATCH 017/166] Update build.gradle
---
build.gradle | 1 -
1 file changed, 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index db5642f..f51a8f2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -22,7 +22,6 @@ configurations {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
configurations.compile.extendsFrom(configurations.extraLibs)
- //classpath "gradle.plugin.com.github.onslip:gradle-one-jar:1.0.6"
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
From 828f2fcb538f31d662ffcbdc39b6c185fc01b1fb Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:14:05 +0530
Subject: [PATCH 018/166] Create Jenkinsfile
---
Jenkinsfile | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 93 insertions(+)
create mode 100644 Jenkinsfile
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..5a3be08
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,93 @@
+pipeline {
+ /* environment {
+ PROJECT_ID = "sd-devops"
+ APP_NAME = "sample-java-app"
+ CLUSTER_NAME = "cluster-1"
+ CLUSTER_ZONE = "us-central1-a"
+ CREDENTIALS_ID = "sd-devops"
+ } */
+ //agent any 2
+ agent {
+ kubernetes {
+ label 'SpringBootRestApp'
+ defaultContainer 'jnlp'
+ yaml """
+apiVersion: v1
+kind: Pod
+metadata:
+labels:
+ component: ci
+spec:
+ containers:
+ - name: gradle
+ image: gradle:3.5-jdk8-alpine
+ command:
+ - cat
+ tty: true
+"""
+}
+ }
+
+ stages {
+ stage('check_gradle_version') {
+ steps {
+ sh 'gradle --version'
+ sh 'echo workspace is $WORKSPACE'
+ }
+ }
+ stage('Unit Test') {
+ steps {
+ container('gradle') {
+ //withMaven(maven: 'MAVEN-3.6.3') {
+ //withSonarQubeEnv(installationName:'Sonarqube') {
+ echo 'I am executing unit test'
+ sh 'mvn -f sample-java-app/pom.xml clean package'
+ // }
+ // }
+ }
+ }
+ }
+
+ /* stage('Code Quality') {
+ steps {
+ container('maven') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ echo 'I am executing code quality using sonarqube'
+ sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
+ }
+ sleep(60)
+ timeout(time: 1, unit: 'MINUTES') {
+ waitForQualityGate abortPipeline: true
+ }
+ }
+ }
+ }
+ }
+
+ stage('Publish Package') {
+ steps {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
+ }
+ }
+ }
+
+ stage('Deploy Dev') {
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
+ echo "Work in progress"
+ }
+ }
+
+ stage('Smoke Test'){
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Smoke Test on target dev environment post deployment"
+ echo 'Work in progress'
+ }
+ } */
+ }
+}
From 1075e0e7825b869132918461f2b9d769c5bc651f Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:27:12 +0530
Subject: [PATCH 019/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 5a3be08..97ff089 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,7 +31,7 @@ spec:
stages {
stage('check_gradle_version') {
steps {
- sh 'gradle --version'
+ sh 'gradle -v'
sh 'echo workspace is $WORKSPACE'
}
}
From 1810385140d4882210e30ec779614536c29f7f79 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:29:10 +0530
Subject: [PATCH 020/166] Update Jenkinsfile
---
Jenkinsfile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 97ff089..87d5374 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,7 +31,8 @@ spec:
stages {
stage('check_gradle_version') {
steps {
- sh 'gradle -v'
+ sh './gradle -v'
+ //sh 'gradle -v'
sh 'echo workspace is $WORKSPACE'
}
}
From 8f6396c131d28286b5d77e7e2f68c902cd145a8e Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:33:59 +0530
Subject: [PATCH 021/166] Update Jenkinsfile
---
Jenkinsfile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 87d5374..dae11b7 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,9 +31,12 @@ spec:
stages {
stage('check_gradle_version') {
steps {
- sh './gradle -v'
+
+ //sh './gradle -v'
//sh 'gradle -v'
+
sh 'echo workspace is $WORKSPACE'
+ sh ' echo "pwd" '
}
}
stage('Unit Test') {
From e3df617ef8af75fc73c593dff38a270f546668bd Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:39:46 +0530
Subject: [PATCH 022/166] Update Jenkinsfile
---
Jenkinsfile | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index dae11b7..1b53e1d 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,21 +31,18 @@ spec:
stages {
stage('check_gradle_version') {
steps {
-
- //sh './gradle -v'
- //sh 'gradle -v'
-
+ sh 'gradle -v'
sh 'echo workspace is $WORKSPACE'
- sh ' echo "pwd" '
+ sh 'ls -lart'
}
}
- stage('Unit Test') {
+ /* stage('Unit Test') {
steps {
container('gradle') {
//withMaven(maven: 'MAVEN-3.6.3') {
//withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
- sh 'mvn -f sample-java-app/pom.xml clean package'
+ //sh 'mvn -f sample-java-app/pom.xml clean package'
// }
// }
}
From cfc5a3399a9c7a3ad9dcb0caeb60f5f5885ed9cc Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:44:59 +0530
Subject: [PATCH 023/166] Update Jenkinsfile
---
Jenkinsfile | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 1b53e1d..f934deb 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,11 +1,11 @@
pipeline {
- /* environment {
+ environment {
PROJECT_ID = "sd-devops"
APP_NAME = "sample-java-app"
CLUSTER_NAME = "cluster-1"
CLUSTER_ZONE = "us-central1-a"
CREDENTIALS_ID = "sd-devops"
- } */
+ }
//agent any 2
agent {
kubernetes {
@@ -31,10 +31,12 @@ spec:
stages {
stage('check_gradle_version') {
steps {
+ container('gradle') {
sh 'gradle -v'
sh 'echo workspace is $WORKSPACE'
- sh 'ls -lart'
+ sh "ls -la ${pwd()}"
}
+ }
}
/* stage('Unit Test') {
steps {
From e9e7df08796fc330d173270da2b14cf182a0883c Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:47:46 +0530
Subject: [PATCH 024/166] Update Jenkinsfile
---
Jenkinsfile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index f934deb..76d77cd 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -38,13 +38,14 @@ spec:
}
}
}
- /* stage('Unit Test') {
+ stage('Unit Test') {
steps {
container('gradle') {
//withMaven(maven: 'MAVEN-3.6.3') {
//withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
//sh 'mvn -f sample-java-app/pom.xml clean package'
+ sh 'gradle build'
// }
// }
}
From 3031986f602d3e10ff6425d346e0827959c0593f Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:51:35 +0530
Subject: [PATCH 025/166] Update build.gradle
---
build.gradle | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/build.gradle b/build.gradle
index f51a8f2..d4c0e50 100644
--- a/build.gradle
+++ b/build.gradle
@@ -31,10 +31,6 @@ test {
useJUnitPlatform()
}
-jar {
- from {
- configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
- }
-}
+
From c814b5ba2f51e45bdcd5354b036bb7c6c28f9d6a Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:52:29 +0530
Subject: [PATCH 026/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 76d77cd..2f8755a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,7 +45,7 @@ spec:
//withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
//sh 'mvn -f sample-java-app/pom.xml clean package'
- sh 'gradle build'
+ sh 'gradle build.gradle'
// }
// }
}
From 72961add66dd4afd8589f47a1717e61e553cd1a5 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:54:22 +0530
Subject: [PATCH 027/166] Update build.gradle
---
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index d4c0e50..505b7cf 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,5 +1,5 @@
plugins {
- id 'org.springframework.boot' version '2.3.2.RELEASE'
+ // id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
From a0282d8397c992dd559fe710e128e3d896c85dda Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:55:54 +0530
Subject: [PATCH 028/166] Update build.gradle
---
build.gradle | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/build.gradle b/build.gradle
index 505b7cf..20bd9d5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -27,9 +27,9 @@ dependencies {
}
}
-test {
+/* test {
useJUnitPlatform()
-}
+} */
From 197622cdd28aaa93b7a9f3745def3e145962ed44 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 19:58:21 +0530
Subject: [PATCH 029/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 2f8755a..fc17068 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,7 +45,7 @@ spec:
//withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
//sh 'mvn -f sample-java-app/pom.xml clean package'
- sh 'gradle build.gradle'
+ sh 'gradle compileJava'
// }
// }
}
From 10972c0b3d0de867f6be7f16b886048d23b422fa Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:01:49 +0530
Subject: [PATCH 030/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index fc17068..a861405 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,7 +45,7 @@ spec:
//withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
//sh 'mvn -f sample-java-app/pom.xml clean package'
- sh 'gradle compileJava'
+ sh 'gradle clean build'
// }
// }
}
From c16167f133c355a7b2cd77330bcf174058685231 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:05:57 +0530
Subject: [PATCH 031/166] Update build.gradle
---
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 20bd9d5..fcd147e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,5 +1,5 @@
plugins {
- // id 'org.springframework.boot' version '2.3.2.RELEASE'
+ id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
From 1dd4b1542ebfd2f2a9c494620a3c82eb6c45d28e Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:09:21 +0530
Subject: [PATCH 032/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index a861405..f7e58f9 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,7 +20,7 @@ labels:
spec:
containers:
- name: gradle
- image: gradle:3.5-jdk8-alpine
+ image: gradle:6.3-jdk8-alpine
command:
- cat
tty: true
From bd5d551c9fc5e33fc19637d0490628bdb5c402b3 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:12:54 +0530
Subject: [PATCH 033/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index f7e58f9..a861405 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,7 +20,7 @@ labels:
spec:
containers:
- name: gradle
- image: gradle:6.3-jdk8-alpine
+ image: gradle:3.5-jdk8-alpine
command:
- cat
tty: true
From b616e67a2b686dc7144069e6a844a10cc48c1d68 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:14:59 +0530
Subject: [PATCH 034/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index a861405..a281559 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,7 +20,7 @@ labels:
spec:
containers:
- name: gradle
- image: gradle:3.5-jdk8-alpine
+ image: gradle:6.8.0-jdk8-alpine
command:
- cat
tty: true
From e8e8256e3cee708fdb8c570305b47277a0845ffc Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:26:49 +0530
Subject: [PATCH 035/166] Update build.gradle
---
build.gradle | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/build.gradle b/build.gradle
index fcd147e..52994da 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,6 @@
plugins {
- id 'org.springframework.boot' version '2.3.2.RELEASE'
- id 'io.spring.dependency-management' version '1.0.9.RELEASE'
+ // id 'org.springframework.boot' version '2.3.2.RELEASE'
+ // id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
@@ -20,11 +20,11 @@ configurations {
}
dependencies {
- implementation 'org.springframework.boot:spring-boot-starter-web'
+ // implementation 'org.springframework.boot:spring-boot-starter-web'
configurations.compile.extendsFrom(configurations.extraLibs)
- testImplementation('org.springframework.boot:spring-boot-starter-test') {
+ /*testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
- }
+ }*/
}
/* test {
From f1fa023cff25151c67de3c3f556319e1951d910a Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:27:30 +0530
Subject: [PATCH 036/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index a281559..a861405 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,7 +20,7 @@ labels:
spec:
containers:
- name: gradle
- image: gradle:6.8.0-jdk8-alpine
+ image: gradle:3.5-jdk8-alpine
command:
- cat
tty: true
From eee16a0247fafacd499df7e4e116cb1efb6cbcb4 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:34:03 +0530
Subject: [PATCH 037/166] Update build.gradle
---
build.gradle | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/build.gradle b/build.gradle
index 52994da..0cf6408 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,6 @@
plugins {
- // id 'org.springframework.boot' version '2.3.2.RELEASE'
- // id 'io.spring.dependency-management' version '1.0.9.RELEASE'
+ id 'org.springframework.boot' version '2.3.2.RELEASE'
+ id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
@@ -20,11 +20,11 @@ configurations {
}
dependencies {
- // implementation 'org.springframework.boot:spring-boot-starter-web'
+ implementation 'org.springframework.boot:spring-boot-starter-web'
configurations.compile.extendsFrom(configurations.extraLibs)
- /*testImplementation('org.springframework.boot:spring-boot-starter-test') {
+ testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
- }*/
+ }
}
/* test {
From 10e3cf95a0df20ae79012b4da081e22b746cf148 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:41:21 +0530
Subject: [PATCH 038/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index a861405..a281559 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,7 +20,7 @@ labels:
spec:
containers:
- name: gradle
- image: gradle:3.5-jdk8-alpine
+ image: gradle:6.8.0-jdk8-alpine
command:
- cat
tty: true
From 536e1193c510ebb3924d5f73e84f31867c8fe791 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:44:45 +0530
Subject: [PATCH 039/166] Update Jenkinsfile
---
Jenkinsfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index a281559..d919042 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,7 +20,7 @@ labels:
spec:
containers:
- name: gradle
- image: gradle:6.8.0-jdk8-alpine
+ image: gradle:3.5-jdk8-alpine
command:
- cat
tty: true
@@ -45,7 +45,7 @@ spec:
//withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
//sh 'mvn -f sample-java-app/pom.xml clean package'
- sh 'gradle clean build'
+ sh './gradlew build'
// }
// }
}
From 483ab09f80de0c780c2f6164f07acf550b07aead Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:48:21 +0530
Subject: [PATCH 040/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index d919042..ecbb4fd 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,7 +45,7 @@ spec:
//withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
//sh 'mvn -f sample-java-app/pom.xml clean package'
- sh './gradlew build'
+ sh '.\gradlew.bat build'
// }
// }
}
From 73e726a44119020e880685b1d780c28fcd6cc3ab Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:49:07 +0530
Subject: [PATCH 041/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index ecbb4fd..1a0a16c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,7 +45,7 @@ spec:
//withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
//sh 'mvn -f sample-java-app/pom.xml clean package'
- sh '.\gradlew.bat build'
+ sh './gradlew.bat build'
// }
// }
}
From a334a6b880d6de7a6263a435006f60b12a2dcf62 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:50:48 +0530
Subject: [PATCH 042/166] Update Jenkinsfile
---
Jenkinsfile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Jenkinsfile b/Jenkinsfile
index 1a0a16c..12dbb90 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,6 +45,7 @@ spec:
//withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
//sh 'mvn -f sample-java-app/pom.xml clean package'
+ sh 'chmod 777 * '
sh './gradlew.bat build'
// }
// }
From c4eaae9b0f81e7b3391ba1fc4d4ac0041ba2b75e Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:52:19 +0530
Subject: [PATCH 043/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 12dbb90..b49b559 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -46,7 +46,7 @@ spec:
echo 'I am executing unit test'
//sh 'mvn -f sample-java-app/pom.xml clean package'
sh 'chmod 777 * '
- sh './gradlew.bat build'
+ sh './gradlew build'
// }
// }
}
From 4e160e23ce3123c5d13e0047ca5bd7bb5736ff3d Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:58:23 +0530
Subject: [PATCH 044/166] Update Jenkinsfile
---
Jenkinsfile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index b49b559..e8cb40e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -53,13 +53,13 @@ spec:
}
}
- /* stage('Code Quality') {
+ stage('Code Quality') {
steps {
container('maven') {
withMaven(maven: 'MAVEN-3.6.3') {
withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing code quality using sonarqube'
- sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
+ sh 'mvn -f pom.xml sonar:sonar'
}
sleep(60)
timeout(time: 1, unit: 'MINUTES') {
@@ -70,7 +70,7 @@ spec:
}
}
- stage('Publish Package') {
+ /*stage('Publish Package') {
steps {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
From 0847c2cb0984aa72803609a5c3c4501d51233ad3 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 20:58:54 +0530
Subject: [PATCH 045/166] Create pom.xml
---
pom.xml | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
create mode 100644 pom.xml
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..fa02310
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,47 @@
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.1.3.RELEASE
+
+
+ io.buildpacks.example
+ sample
+ 0.0.1-SNAPSHOT
+ sample
+ Sample Java Application
+
+
+ 1.8
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-thymeleaf
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
From d16c0f608f449a55dea13d58ebad0c5eed790c82 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:03:36 +0530
Subject: [PATCH 046/166] Update Jenkinsfile
---
Jenkinsfile | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index e8cb40e..4114099 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -53,7 +53,7 @@ spec:
}
}
- stage('Code Quality') {
+ /* stage('Code Quality') {
steps {
container('maven') {
withMaven(maven: 'MAVEN-3.6.3') {
@@ -68,18 +68,18 @@ spec:
}
}
}
- }
+ } */
- /*stage('Publish Package') {
+ stage('Publish Package') {
steps {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
}
}
}
- stage('Deploy Dev') {
+ /* stage('Deploy Dev') {
when { branch 'dev'}
steps {
echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
From 3ae8822ed83b9a0fa379d2483ba45d525bb01296 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:07:34 +0530
Subject: [PATCH 047/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 4114099..5f514a2 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -74,7 +74,7 @@ spec:
steps {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
+ sh 'mvn -X deploy:deploy-file -Dfile=/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
}
}
}
From da781271fcfbd932825717e69152b643a359c160 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:13:46 +0530
Subject: [PATCH 048/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 5f514a2..2f2c553 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -74,7 +74,7 @@ spec:
steps {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- sh 'mvn -X deploy:deploy-file -Dfile=/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
+ sh 'mvn -X deploy:deploy-file -Dfile=target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
}
}
}
From 024d357889ae109ae51104c62bb01f3fd9c259ff Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:14:15 +0530
Subject: [PATCH 049/166] Update pom.xml
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index fa02310..af36f16 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
sample
0.0.1-SNAPSHOT
sample
- Sample Java Application
+ SpringBootRestApp
1.8
From 76bba5768a0a17f7611e6a4b03f8951c66a7ae87 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:28:21 +0530
Subject: [PATCH 050/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 2f2c553..4114099 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -74,7 +74,7 @@ spec:
steps {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- sh 'mvn -X deploy:deploy-file -Dfile=target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
}
}
}
From a5de934b6f8c5184262237b474c746321c08a52b Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:38:54 +0530
Subject: [PATCH 051/166] Create sample-java-app
---
sample-java-app | 1 +
1 file changed, 1 insertion(+)
create mode 100644 sample-java-app
diff --git a/sample-java-app b/sample-java-app
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/sample-java-app
@@ -0,0 +1 @@
+
From 0d537984d0b11b167e79661c8904a62caa783eaa Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:42:26 +0530
Subject: [PATCH 052/166] Add files via upload
---
pom.xml | 148 ++++++++++++++++++++++++++++++++++++++------------------
1 file changed, 101 insertions(+), 47 deletions(-)
diff --git a/pom.xml b/pom.xml
index af36f16..b50378e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,47 +1,101 @@
-
-
- 4.0.0
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.1.3.RELEASE
-
-
- io.buildpacks.example
- sample
- 0.0.1-SNAPSHOT
- sample
- SpringBootRestApp
-
-
- 1.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-thymeleaf
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.1.3.RELEASE
+
+
+ io.buildpacks.example
+ sample
+ 0.0.1-SNAPSHOT
+ sample
+ Sample Java Application
+
+
+ 1.8
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-thymeleaf
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
+
+
+ internal
+ Archiva Managed Internal Repository
+ http://35.188.92.10/repository/internal/
+
+
+ snapshots
+ Archiva Managed Snapshot Repository
+ http://35.188.92.10/repository/snapshots/
+
+
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.3
+
+
+
+
+
+ org.apache.maven.wagon
+ wagon-http
+ 2.5
+
+
+
+
+
+
+
+ snapshots
+ Archiva Managed Snapshot Repository
+ http://35.188.92.10/repository/snapshots/
+
+ false
+
+
+ true
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 0c4018a4f10a7880cfbde8b0b98b77f66db28afa Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:49:04 +0530
Subject: [PATCH 053/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 4114099..cbd06c7 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -53,7 +53,7 @@ spec:
}
}
- /* stage('Code Quality') {
+ stage('Code Quality') {
steps {
container('maven') {
withMaven(maven: 'MAVEN-3.6.3') {
From 63611a9c7c3860586696af223d0d81fb4f402d08 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:49:37 +0530
Subject: [PATCH 054/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index cbd06c7..8e340f2 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -68,7 +68,7 @@ spec:
}
}
}
- } */
+ }
stage('Publish Package') {
steps {
From 113a87fc041d10184f627258d1e8c2ed9c52c73a Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:53:52 +0530
Subject: [PATCH 055/166] Update Jenkinsfile
---
Jenkinsfile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 8e340f2..fab9349 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -55,7 +55,7 @@ spec:
stage('Code Quality') {
steps {
- container('maven') {
+ container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing code quality using sonarqube'
@@ -72,11 +72,13 @@ spec:
stage('Publish Package') {
steps {
+ container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
}
}
+ }
}
/* stage('Deploy Dev') {
From d9c38bc523c5d2f0f52d6b2aab7affc20261d42a Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 21:58:19 +0530
Subject: [PATCH 056/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index fab9349..98c6953 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -70,7 +70,7 @@ spec:
}
}
- stage('Publish Package') {
+ /* stage('Publish Package') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
From f347527efc0ce0b4260714720efde913b88b6ad2 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:05:26 +0530
Subject: [PATCH 057/166] Update Jenkinsfile
---
Jenkinsfile | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 98c6953..cc8ca46 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -35,10 +35,12 @@ spec:
sh 'gradle -v'
sh 'echo workspace is $WORKSPACE'
sh "ls -la ${pwd()}"
+ sh 'chmod 777 * '
+ sh './gradlew build'
}
}
}
- stage('Unit Test') {
+ /* stage('Unit Test') {
steps {
container('gradle') {
//withMaven(maven: 'MAVEN-3.6.3') {
@@ -51,6 +53,20 @@ spec:
// }
}
}
+ }*/
+
+ stage('Unit Test') {
+ steps {
+ container('gradle') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ echo 'I am executing unit test'
+ sh 'mvn -f pom.xml clean package'
+
+ }
+ }
+ }
+ }
}
stage('Code Quality') {
From 9d48bb9a83dc446190aea04513f049ba7f01301b Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:10:24 +0530
Subject: [PATCH 058/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestApp/SpringBootRestAppApplicationTests.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index b10b35d..bc196a1 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -1,4 +1,4 @@
-package com.kkjavatutorials.SpringBootRestApp;
+//package com.kkjavatutorials.SpringBootRestApp;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
From d22ac6d3ecbb9cd5b6ba34be0e6605b220ebf446 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:18:00 +0530
Subject: [PATCH 059/166] Update Jenkinsfile
---
Jenkinsfile | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index cc8ca46..a49cedb 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -55,7 +55,7 @@ spec:
}
}*/
- stage('Unit Test') {
+ /* stage('Unit Test') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
@@ -67,9 +67,9 @@ spec:
}
}
}
- }
+ } */
- stage('Code Quality') {
+ /* stage('Code Quality') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
@@ -84,14 +84,14 @@ spec:
}
}
}
- }
+ } */
- /* stage('Publish Package') {
+ stage('Publish Package') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
+ sh 'mvn -X deploy:deploy-file -Dfile=target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
}
}
}
From 9c3b15e762cff0c00994ceed9e28d9160964ee3b Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:19:23 +0530
Subject: [PATCH 060/166] Update Jenkinsfile
---
Jenkinsfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index a49cedb..d2c1327 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -55,7 +55,7 @@ spec:
}
}*/
- /* stage('Unit Test') {
+ stage('Unit Test') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
@@ -67,7 +67,7 @@ spec:
}
}
}
- } */
+ }
/* stage('Code Quality') {
steps {
From 813e2af1c0583b31c0e63c6fea168bafa7071caf Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:24:14 +0530
Subject: [PATCH 061/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestApp/SpringBootRestAppApplicationTests.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index bc196a1..cf435fe 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -1,6 +1,6 @@
-//package com.kkjavatutorials.SpringBootRestApp;
+package com.kkjavatutorials.SpringBootRestApp;
-import org.junit.jupiter.api.Test;
+//import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
From 270249021840146efcfe66a24e34ce0f7dded701 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:28:17 +0530
Subject: [PATCH 062/166] Update build.gradle
---
build.gradle | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 0cf6408..724dfc7 100644
--- a/build.gradle
+++ b/build.gradle
@@ -21,7 +21,8 @@ configurations {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
- configurations.compile.extendsFrom(configurations.extraLibs)
+ implementation 'org.junit.jupiter:junit-jupiter-api:5.5.1'
+ configurations.compile.extendsFrom(configurations.extraLibs)
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
From 019facaecac0b82cef93ded7bae46ce6219e1adf Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:32:26 +0530
Subject: [PATCH 063/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestAppApplicationTests.java | 25 ++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index cf435fe..c16a682 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -1,6 +1,6 @@
package com.kkjavatutorials.SpringBootRestApp;
-//import org.junit.jupiter.api.Test;
+/* //import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
@@ -10,4 +10,27 @@ class SpringBootRestAppApplicationTests {
void contextLoads() {
}
+}*/
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+
+public class SampleApplicationTests {
+
+ @Test
+ public void passingTest() {
+ assertTrue(true);
+ }
+
+ @Test
+ public void failingTest() {
+ //assertTrue(false); // Uncomment this for the build to fail.
+ }
+
}
From 450c2860fe230c1ceccf30d0e5ad519f3ea2f58d Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:35:50 +0530
Subject: [PATCH 064/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestApp/SpringBootRestAppApplicationTests.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index c16a682..5689b66 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -25,7 +25,7 @@ public class SampleApplicationTests {
@Test
public void passingTest() {
- assertTrue(true);
+
}
@Test
From 9dd87139babd86b46a423eced9e73dce39efe5ab Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:38:56 +0530
Subject: [PATCH 065/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestAppApplicationTests.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index 5689b66..23acd6b 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -18,17 +18,16 @@ void contextLoads() {
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
-@RunWith(SpringRunner.class)
-@SpringBootTest
+
public class SampleApplicationTests {
- @Test
+
public void passingTest() {
}
- @Test
+
public void failingTest() {
//assertTrue(false); // Uncomment this for the build to fail.
}
From 9e2c3c8c65a6d9125f6650fec7c563247a7498c2 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:42:38 +0530
Subject: [PATCH 066/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestAppApplicationTests.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index 23acd6b..0b10fd5 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -18,16 +18,17 @@ void contextLoads() {
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class SpringBootRestAppApplicationTests {
-public class SampleApplicationTests {
-
-
+ @Test
public void passingTest() {
-
+ assertTrue(true);
}
-
+ @Test
public void failingTest() {
//assertTrue(false); // Uncomment this for the build to fail.
}
From 9e01c266bcbd1cb61561399ae2fe15e6ed620bc3 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:46:51 +0530
Subject: [PATCH 067/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestAppApplicationTests.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index 0b10fd5..a7b1fb9 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -18,14 +18,14 @@ void contextLoads() {
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
-@RunWith(SpringRunner.class)
-@SpringBootTest
+//@RunWith(SpringRunner.class)
+//@SpringBootTest
public class SpringBootRestAppApplicationTests {
@Test
public void passingTest() {
- assertTrue(true);
+ //assertTrue(true);
}
@Test
From 7d38084a49eddc1ae0a6eba539a878efce0ee9b8 Mon Sep 17 00:00:00 2001
From: Rakshita Singh
Date: Mon, 18 Jan 2021 22:55:24 +0530
Subject: [PATCH 068/166] hi
---
.../.mvn/wrapper/MavenWrapperDownloader.java | 114 +++++++
.../.mvn/wrapper/maven-wrapper.properties | 1 +
sample-java-app/Jenkinsfile | 86 ++++++
sample-java-app/Jenkinsfile1 | 86 ++++++
sample-java-app/Jenkinsfile2 | 61 ++++
sample-java-app/Jenkinsfile3 | 14 +
sample-java-app/Jenkinsfile_AIP | 86 ++++++
sample-java-app/LICENSE | 201 ++++++++++++
sample-java-app/New Text Document.txt | 1 +
sample-java-app/README.md | 3 +
sample-java-app/mvnw | 286 ++++++++++++++++++
sample-java-app/mvnw.cmd | 161 ++++++++++
sample-java-app/pom.xml | 101 +++++++
.../example/sample/SampleApplication.java | 16 +
.../src/main/resources/application.properties | 0
sample-java-app/src/main/resources/banner.txt | 10 +
.../main/resources/static/buildpacks-logo.svg | 110 +++++++
.../src/main/resources/static/favicon.png | Bin 0 -> 2411 bytes
.../src/main/resources/templates/index.html | 28 ++
.../sample/SampleApplicationTests.java | 24 ++
20 files changed, 1389 insertions(+)
create mode 100644 sample-java-app/.mvn/wrapper/MavenWrapperDownloader.java
create mode 100644 sample-java-app/.mvn/wrapper/maven-wrapper.properties
create mode 100644 sample-java-app/Jenkinsfile
create mode 100644 sample-java-app/Jenkinsfile1
create mode 100644 sample-java-app/Jenkinsfile2
create mode 100644 sample-java-app/Jenkinsfile3
create mode 100644 sample-java-app/Jenkinsfile_AIP
create mode 100644 sample-java-app/LICENSE
create mode 100644 sample-java-app/New Text Document.txt
create mode 100644 sample-java-app/README.md
create mode 100644 sample-java-app/mvnw
create mode 100644 sample-java-app/mvnw.cmd
create mode 100644 sample-java-app/pom.xml
create mode 100644 sample-java-app/src/main/java/io/buildpacks/example/sample/SampleApplication.java
rename sample-java-app => sample-java-app/src/main/resources/application.properties (100%)
create mode 100644 sample-java-app/src/main/resources/banner.txt
create mode 100644 sample-java-app/src/main/resources/static/buildpacks-logo.svg
create mode 100644 sample-java-app/src/main/resources/static/favicon.png
create mode 100644 sample-java-app/src/main/resources/templates/index.html
create mode 100644 sample-java-app/src/test/java/io/buildpacks/example/sample/SampleApplicationTests.java
diff --git a/sample-java-app/.mvn/wrapper/MavenWrapperDownloader.java b/sample-java-app/.mvn/wrapper/MavenWrapperDownloader.java
new file mode 100644
index 0000000..72308aa
--- /dev/null
+++ b/sample-java-app/.mvn/wrapper/MavenWrapperDownloader.java
@@ -0,0 +1,114 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+ /**
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+ */
+ private static final String DEFAULT_DOWNLOAD_URL =
+ "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";
+
+ /**
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+ * use instead of the default one.
+ */
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+ ".mvn/wrapper/maven-wrapper.properties";
+
+ /**
+ * Path where the maven-wrapper.jar will be saved to.
+ */
+ private static final String MAVEN_WRAPPER_JAR_PATH =
+ ".mvn/wrapper/maven-wrapper.jar";
+
+ /**
+ * Name of the property which should be used to override the default download url for the wrapper.
+ */
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+ public static void main(String args[]) {
+ System.out.println("- Downloader started");
+ File baseDirectory = new File(args[0]);
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
+ // wrapperUrl parameter.
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+ String url = DEFAULT_DOWNLOAD_URL;
+ if(mavenWrapperPropertyFile.exists()) {
+ FileInputStream mavenWrapperPropertyFileInputStream = null;
+ try {
+ mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+ Properties mavenWrapperProperties = new Properties();
+ mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+ } catch (IOException e) {
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+ } finally {
+ try {
+ if(mavenWrapperPropertyFileInputStream != null) {
+ mavenWrapperPropertyFileInputStream.close();
+ }
+ } catch (IOException e) {
+ // Ignore ...
+ }
+ }
+ }
+ System.out.println("- Downloading from: : " + url);
+
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+ if(!outputFile.getParentFile().exists()) {
+ if(!outputFile.getParentFile().mkdirs()) {
+ System.out.println(
+ "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+ }
+ }
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+ try {
+ downloadFileFromURL(url, outputFile);
+ System.out.println("Done");
+ System.exit(0);
+ } catch (Throwable e) {
+ System.out.println("- Error downloading");
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+ URL website = new URL(urlString);
+ ReadableByteChannel rbc;
+ rbc = Channels.newChannel(website.openStream());
+ FileOutputStream fos = new FileOutputStream(destination);
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+ fos.close();
+ rbc.close();
+ }
+
+}
diff --git a/sample-java-app/.mvn/wrapper/maven-wrapper.properties b/sample-java-app/.mvn/wrapper/maven-wrapper.properties
new file mode 100644
index 0000000..cd0d451
--- /dev/null
+++ b/sample-java-app/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
diff --git a/sample-java-app/Jenkinsfile b/sample-java-app/Jenkinsfile
new file mode 100644
index 0000000..1c10980
--- /dev/null
+++ b/sample-java-app/Jenkinsfile
@@ -0,0 +1,86 @@
+pipeline {
+ /* environment {
+ PROJECT_ID = "sd-devops"
+ APP_NAME = "sample-java-app"
+ CLUSTER_NAME = "cluster-1"
+ CLUSTER_ZONE = "us-central1-a"
+ CREDENTIALS_ID = "sd-devops"
+ } */
+ //agent any 2
+ agent {
+ kubernetes {
+ label 'sample-java-app'
+ defaultContainer 'jnlp'
+ yaml """
+apiVersion: v1
+kind: Pod
+metadata:
+labels:
+ component: ci
+spec:
+ containers:
+ - name: maven
+ image: maven:3.6.1-slim
+ command:
+ - cat
+ tty: true
+"""
+}
+ }
+ stages {
+ stage('Unit Test') {
+ steps {
+ container('maven') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ echo 'I am executing unit test'
+ sh 'mvn -f sample-java-app/pom.xml clean package'
+ }
+ }
+ }
+ }
+ }
+
+ stage('Code Quality') {
+ steps {
+ container('maven') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ echo 'I am executing code quality using sonarqube'
+ sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
+ }
+ sleep(60)
+ timeout(time: 1, unit: 'MINUTES') {
+ waitForQualityGate abortPipeline: true
+ }
+ }
+ }
+ }
+ }
+
+ stage('Publish Package') {
+ steps {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
+ }
+ }
+ }
+
+ stage('Deploy Dev') {
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
+ echo "Work in progress"
+ }
+ }
+
+ stage('Smoke Test'){
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Smoke Test on target dev environment post deployment"
+ echo 'Work in progress'
+ }
+ }
+ }
+}
diff --git a/sample-java-app/Jenkinsfile1 b/sample-java-app/Jenkinsfile1
new file mode 100644
index 0000000..2c85782
--- /dev/null
+++ b/sample-java-app/Jenkinsfile1
@@ -0,0 +1,86 @@
+pipeline {
+ environment {
+ PROJECT_ID = "sd-devops"
+ APP_NAME = "sample-java-app"
+ CLUSTER_NAME = "cluster-1"
+ CLUSTER_ZONE = "us-central1-a"
+ CREDENTIALS_ID = "sd-devops"
+ }
+ //agent any
+ agent {
+ kubernetes {
+ label 'sample-java-app'
+ defaultContainer 'jnlp'
+ yaml """
+apiVersion: v1
+kind: Pod
+metadata:
+labels:
+ component: ci
+spec:
+ containers:
+ - name: maven
+ image: maven:3.6.1-slim
+ command:
+ - cat
+ tty: true
+"""
+}
+ }
+ stages {
+ stage('Unit Test') {
+ steps {
+ container('maven') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ sh 'I am executing unit test'
+ sh 'mvn -f sample-java-app/pom.xml clean package'
+ }
+ }
+ }
+ }
+ }
+
+ stage('Code Quality') {
+ steps {
+ container('maven') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ sh 'I am executing code quality using sonarqube'
+ sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
+ }
+ sleep(60)
+ timeout(time: 1, unit: 'MINUTES') {
+ waitForQualityGate abortPipeline: true
+ }
+ }
+ }
+ }
+ }
+
+ stage('Publish Package') {
+ steps {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ sh 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
+ }
+ }
+ }
+
+ stage('Deploy Dev') {
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
+ echo "Work in progress"
+ }
+ }
+
+ stage('Smoke Test'){
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Smoke Test on target dev environment post deployment"
+ echo 'Work in progress'
+ }
+ }
+ }
+}
diff --git a/sample-java-app/Jenkinsfile2 b/sample-java-app/Jenkinsfile2
new file mode 100644
index 0000000..01c6273
--- /dev/null
+++ b/sample-java-app/Jenkinsfile2
@@ -0,0 +1,61 @@
+podTemplate(containers: [
+ containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', ttyEnabled: true, command: 'cat'),
+ ]) {
+
+ node(POD_LABEL) {
+ stage('Unit Test') {
+ steps {
+ container('maven') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ sh 'I am executing unit test'
+ sh 'mvn -f sample-java-app/pom.xml clean package'
+ }
+ }
+ }
+ }
+ }
+
+ stage('Code Quality') {
+ steps {
+ container('maven') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ sh 'I am executing code quality using sonarqube'
+ sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
+ }
+ sleep(60)
+ timeout(time: 1, unit: 'MINUTES') {
+ waitForQualityGate abortPipeline: true
+ }
+ }
+ }
+ }
+ }
+
+ stage('Publish Package') {
+ steps {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ sh 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
+ }
+ }
+ }
+
+ stage('Deploy Dev') {
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
+ echo "Work in progress"
+ }
+ }
+
+ stage('Smoke Test'){
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Smoke Test on target dev environment post deployment"
+ echo 'Work in progress'
+ }
+ }
+ }
+}
diff --git a/sample-java-app/Jenkinsfile3 b/sample-java-app/Jenkinsfile3
new file mode 100644
index 0000000..490eed4
--- /dev/null
+++ b/sample-java-app/Jenkinsfile3
@@ -0,0 +1,14 @@
+podTemplate(containers: [
+ containerTemplate(name: 'maven', image: 'maven:3.6.0-jdk-8-alpine', ttyEnabled: true, command: 'cat')
+ ], volumes: [
+ ]) {
+
+ node(POD_LABEL) {
+ stage('Build a Maven project') {
+ git 'https://github.com/jenkinsci/kubernetes-plugin.git'
+ container('maven') {
+ sh 'mvn -B clean package'
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/sample-java-app/Jenkinsfile_AIP b/sample-java-app/Jenkinsfile_AIP
new file mode 100644
index 0000000..cfe9652
--- /dev/null
+++ b/sample-java-app/Jenkinsfile_AIP
@@ -0,0 +1,86 @@
+pipeline {
+ /* environment {
+ PROJECT_ID = "sd-devops"
+ APP_NAME = "sample-java-app"
+ CLUSTER_NAME = "cluster-1"
+ CLUSTER_ZONE = "us-central1-a"
+ CREDENTIALS_ID = "sd-devops"
+ } */
+ //agent any 1
+ agent {
+ kubernetes {
+ label 'sample-java-app'
+ defaultContainer 'jnlp'
+ yaml """
+apiVersion: v1
+kind: Pod
+metadata:
+labels:
+ component: ci
+spec:
+ containers:
+ - name: maven
+ image: maven:3.6.1-slim
+ command:
+ - cat
+ tty: true
+"""
+}
+ }
+ stages {
+ stage('Unit Test') {
+ steps {
+ container('maven') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ echo 'I am executing unit test'
+ sh 'mvn -f sample-java-app/pom.xml clean package'
+ }
+ }
+ }
+ }
+ }
+
+ stage('Code Quality') {
+ steps {
+ container('maven') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ echo 'I am executing code quality using sonarqube'
+ sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
+ }
+ sleep(60)
+ timeout(time: 1, unit: 'MINUTES') {
+ waitForQualityGate abortPipeline: true
+ }
+ }
+ }
+ }
+ }
+
+ stage('Publish Package') {
+ steps {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
+ }
+ }
+ }
+
+ stage('Deploy Dev') {
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
+ echo "Work in progress"
+ }
+ }
+
+ stage('Smoke Test'){
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Smoke Test on target dev environment post deployment"
+ echo 'Work in progress'
+ }
+ }
+ }
+}
diff --git a/sample-java-app/LICENSE b/sample-java-app/LICENSE
new file mode 100644
index 0000000..f279534
--- /dev/null
+++ b/sample-java-app/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2019 The Cloud Native Buildpacks Authors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/sample-java-app/New Text Document.txt b/sample-java-app/New Text Document.txt
new file mode 100644
index 0000000..32f95c0
--- /dev/null
+++ b/sample-java-app/New Text Document.txt
@@ -0,0 +1 @@
+hi
\ No newline at end of file
diff --git a/sample-java-app/README.md b/sample-java-app/README.md
new file mode 100644
index 0000000..66965a2
--- /dev/null
+++ b/sample-java-app/README.md
@@ -0,0 +1,3 @@
+> **ARCHIVED**: This repository has been relocated to the [samples](https://github.com/buildpack/samples/) repo.
+
+## sample-java-app
diff --git a/sample-java-app/mvnw b/sample-java-app/mvnw
new file mode 100644
index 0000000..8b9da3b
--- /dev/null
+++ b/sample-java-app/mvnw
@@ -0,0 +1,286 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven2 Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+ if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+ fi
+
+ if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+ fi
+
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ MINGW*) mingw=true;;
+ Darwin*) darwin=true
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+ if [ -z "$JAVA_HOME" ]; then
+ if [ -x "/usr/libexec/java_home" ]; then
+ export JAVA_HOME="`/usr/libexec/java_home`"
+ else
+ export JAVA_HOME="/Library/Java/Home"
+ fi
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+ done
+
+ saveddir=`pwd`
+
+ M2_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ M2_HOME=`cd "$M2_HOME" && pwd`
+
+ cd "$saveddir"
+ # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --unix "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME="`(cd "$M2_HOME"; pwd)`"
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+ # TODO classpath?
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+ javaExecutable="`which javac`"
+ if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+ # readlink(1) is not available as standard on Solaris 10.
+ readLink=`which readlink`
+ if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+ if $darwin ; then
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+ else
+ javaExecutable="`readlink -f \"$javaExecutable\"`"
+ fi
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+ JAVA_HOME="$javaHome"
+ export JAVA_HOME
+ fi
+ fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD="`which java`"
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly." >&2
+ echo " We cannot execute $JAVACMD" >&2
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+ if [ -z "$1" ]
+ then
+ echo "Path not specified to find_maven_basedir"
+ return 1
+ fi
+
+ basedir="$1"
+ wdir="$1"
+ while [ "$wdir" != '/' ] ; do
+ if [ -d "$wdir"/.mvn ] ; then
+ basedir=$wdir
+ break
+ fi
+ # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+ if [ -d "${wdir}" ]; then
+ wdir=`cd "$wdir/.."; pwd`
+ fi
+ # end of workaround
+ done
+ echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+ if [ -f "$1" ]; then
+ echo "$(tr -s '\n' ' ' < "$1")"
+ fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+ exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+ fi
+ jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
+ while IFS="=" read key value; do
+ case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+ esac
+ done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Downloading from: $jarUrl"
+ fi
+ wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+
+ if command -v wget > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found wget ... using wget"
+ fi
+ wget "$jarUrl" -O "$wrapperJarPath"
+ elif command -v curl > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found curl ... using curl"
+ fi
+ curl -o "$wrapperJarPath" "$jarUrl"
+ else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Falling back to using Java to download"
+ fi
+ javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ if [ -e "$javaClass" ]; then
+ if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Compiling MavenWrapperDownloader.java ..."
+ fi
+ # Compiling the Java class
+ ("$JAVA_HOME/bin/javac" "$javaClass")
+ fi
+ if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ # Running the downloader
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Running MavenWrapperDownloader.java ..."
+ fi
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+ fi
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+ echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+ MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+ "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/sample-java-app/mvnw.cmd b/sample-java-app/mvnw.cmd
new file mode 100644
index 0000000..fef5a8f
--- /dev/null
+++ b/sample-java-app/mvnw.cmd
@@ -0,0 +1,161 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven2 Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
+FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+ echo Found %WRAPPER_JAR%
+) else (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
+ echo Finished downloading %WRAPPER_JAR%
+)
+@REM End of extension
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%
diff --git a/sample-java-app/pom.xml b/sample-java-app/pom.xml
new file mode 100644
index 0000000..4b589c0
--- /dev/null
+++ b/sample-java-app/pom.xml
@@ -0,0 +1,101 @@
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.1.3.RELEASE
+
+
+ io.buildpacks.example
+ sample
+ 0.0.1-SNAPSHOT
+ sample
+ Sample Java Application
+
+
+ 1.8
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-thymeleaf
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
+
+
+ internal
+ Archiva Managed Internal Repository
+ http://35.188.92.10/repository/internal/
+
+
+ snapshots
+ Archiva Managed Snapshot Repository
+ http://35.188.92.10/repository/snapshots/
+
+
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.3
+
+
+
+
+
+ org.apache.maven.wagon
+ wagon-http
+ 2.5
+
+
+
+
+
+
+
+ snapshots
+ Archiva Managed Snapshot Repository
+ http://35.188.92.10/repository/snapshots/
+
+ false
+
+
+ true
+
+
+
+
+
+
+
+
+
+
diff --git a/sample-java-app/src/main/java/io/buildpacks/example/sample/SampleApplication.java b/sample-java-app/src/main/java/io/buildpacks/example/sample/SampleApplication.java
new file mode 100644
index 0000000..9fec2f6
--- /dev/null
+++ b/sample-java-app/src/main/java/io/buildpacks/example/sample/SampleApplication.java
@@ -0,0 +1,16 @@
+package io.buildpacks.example.sample;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SampleApplication {
+//sdgcpsb - comment added - 12/14/2020
+ //test trigger
+ //testing the trigger again.
+
+ public static void main(String[] args) {
+ SpringApplication.run(SampleApplication.class, args);
+ }
+
+}
diff --git a/sample-java-app b/sample-java-app/src/main/resources/application.properties
similarity index 100%
rename from sample-java-app
rename to sample-java-app/src/main/resources/application.properties
diff --git a/sample-java-app/src/main/resources/banner.txt b/sample-java-app/src/main/resources/banner.txt
new file mode 100644
index 0000000..d73226d
--- /dev/null
+++ b/sample-java-app/src/main/resources/banner.txt
@@ -0,0 +1,10 @@
+ |'-_ _-'| ____ _ _ _ _ _
+ | | | | _ \ (_)| | | | | | (_)
+ '-_|_-' | |_) | _ _ _ | | __| | _ __ __ _ ___ | | __ ___ _ ___
+|'-_ _-'|'-_ _-'| | _ < | | | || || | / _` || '_ \ / _` | / __|| |/ // __| | | / _ \
+| | | | | | |_) || |_| || || || (_| || |_) || (_| || (__ | < \__ \ _ | || (_) |
+ '-_|_-' '-_|_-' |____/ \__,_||_||_| \__,_|| .__/ \__,_| \___||_|\_\|___/(_)|_| \___/
+ | |
+ |_|
+
+:: Built with Spring Boot :: ${spring-boot.version}
diff --git a/sample-java-app/src/main/resources/static/buildpacks-logo.svg b/sample-java-app/src/main/resources/static/buildpacks-logo.svg
new file mode 100644
index 0000000..c6ea17e
--- /dev/null
+++ b/sample-java-app/src/main/resources/static/buildpacks-logo.svg
@@ -0,0 +1,110 @@
+
+
+
diff --git a/sample-java-app/src/main/resources/static/favicon.png b/sample-java-app/src/main/resources/static/favicon.png
new file mode 100644
index 0000000000000000000000000000000000000000..e286ec3cb5ce5a80e0aebf3670bce48ac83385df
GIT binary patch
literal 2411
zcmV-x36%DUP)Px;B}qge5Sq*Fy#}%HR{kgsK9X`M~Newv07^i@cKu}AijZ-&HLy6KhH6+E*
zAVoj}fi|?|r$)8n$f-yiNE@XX9H5TcMz~3E_(@Be3aO|hkxU7yLAAk{8lxl*1UUQd
zc4ud|Z_eJc@9g^nM^z;cvUYFw&71eV_vZZ!2#t*~4UB2v|5^k17NjR%|Mn}3Ray45
zU+;da^LTam7I;LLJowa6-<-SdTw-G!KK$Cj1FfyqM)YGEFBt>)=0kfPmR02-!WfyH
zePHWm&0mkKK9a^>@g#Kfb1mO@d)&WpDcWp=2?~7v*$-CP{_W}Rkv4wvCx0&VPMEMo
zQk3P2s>%k_5n}z6gqnykZjH1q*<8i|hBLE~#SKI#@nWKE%<|ES`ySp?ck^<0LrY6_
zP|#PbIxz08+%G+)spG)y+fHWomAZY*)77(kWHRU+SQ%SQ2ka5xac6zO{SR7ls?
zH0?XkjL_Lc%!W%3GZ`0iQ7-dV$=}GEUr909EXhid4P}K$W9#`9Q#>pY97ic$$Kp4B!r1R6_vg)F)!P{R>o)@k(7!3Zq=_uA-Kz>
z4g!GR;Ccvz?&Y?*_w#^NcjC~B|0Lp_&iriya5h<3_HvQS=iUTPv7Aa$^n56a905Rx
z1R4ilv(086HlBIs?I-@}ti7G*r~z<E
zhaB3`c#b-N0ig&~q?IzJ>k$N8j?r)4Yx~O|QEO91-PULTygeRp(9z6l<@T5)Tpdxq
zR50byGOVgq5RX1KEq(i?^RM5sZ!UYV+UF~rwc73RJ`xTG&zw&$y1Pfy61oGyr(qkv_`D2JJ;G!p#=SSZ#a9AKr|9
z9C%r@sIJI==lD%-muH!xD5`13o=*`rugF$OeRDHn*#ABolH`Q*s_>mz>;|{(hCs;J
zIj6hf^3Xl%(L8y{cYnHE^|-fanzs;WkqJC-oU|hXa2WLi5hbzRtfRi#%WX{`&R)3L
z|K+K7KM5M&plDi-XjtMiuvp&@z%JQ)^yn}E4u4S;s$h|@ZC)+#uwqLGhh99PRssvy
zC5^}4O$flDm%!o_1PyVc#g{YVQ_tkd_bZYt>Cj`xDco5SeWq27VrU5=AGtl6=OLG>
zrtEJ8cLEh?s#?{NLb!$rl7d^!b3+de)O703wT_DdEsDiLy6w^*Oi=
z0Sknn7Z4ky3q+igun|VGp#liF)U2_v0M5L_5`8f@ARwf%
zhd`A+03fzND=czoQv(n#giz-B%4Xt%Dl0;
z-mAl0NC@fz!FA38P!!hN!K*u_biI5f#yfKgelUHUByR#~R$!>`MErM#*i@EeB;xeY
zAsk#}U4yf3oAaIBoo9CS^c)}Y2KNA(sVpcgt%O49=PD*M4B!u?#87rfCgLtthPlCc
zMRao(14`>4Gs89c=Uu{-Rn~2t(Z#XV$L}q1PVQuOLNE|+e)H>?S%-t
z_gXkmccry4t^W4Z9V>JEKKDAOPmZ1%6T6mVC~fNFAVGE
zMg%Y*Aa_Uop;?qpp<@-9RL1
zlDNu&l>B#YTH8C?8xN-;XG)Ux!ZoE7(O*i0mWrB)Sym6!ox86G0x!+|cwbL41}OnJ
ziziK9I?bbLPlMBbbn(K!_94`gZiV2mNct4zbJ?^7D-}xT+z1&j&hFZMA?bp#k7F7b
d(?CQ6{{=Yu*aoI76OI4?002ovPDHLkV1nmVbiM!p
literal 0
HcmV?d00001
diff --git a/sample-java-app/src/main/resources/templates/index.html b/sample-java-app/src/main/resources/templates/index.html
new file mode 100644
index 0000000..431ffb1
--- /dev/null
+++ b/sample-java-app/src/main/resources/templates/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+ Buildpacks.io Java Sample
+
+
+
+
+
+
+

+
+
Hello, Buildpacker!
+
+
+
diff --git a/sample-java-app/src/test/java/io/buildpacks/example/sample/SampleApplicationTests.java b/sample-java-app/src/test/java/io/buildpacks/example/sample/SampleApplicationTests.java
new file mode 100644
index 0000000..e5bfa4a
--- /dev/null
+++ b/sample-java-app/src/test/java/io/buildpacks/example/sample/SampleApplicationTests.java
@@ -0,0 +1,24 @@
+package io.buildpacks.example.sample;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+
+public class SampleApplicationTests {
+
+ @Test
+ public void passingTest() {
+ assertTrue(true);
+ }
+
+ @Test
+ public void failingTest() {
+ //assertTrue(false); // Uncomment this for the build to fail.
+ }
+
+}
From 4060131155e52380e05d36be72a60aa83d612749 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 22:57:55 +0530
Subject: [PATCH 069/166] Update Jenkinsfile
---
Jenkinsfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index d2c1327..0f31b36 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -61,7 +61,7 @@ spec:
withMaven(maven: 'MAVEN-3.6.3') {
withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
- sh 'mvn -f pom.xml clean package'
+ sh 'mvn -f sample-java-app/pom.xml clean package'
}
}
@@ -86,7 +86,7 @@ spec:
}
} */
- stage('Publish Package') {
+ /* stage('Publish Package') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
From 1b89cba4ee877e5ee22f693c4ade5f688be34ccd Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:09:33 +0530
Subject: [PATCH 070/166] Update Jenkinsfile
---
Jenkinsfile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 0f31b36..a826a4d 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -61,7 +61,9 @@ spec:
withMaven(maven: 'MAVEN-3.6.3') {
withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
- sh 'mvn -f sample-java-app/pom.xml clean package'
+ sh 'mvn -f /$WORKSPACE/sample-java-app/pom.xml clean package'
+
+
}
}
From 629032342479455a6441359ce05f570810a50cf1 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:14:43 +0530
Subject: [PATCH 071/166] Update Jenkinsfile
---
Jenkinsfile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index a826a4d..04b6d55 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -61,7 +61,8 @@ spec:
withMaven(maven: 'MAVEN-3.6.3') {
withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
- sh 'mvn -f /$WORKSPACE/sample-java-app/pom.xml clean package'
+ sh "ls -la ${pwd()}"
+ //sh 'mvn -f /$WORKSPACE/sample-java-app/pom.xml clean package'
From 0e72e3e8f3dcb99caf3bbdda2e0989f7bda1bb3d Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:17:54 +0530
Subject: [PATCH 072/166] Update build.gradle
---
build.gradle | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/build.gradle b/build.gradle
index 724dfc7..45f6bef 100644
--- a/build.gradle
+++ b/build.gradle
@@ -21,16 +21,16 @@ configurations {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
- implementation 'org.junit.jupiter:junit-jupiter-api:5.5.1'
+
configurations.compile.extendsFrom(configurations.extraLibs)
- testImplementation('org.springframework.boot:spring-boot-starter-test') {
+ testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
- }
+ }
}
-/* test {
+ test {
useJUnitPlatform()
-} */
+}
From d3254db4a8a4f7f00df15af916cb1478c86ab812 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:21:00 +0530
Subject: [PATCH 073/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestAppApplicationTests.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index a7b1fb9..146457f 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -1,6 +1,7 @@
package com.kkjavatutorials.SpringBootRestApp;
-/* //import org.junit.jupiter.api.Test;
+//import org.junit.jupiter.api.Test;
+import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
@@ -10,9 +11,9 @@ class SpringBootRestAppApplicationTests {
void contextLoads() {
}
-}*/
+}
-import static org.junit.Assert.*;
+/*import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
From 9eacd551e4eae496dab3c78d0054949383822d24 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:23:25 +0530
Subject: [PATCH 074/166] Update Jenkinsfile
---
Jenkinsfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 04b6d55..07799eb 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -46,7 +46,7 @@ spec:
//withMaven(maven: 'MAVEN-3.6.3') {
//withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
- //sh 'mvn -f sample-java-app/pom.xml clean package'
+ sh 'mvn -f sample-java-app/pom.xml clean package'
sh 'chmod 777 * '
sh './gradlew build'
// }
@@ -62,7 +62,7 @@ spec:
withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
sh "ls -la ${pwd()}"
- //sh 'mvn -f /$WORKSPACE/sample-java-app/pom.xml clean package'
+ sh 'mvn -f pom.xml clean package'
From 1bcc668f494bad09bf46e8d30a9a486128f04438 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:25:54 +0530
Subject: [PATCH 075/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestAppApplicationTests.java | 24 +------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index 146457f..9b7ab5b 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -1,6 +1,6 @@
package com.kkjavatutorials.SpringBootRestApp;
-//import org.junit.jupiter.api.Test;
+
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
@@ -13,25 +13,3 @@ void contextLoads() {
}
-/*import static org.junit.Assert.*;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-//@RunWith(SpringRunner.class)
-//@SpringBootTest
-
-public class SpringBootRestAppApplicationTests {
-
- @Test
- public void passingTest() {
- //assertTrue(true);
- }
-
- @Test
- public void failingTest() {
- //assertTrue(false); // Uncomment this for the build to fail.
- }
-
-}
From bc6e7068cfcadd476fc5ef46f5810c9c51ad321a Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:30:47 +0530
Subject: [PATCH 076/166] Update pom.xml
---
pom.xml | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index b50378e..9aaf0b7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,12 @@
spring-boot-starter-test
test
+
+ junit
+ junit-dep
+ 4.8.2
+ test
+
@@ -98,4 +104,4 @@
-
\ No newline at end of file
+
From cf0182a63b92b48cd45d6c1920667f8e1abd9860 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:35:43 +0530
Subject: [PATCH 077/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestApp/SpringBootRestAppApplicationTests.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index 9b7ab5b..b01e9b1 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -1,6 +1,6 @@
package com.kkjavatutorials.SpringBootRestApp;
-
+import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
From dd554eef0fdbe0ca3c3eee2cd51e0f5bfc24f9e3 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:38:17 +0530
Subject: [PATCH 078/166] Update pom.xml
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 9aaf0b7..045cb13 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,8 +35,8 @@
junit
- junit-dep
- 4.8.2
+ junit
+ 4.12
test
From cb63d622cce2ba3c7ac877ac156f59fb5cfc5ff4 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:41:07 +0530
Subject: [PATCH 079/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 07799eb..ff80b74 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -55,7 +55,7 @@ spec:
}
}*/
- stage('Unit Test') {
+ /* stage('Unit Test') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
From 89e54911b8f4000a54ed029aac83f01e6aac9750 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:43:36 +0530
Subject: [PATCH 080/166] Update SpringBootRestAppApplicationTests.java
---
.../SpringBootRestApp/SpringBootRestAppApplicationTests.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
index b01e9b1..9b7ab5b 100644
--- a/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
+++ b/src/test/java/com/kkjavatutorials/SpringBootRestApp/SpringBootRestAppApplicationTests.java
@@ -1,6 +1,6 @@
package com.kkjavatutorials.SpringBootRestApp;
-import org.junit.jupiter.api.Test;
+
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
From fcde3aa7212d6416a5489b39756201fe20fd3a42 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:44:50 +0530
Subject: [PATCH 081/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index ff80b74..0bf6a53 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -36,7 +36,7 @@ spec:
sh 'echo workspace is $WORKSPACE'
sh "ls -la ${pwd()}"
sh 'chmod 777 * '
- sh './gradlew build'
+ sh './gradlew compileJava'
}
}
}
From 12bbc57497f7fdfac5805390675fde5db91c5568 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:47:27 +0530
Subject: [PATCH 082/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 0bf6a53..099bcc4 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -55,7 +55,7 @@ spec:
}
}*/
- /* stage('Unit Test') {
+ stage('Unit Test') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
From a668ef84d86901e5e925acfea7ab4af69a54ff0a Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:51:27 +0530
Subject: [PATCH 083/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 099bcc4..d472866 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -62,7 +62,7 @@ spec:
withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing unit test'
sh "ls -la ${pwd()}"
- sh 'mvn -f pom.xml clean package'
+ sh 'mvn -f sample-java-app/pom.xml clean package'
From b1280ccb127530ff47480dfa632510bf23df73d1 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 18 Jan 2021 23:55:23 +0530
Subject: [PATCH 084/166] Update Jenkinsfile
---
Jenkinsfile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index d472866..46cec1c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -40,7 +40,7 @@ spec:
}
}
}
- /* stage('Unit Test') {
+ /*stage('Unit Test') {
steps {
container('gradle') {
//withMaven(maven: 'MAVEN-3.6.3') {
@@ -72,13 +72,13 @@ spec:
}
}
- /* stage('Code Quality') {
+ stage('Code Quality') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
withSonarQubeEnv(installationName:'Sonarqube') {
echo 'I am executing code quality using sonarqube'
- sh 'mvn -f pom.xml sonar:sonar'
+ sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
}
sleep(60)
timeout(time: 1, unit: 'MINUTES') {
@@ -87,7 +87,7 @@ spec:
}
}
}
- } */
+ }
/* stage('Publish Package') {
steps {
From f303ccfcd0c76bf8c68388f98dee9177e550ddc8 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Tue, 19 Jan 2021 00:18:13 +0530
Subject: [PATCH 085/166] Update Jenkinsfile
---
Jenkinsfile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 46cec1c..4e9ec1e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -80,21 +80,21 @@ spec:
echo 'I am executing code quality using sonarqube'
sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
}
- sleep(60)
+ /*sleep(60)
timeout(time: 1, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
- }
+ }*/
}
}
}
}
- /* stage('Publish Package') {
+ stage('Publish Package') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- sh 'mvn -X deploy:deploy-file -Dfile=target/sample-0.0.1-SNAPSHOT.jar -DpomFile=pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
}
}
}
From 7074735ab5d967c4e3dbf9e11f590ba98afcd24e Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Tue, 19 Jan 2021 00:26:35 +0530
Subject: [PATCH 086/166] Update Jenkinsfile
---
Jenkinsfile | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 4e9ec1e..304a3fa 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -40,20 +40,7 @@ spec:
}
}
}
- /*stage('Unit Test') {
- steps {
- container('gradle') {
- //withMaven(maven: 'MAVEN-3.6.3') {
- //withSonarQubeEnv(installationName:'Sonarqube') {
- echo 'I am executing unit test'
- sh 'mvn -f sample-java-app/pom.xml clean package'
- sh 'chmod 777 * '
- sh './gradlew build'
- // }
- // }
- }
- }
- }*/
+
stage('Unit Test') {
steps {
From 0d8a9c294fa2d726b513fb3c57cfa22e63dce05e Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Tue, 19 Jan 2021 00:38:52 +0530
Subject: [PATCH 087/166] Update Jenkinsfile
---
Jenkinsfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 304a3fa..442d67e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -67,10 +67,10 @@ spec:
echo 'I am executing code quality using sonarqube'
sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
}
- /*sleep(60)
+ sleep(60)
timeout(time: 1, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
- }*/
+ }
}
}
}
From d6e1e9055be0e2538a005ed5cf0221015b4c5656 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Tue, 19 Jan 2021 17:15:44 +0530
Subject: [PATCH 088/166] Create Jenkinsfile_AIP
---
Jenkinsfile_AIP | 106 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)
create mode 100644 Jenkinsfile_AIP
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
new file mode 100644
index 0000000..fae095e
--- /dev/null
+++ b/Jenkinsfile_AIP
@@ -0,0 +1,106 @@
+
+pipeline {
+ environment {
+ PROJECT_ID = "sd-devops"
+ APP_NAME = "sample-java-app"
+ CLUSTER_NAME = "cluster-1"
+ CLUSTER_ZONE = "us-central1-a"
+ CREDENTIALS_ID = "sd-devops"
+ }
+ //agent any 2
+ agent {
+ kubernetes {
+ label 'SpringBootRestApp'
+ defaultContainer 'jnlp'
+ yaml """
+apiVersion: v1
+kind: Pod
+metadata:
+labels:
+ component: ci
+spec:
+ containers:
+ - name: gradle
+ image: gradle:3.5-jdk8-alpine
+ command:
+ - cat
+ tty: true
+"""
+}
+ }
+
+ stages {
+ stage('check_gradle_version') {
+ steps {
+ container('gradle') {
+ sh 'gradle -v'
+ sh 'echo workspace is $WORKSPACE'
+ sh "ls -la ${pwd()}"
+ sh 'chmod 777 * '
+ sh './gradlew compileJava'
+ }
+ }
+ }
+
+
+ stage('Unit Test') {
+ steps {
+ container('gradle') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ echo 'I am executing unit test'
+ sh "ls -la ${pwd()}"
+ sh 'mvn -f sample-java-app/pom.xml clean package'
+
+
+
+ }
+ }
+ }
+ }
+ }
+
+ stage('Code Quality') {
+ steps {
+ container('gradle') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName:'Sonarqube') {
+ echo 'I am executing code quality using sonarqube'
+ sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
+ }
+ sleep(60)
+ timeout(time: 1, unit: 'MINUTES') {
+ waitForQualityGate abortPipeline: true
+ }
+ }
+ }
+ }
+ }
+
+ stage('Publish Package') {
+ steps {
+ container('gradle') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
+ }
+ }
+ }
+ }
+
+ /* stage('Deploy Dev') {
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
+ echo "Work in progress"
+ }
+ }
+ stage('Smoke Test'){
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Smoke Test on target dev environment post deployment"
+ echo 'Work in progress'
+ }
+ } */
+ }
+}
From 652aa5d281192d0795e2a37a13fd80c47029dddb Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 18:47:35 +0530
Subject: [PATCH 089/166] Update Jenkinsfile
---
Jenkinsfile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 442d67e..62fb36d 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -30,6 +30,7 @@ spec:
stages {
stage('check_gradle_version') {
+ parallel {
steps {
container('gradle') {
sh 'gradle -v'
@@ -86,7 +87,7 @@ spec:
}
}
}
-
+ }
/* stage('Deploy Dev') {
when { branch 'dev'}
steps {
@@ -94,6 +95,7 @@ spec:
echo "Work in progress"
}
}
+
stage('Smoke Test'){
when { branch 'dev'}
From cbbafee0602538e28cfbe93654d61b9d6635d080 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 18:57:56 +0530
Subject: [PATCH 090/166] Update Jenkinsfile
---
Jenkinsfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 62fb36d..f281834 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -30,7 +30,7 @@ spec:
stages {
stage('check_gradle_version') {
- parallel {
+
steps {
container('gradle') {
sh 'gradle -v'
@@ -94,7 +94,7 @@ spec:
echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
echo "Work in progress"
}
- }
+
stage('Smoke Test'){
From bc158b30e599e6b114f9c0e5c4de5605aa1303eb Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 18:58:56 +0530
Subject: [PATCH 091/166] Update Jenkinsfile
---
Jenkinsfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index f281834..17fb897 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -87,14 +87,14 @@ spec:
}
}
}
- }
+
/* stage('Deploy Dev') {
when { branch 'dev'}
steps {
echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
echo "Work in progress"
}
-
+ }
stage('Smoke Test'){
From bbfc9adfdde86ec2c72439b6c13c26d5d4abe9df Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 19:07:55 +0530
Subject: [PATCH 092/166] Update Jenkinsfile
---
Jenkinsfile | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 17fb897..8f69540 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -30,7 +30,7 @@ spec:
stages {
stage('check_gradle_version') {
-
+ parallel {
steps {
container('gradle') {
sh 'gradle -v'
@@ -88,7 +88,7 @@ spec:
}
}
- /* stage('Deploy Dev') {
+ stage('Deploy Dev') {
when { branch 'dev'}
steps {
echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
@@ -103,6 +103,7 @@ spec:
echo "I am executing Smoke Test on target dev environment post deployment"
echo 'Work in progress'
}
- } */
+ }
}
}
+}
From bf71af730ef794343836300d2d398587e1b2b0f8 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 19:10:19 +0530
Subject: [PATCH 093/166] Update Jenkinsfile
---
Jenkinsfile | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 8f69540..876ef49 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -87,8 +87,22 @@ spec:
}
}
}
+
+ stage('Build') {
+ //GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
+ when { expression {!(env.GIT_BRANCH =~ /feature/ )}}
+ steps {
+ sh 'I am executing build'
+ }
+ }
+ stage('Deploy') {
+ when { expression {!(env.GIT_BRANCH =~ /feature/ )}}
+ steps {
+ echo "I am executing Deploy"
+ }
+ }
- stage('Deploy Dev') {
+ /* stage('Deploy Dev') {
when { branch 'dev'}
steps {
echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
@@ -103,7 +117,7 @@ spec:
echo "I am executing Smoke Test on target dev environment post deployment"
echo 'Work in progress'
}
- }
+ } */
}
}
}
From 8b6055064c64626eb85c78dd81484b83b0a79005 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 19:15:33 +0530
Subject: [PATCH 094/166] Update Jenkinsfile
---
Jenkinsfile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 876ef49..2e5477a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -98,7 +98,8 @@ spec:
stage('Deploy') {
when { expression {!(env.GIT_BRANCH =~ /feature/ )}}
steps {
- echo "I am executing Deploy"
+ echo "I am executing Deploy"
+ echo "Deploy"
}
}
From 7c033575e99099b377020a637a34d8af7d78446c Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 19:33:58 +0530
Subject: [PATCH 095/166] Create hello
---
hello | 1 +
1 file changed, 1 insertion(+)
create mode 100644 hello
diff --git a/hello b/hello
new file mode 100644
index 0000000..ce01362
--- /dev/null
+++ b/hello
@@ -0,0 +1 @@
+hello
From ea638230b66ff4588b8456eaf9eaa6ea1d4b6660 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 20:01:40 +0530
Subject: [PATCH 096/166] Update hello
---
hello | 1 +
1 file changed, 1 insertion(+)
diff --git a/hello b/hello
index ce01362..d0e08a8 100644
--- a/hello
+++ b/hello
@@ -1 +1,2 @@
hello
+hi
From 3db6aeb77d7a5c70b8bedf309d91c1f34ee44011 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 20:02:25 +0530
Subject: [PATCH 097/166] Update hello
From 89a1ef4f3cae6a852ee2890d8f36cad14b321fca Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 20:04:54 +0530
Subject: [PATCH 098/166] Update Jenkinsfile
---
Jenkinsfile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 2e5477a..bc7d5a9 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -29,8 +29,9 @@ spec:
}
stages {
+ parallel {
stage('check_gradle_version') {
- parallel {
+
steps {
container('gradle') {
sh 'gradle -v'
From 40b81eadb0501f19a8b4e9f071e457df1d00db64 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 20:13:20 +0530
Subject: [PATCH 099/166] Update Jenkinsfile
---
Jenkinsfile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index bc7d5a9..1d509b7 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -59,7 +59,8 @@ spec:
}
}
}
- }
+ }
+ }
stage('Code Quality') {
steps {
@@ -122,4 +123,4 @@ spec:
} */
}
}
-}
+
From d752e3a81c0566fe592643911cdf862cc3ee2cb1 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 20:16:35 +0530
Subject: [PATCH 100/166] Update Jenkinsfile
---
Jenkinsfile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Jenkinsfile b/Jenkinsfile
index 1d509b7..6494377 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -29,7 +29,9 @@ spec:
}
stages {
+ stage ('test') {
parallel {
+
stage('check_gradle_version') {
steps {
@@ -61,6 +63,7 @@ spec:
}
}
}
+ }
stage('Code Quality') {
steps {
From 550a99ce02085939714c70a66aac2afb7e09c3b9 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 20 Jan 2021 20:20:37 +0530
Subject: [PATCH 101/166] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 6494377..bdee826 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -82,7 +82,7 @@ spec:
}
}
- stage('Publish Package') {
+ /* stage('Publish Package') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
From 0db947e9eef8f558668f9051dcddce0aef307355 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 21 Jan 2021 18:47:31 +0530
Subject: [PATCH 102/166] Update Jenkinsfile
---
Jenkinsfile | 158 ++++++++++++++++++----------------------------------
1 file changed, 53 insertions(+), 105 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index bdee826..15fa628 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,129 +1,77 @@
pipeline {
- environment {
+ environment {
PROJECT_ID = "sd-devops"
APP_NAME = "sample-java-app"
CLUSTER_NAME = "cluster-1"
CLUSTER_ZONE = "us-central1-a"
CREDENTIALS_ID = "sd-devops"
- }
+ }
//agent any 2
- agent {
- kubernetes {
- label 'SpringBootRestApp'
- defaultContainer 'jnlp'
- yaml """
-apiVersion: v1
-kind: Pod
-metadata:
-labels:
- component: ci
-spec:
- containers:
- - name: gradle
- image: gradle:3.5-jdk8-alpine
- command:
- - cat
- tty: true
-"""
-}
+ agent {
+ kubernetes {
+ label 'SpringBootRestApp'
+ defaultContainer 'jnlp'
+ yaml ""
+ "
+ apiVersion: v1
+ kind: Pod
+ metadata:
+ labels:
+ component: ci
+ spec:
+ containers:
+ -name: gradle
+ image: gradle: 3.5 - jdk8 - alpine
+ command:
+ -cat
+ tty: true ""
+ "
+ }
}
-
- stages {
- stage ('test') {
- parallel {
-
- stage('check_gradle_version') {
-
- steps {
- container('gradle') {
- sh 'gradle -v'
- sh 'echo workspace is $WORKSPACE'
- sh "ls -la ${pwd()}"
- sh 'chmod 777 * '
- sh './gradlew compileJava'
- }
- }
- }
-
-
- stage('Unit Test') {
- steps {
- container('gradle') {
- withMaven(maven: 'MAVEN-3.6.3') {
- withSonarQubeEnv(installationName:'Sonarqube') {
- echo 'I am executing unit test'
- sh "ls -la ${pwd()}"
- sh 'mvn -f sample-java-app/pom.xml clean package'
-
-
-
- }
+ stages {
+ stage('test') {
+ parallel {
+ stage('check_gradle_version') {
+ steps {
+ container('gradle') {
+ sh 'gradle -v'
+ sh 'echo workspace is $WORKSPACE'
+ sh "ls -la ${pwd()}"
+ sh 'chmod 777 * '
+ sh './gradlew compileJava'
+ }
+ }
+ }
+ stage('Unit Test') {
+ steps {
+ container('gradle') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName: 'Sonarqube') {
+ echo 'I am executing unit test'
+ sh "ls -la ${pwd()}"
+ sh 'mvn -f sample-java-app/pom.xml clean package'
+ }
+ }
+ }
}
}
}
- }
- }
- }
-
- stage('Code Quality') {
+ }
+ stage('Code Quality') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
- withSonarQubeEnv(installationName:'Sonarqube') {
- echo 'I am executing code quality using sonarqube'
+ withSonarQubeEnv(installationName: 'Sonarqube') {
+ echo 'I am executing code quality using sonarqube'
sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
}
sleep(60)
timeout(time: 1, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
- }
+ }
}
}
- }
- }
-
- /* stage('Publish Package') {
- steps {
- container('gradle') {
- withMaven(maven: 'MAVEN-3.6.3') {
- echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
- }
- }
- }
- }
-
- stage('Build') {
- //GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
- when { expression {!(env.GIT_BRANCH =~ /feature/ )}}
- steps {
- sh 'I am executing build'
- }
- }
- stage('Deploy') {
- when { expression {!(env.GIT_BRANCH =~ /feature/ )}}
- steps {
- echo "I am executing Deploy"
- echo "Deploy"
- }
- }
-
- /* stage('Deploy Dev') {
- when { branch 'dev'}
- steps {
- echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
- echo "Work in progress"
- }
- }
-
-
- stage('Smoke Test'){
- when { branch 'dev'}
- steps {
- echo "I am executing Smoke Test on target dev environment post deployment"
- echo 'Work in progress'
}
- } */
+ }
}
}
-
From ab61dc718779815ac222dc66b8490225fc8fe84f Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 21 Jan 2021 18:57:07 +0530
Subject: [PATCH 103/166] Update Jenkinsfile
---
Jenkinsfile | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 15fa628..9c1272e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -11,8 +11,7 @@ pipeline {
kubernetes {
label 'SpringBootRestApp'
defaultContainer 'jnlp'
- yaml ""
- "
+ yaml """
apiVersion: v1
kind: Pod
metadata:
@@ -24,8 +23,8 @@ pipeline {
image: gradle: 3.5 - jdk8 - alpine
command:
-cat
- tty: true ""
- "
+ tty: true
+ """
}
}
stages {
From 64419ac5bb95913045567ae6016d6db3191361a0 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 21 Jan 2021 20:02:36 +0530
Subject: [PATCH 104/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 107 ++++++++++++++++++++++--------------------------
1 file changed, 50 insertions(+), 57 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index fae095e..68bae43 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -1,4 +1,3 @@
-
pipeline {
environment {
PROJECT_ID = "sd-devops"
@@ -30,77 +29,71 @@ spec:
}
stages {
- stage('check_gradle_version') {
- steps {
- container('gradle') {
- sh 'gradle -v'
- sh 'echo workspace is $WORKSPACE'
- sh "ls -la ${pwd()}"
- sh 'chmod 777 * '
- sh './gradlew compileJava'
- }
- }
- }
-
-
- stage('Unit Test') {
- steps {
- container('gradle') {
- withMaven(maven: 'MAVEN-3.6.3') {
- withSonarQubeEnv(installationName:'Sonarqube') {
- echo 'I am executing unit test'
- sh "ls -la ${pwd()}"
- sh 'mvn -f sample-java-app/pom.xml clean package'
-
-
-
- }
+ stage('check_gradle_version') {
+ steps {
+ container('gradle') {
+ sh 'gradle -v'
+ sh 'echo workspace is $WORKSPACE'
+ sh "ls -la ${pwd()}"
+ sh 'chmod 777 * '
+ sh './gradlew compileJava'
}
}
}
- }
-
- stage('Code Quality') {
+ stage('Unit Test') {
+ steps {
+ container('gradle') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName: 'Sonarqube') {
+ echo 'I am executing unit test'
+ sh "ls -la ${pwd()}"
+ sh 'mvn -f sample-java-app/pom.xml clean package'
+ }
+ }
+ }
+ }
+ }
+
+ stage('Code Quality') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
- withSonarQubeEnv(installationName:'Sonarqube') {
- echo 'I am executing code quality using sonarqube'
+ withSonarQubeEnv(installationName: 'Sonarqube') {
+ echo 'I am executing code quality using sonarqube'
sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
}
sleep(60)
timeout(time: 1, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
- }
+ }
}
}
- }
- }
-
- stage('Publish Package') {
- steps {
- container('gradle') {
+ }
+ }
+
+ stage('Publish Package') {
+ steps {
+ container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
- echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
- }
- }
- }
- }
-
- /* stage('Deploy Dev') {
- when { branch 'dev'}
- steps {
- echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
- echo "Work in progress"
- }
- }
- stage('Smoke Test'){
- when { branch 'dev'}
- steps {
- echo "I am executing Smoke Test on target dev environment post deployment"
- echo 'Work in progress'
+ }
}
- } */
+ }
}
+ /* stage('Deploy Dev') {
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
+ echo "Work in progress"
+ }
+ }
+ stage('Smoke Test'){
+ when { branch 'dev'}
+ steps {
+ echo "I am executing Smoke Test on target dev environment post deployment"
+ echo 'Work in progress'
+ }
+ } */
+}
}
From df5d51765fbb093a2e386802fb300c3db42b27ef Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Fri, 22 Jan 2021 17:11:26 +0530
Subject: [PATCH 105/166] Create hihello
---
hihello | 1 +
1 file changed, 1 insertion(+)
create mode 100644 hihello
diff --git a/hihello b/hihello
new file mode 100644
index 0000000..ce01362
--- /dev/null
+++ b/hihello
@@ -0,0 +1 @@
+hello
From 5c4fc8577715f317039e8966b1e2c9f80c68c4a2 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Fri, 22 Jan 2021 17:39:21 +0530
Subject: [PATCH 106/166] Create project.properties
---
project.properties | 1 +
1 file changed, 1 insertion(+)
create mode 100644 project.properties
diff --git a/project.properties b/project.properties
new file mode 100644
index 0000000..d50c1c0
--- /dev/null
+++ b/project.properties
@@ -0,0 +1 @@
+branch_name:feature
From 4b3490eff64aa81f9ec4aa5adc525a3b21ad84db Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Fri, 22 Jan 2021 17:41:05 +0530
Subject: [PATCH 107/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index d50c1c0..f6aac57 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-branch_name:feature
+branch_name=feature
From cfcd424a7b70d9fce70e19e6666bead7f30db12c Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Fri, 22 Jan 2021 20:18:55 +0530
Subject: [PATCH 108/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index f6aac57..bc7826f 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-branch_name=feature
+deploy=true
From 6dd2e143f01abbea38d57269f0695aee9201578d Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Fri, 22 Jan 2021 20:34:26 +0530
Subject: [PATCH 109/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index bc7826f..ff14346 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-deploy=true
+deploy=
From a359ecb83b4e139b5bcdb8a87148b07b99b77acb Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Fri, 22 Jan 2021 22:27:37 +0530
Subject: [PATCH 110/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index ff14346..bc7826f 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-deploy=
+deploy=true
From 95c22647c4e73adfbdadb5680f5247e96a1e272a Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Fri, 22 Jan 2021 22:34:59 +0530
Subject: [PATCH 111/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index bc7826f..ff14346 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-deploy=true
+deploy=
From b9200ded9de6bad878992de6f2eb3d91ccf64314 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Fri, 22 Jan 2021 22:42:04 +0530
Subject: [PATCH 112/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index ff14346..bc7826f 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-deploy=
+deploy=true
From f8bcbb3844c5accd04d5f03f655e2a7053099813 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Fri, 22 Jan 2021 22:43:16 +0530
Subject: [PATCH 113/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index bc7826f..ff14346 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-deploy=true
+deploy=
From 5ec84700342d345f2b7ef85545ac0fbc54ddcee7 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Fri, 22 Jan 2021 22:56:00 +0530
Subject: [PATCH 114/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index ff14346..bc7826f 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-deploy=
+deploy=true
From d383c04843cae9079fa555ca1fee712f9b4a9a47 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 25 Jan 2021 12:22:09 +0530
Subject: [PATCH 115/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index bc7826f..055e3de 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-deploy=true
+deploy:true
From d120a76115b182b3834b87f2a1b9f3251a7b96fb Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 25 Jan 2021 12:26:57 +0530
Subject: [PATCH 116/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index 055e3de..bc7826f 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-deploy:true
+deploy=true
From 6ed37bf0c85ab33ebdae8fe1a4561d3840182d6d Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 25 Jan 2021 12:34:05 +0530
Subject: [PATCH 117/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index bc7826f..909a08c 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-deploy=true
+deploy=false
From 5d1af845c42cc02dc6aa8805cdb3491b2b5294a5 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 25 Jan 2021 12:39:23 +0530
Subject: [PATCH 118/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index 909a08c..bc7826f 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1 @@
-deploy=false
+deploy=true
From 7ef2d110e4fb09adfdf89fb44f3d2a598b2fcaab Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 25 Jan 2021 17:01:35 +0530
Subject: [PATCH 119/166] Update project.properties
---
project.properties | 2 ++
1 file changed, 2 insertions(+)
diff --git a/project.properties b/project.properties
index bc7826f..8232dd0 100644
--- a/project.properties
+++ b/project.properties
@@ -1 +1,3 @@
deploy=true
+dev1=lxapp.2378
+dev2=lxapp.62576
From da8891487ef5f1264679f9bf3dbe44cc5f40b46e Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 25 Jan 2021 17:50:07 +0530
Subject: [PATCH 120/166] Update project.properties
---
project.properties | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/project.properties b/project.properties
index 8232dd0..d783620 100644
--- a/project.properties
+++ b/project.properties
@@ -1,3 +1,2 @@
deploy=true
-dev1=lxapp.2378
-dev2=lxapp.62576
+servers=lxapp.2378 lxapp.656 lxapp.5376
From e3948b98afd6546e9908335454ef9d948405c0da Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 25 Jan 2021 17:54:48 +0530
Subject: [PATCH 121/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index d783620..0c999e7 100644
--- a/project.properties
+++ b/project.properties
@@ -1,2 +1,2 @@
deploy=true
-servers=lxapp.2378 lxapp.656 lxapp.5376
+servers="lxapp.2378 lxapp.656 lxapp.5376"
From 9190bd65b749b3ea9ac4292bcb813e565b9cbc7e Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 25 Jan 2021 17:58:08 +0530
Subject: [PATCH 122/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index 0c999e7..c09c61f 100644
--- a/project.properties
+++ b/project.properties
@@ -1,2 +1,2 @@
deploy=true
-servers="lxapp.2378 lxapp.656 lxapp.5376"
+servers='lxapp.2378 lxapp.656 lxapp.5376'
From 31dc454cc8839ee4a364fb3ee7c5b504f6ef6aeb Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Mon, 25 Jan 2021 18:01:00 +0530
Subject: [PATCH 123/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index c09c61f..d783620 100644
--- a/project.properties
+++ b/project.properties
@@ -1,2 +1,2 @@
deploy=true
-servers='lxapp.2378 lxapp.656 lxapp.5376'
+servers=lxapp.2378 lxapp.656 lxapp.5376
From b1398d2fb55fa0e56c1d62055e65376a9f727b94 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 18:31:58 +0530
Subject: [PATCH 124/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index d783620..d3d6d58 100644
--- a/project.properties
+++ b/project.properties
@@ -1,2 +1,2 @@
-deploy=true
+feature_deploy=true
servers=lxapp.2378 lxapp.656 lxapp.5376
From 45169a7698fda72e3ca542be53a35b172a7f8840 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 18:43:54 +0530
Subject: [PATCH 125/166] Create Jenkins_Tweak
---
Jenkins_Tweak | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 91 insertions(+)
create mode 100644 Jenkins_Tweak
diff --git a/Jenkins_Tweak b/Jenkins_Tweak
new file mode 100644
index 0000000..6dae304
--- /dev/null
+++ b/Jenkins_Tweak
@@ -0,0 +1,91 @@
+pipeline {
+agent {
+ kubernetes {
+ label 'SpringBootRestApp'
+ defaultContainer 'jnlp'
+ yaml """
+apiVersion: v1
+kind: Pod
+metadata:
+labels:
+ component: ci
+spec:
+ containers:
+ - name: gradle
+ image: gradle:3.5-jdk8-alpine
+ command:
+ - cat
+ tty: true
+"""
+}
+ }
+
+ stages {
+
+ stage('SCM Checkout') {
+ steps {
+
+
+
+ //git branch: 'feature', credentialsId: 'git_creds', url: 'https://github.com/sdgcpsb/SpringBootRestApp.git'
+
+ script {
+ propfile = readProperties(file: './project.properties')
+ println ("reading properties ...")
+println ("branch_name:"+ propfile['deploy'])
+
+ }
+
+ }
+
+
+
+ }
+
+
+
+ stage ("Deploy") {
+ steps {
+ container ('gradle') {
+ sh '''
+
+ deploy=`cat project.properties | grep "feature_deploy" | cut -d'=' -f2 | awk '{print $1}' `
+
+
+ if test "$deploy" = true
+ then
+ echo " im deploying"
+ else
+ echo "no need"
+ fi
+
+ server_list=`cat project.properties | grep "servers" | cut -d'=' -f2 `
+ echo $server_list
+ for server in $server_list
+
+ do
+
+ echo $server
+ done
+
+
+
+ '''
+
+
+
+ }
+ }
+ }
+ stage ("use env vars") {
+ steps {
+ sh "printenv | sort"
+ echo "BUILD_NUMBER = ${env.BUILD_NUMBER}"
+ echo "BRANCH_NAME = ${env.BRANCH_NAME}"
+ }
+ }
+
+
+ }
+}
+
From f441eed1d86ae023fc61196395152ba5629762fe Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 18:49:10 +0530
Subject: [PATCH 126/166] Update Jenkins_Tweak
---
Jenkins_Tweak | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkins_Tweak b/Jenkins_Tweak
index 6dae304..90eae58 100644
--- a/Jenkins_Tweak
+++ b/Jenkins_Tweak
@@ -27,14 +27,14 @@ spec:
- //git branch: 'feature', credentialsId: 'git_creds', url: 'https://github.com/sdgcpsb/SpringBootRestApp.git'
+ /* //git branch: 'feature', credentialsId: 'git_creds', url: 'https://github.com/sdgcpsb/SpringBootRestApp.git'
script {
propfile = readProperties(file: './project.properties')
println ("reading properties ...")
println ("branch_name:"+ propfile['deploy'])
- }
+ } */
}
From de09e2537d59a74f5b66d4ba17d1fed8b8cd71ee Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 18:53:37 +0530
Subject: [PATCH 127/166] Update Jenkins_Tweak
---
Jenkins_Tweak | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Jenkins_Tweak b/Jenkins_Tweak
index 90eae58..619e108 100644
--- a/Jenkins_Tweak
+++ b/Jenkins_Tweak
@@ -1,5 +1,7 @@
pipeline {
-agent {
+
+ //agent any 2
+ agent {
kubernetes {
label 'SpringBootRestApp'
defaultContainer 'jnlp'
From b8765c199e7725ac86dd4cecfd707c8f67934e40 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 19:02:39 +0530
Subject: [PATCH 128/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 48 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 45 insertions(+), 3 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 68bae43..d850f16 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -70,8 +70,48 @@ spec:
}
}
}
-
- stage('Publish Package') {
+ stage ("Deploy") {
+ steps {
+ container ('gradle') {
+ sh '''
+
+ deploy=`cat project.properties | grep "feature_deploy" | cut -d'=' -f2 | awk '{print $1}' `
+
+
+ if test "$deploy" = true
+ then
+ echo " im deploying"
+ withMaven(maven: 'MAVEN-3.6.3') {
+ echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
+ else
+ echo "no need"
+ fi
+
+ server_list=`cat project.properties | grep "servers" | cut -d'=' -f2 `
+ echo $server_list
+
+ for server in $server_list
+
+ do
+
+ echo $server
+ done
+
+
+
+ '''
+ }
+ }
+ }
+ stage ("use env vars") {
+ steps {
+ sh "printenv | sort"
+ echo "BUILD_NUMBER = ${env.BUILD_NUMBER}"
+ echo "BRANCH_NAME = ${env.BRANCH_NAME}"
+ }
+ }
+ /* stage('Publish Package') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
@@ -80,7 +120,9 @@ spec:
}
}
}
- }
+ } */
+
+
/* stage('Deploy Dev') {
when { branch 'dev'}
steps {
From b0939139976b9d4940fa4529e1c393e67ec01759 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 19:09:03 +0530
Subject: [PATCH 129/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index d850f16..aea56ab 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -83,7 +83,7 @@ spec:
echo " im deploying"
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
+ 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
else
echo "no need"
fi
From 65245def16acb3f148bd24c3540a700c0eb19c0b Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 19:14:24 +0530
Subject: [PATCH 130/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index aea56ab..a698c31 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -81,9 +81,9 @@ spec:
if test "$deploy" = true
then
echo " im deploying"
- withMaven(maven: 'MAVEN-3.6.3') {
+ /* withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
+ 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/' */
else
echo "no need"
fi
From dae77e3bd4e42acdd6f06b90b4ad8d401d8ecaab Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 19:19:36 +0530
Subject: [PATCH 131/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index a698c31..96566fc 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -81,9 +81,10 @@ spec:
if test "$deploy" = true
then
echo " im deploying"
- /* withMaven(maven: 'MAVEN-3.6.3') {
+ withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/' */
+ 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
+ }
else
echo "no need"
fi
From 858cd959c3f6374d3d388e614b436e86f599438f Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 20:16:13 +0530
Subject: [PATCH 132/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 96566fc..d0fa883 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -83,7 +83,7 @@ spec:
echo " im deploying"
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
+ mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/
}
else
echo "no need"
From b6b8627634f4dd153a81d9cffa2ee39113272720 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 20:27:18 +0530
Subject: [PATCH 133/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index d0fa883..2e432fc 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -83,7 +83,8 @@ spec:
echo " im deploying"
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/
+ ls -lart
+ "mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/"
}
else
echo "no need"
From 9a0fa257b36ee2658be4b7527efafdd31379a231 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 22:01:57 +0530
Subject: [PATCH 134/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 2e432fc..54a8f58 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -81,11 +81,8 @@ spec:
if test "$deploy" = true
then
echo " im deploying"
- withMaven(maven: 'MAVEN-3.6.3') {
- echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- ls -lart
- "mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/"
- }
+ ls -lart
+
else
echo "no need"
fi
From df790739cdc66679f243286f1b84363997a1cdc1 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 22:20:11 +0530
Subject: [PATCH 135/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 54a8f58..bc6eda8 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -81,7 +81,10 @@ spec:
if test "$deploy" = true
then
echo " im deploying"
- ls -lart
+ withMaven(maven: 'MAVEN-3.6.3') {
+ echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ `mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/ `
+ }
else
echo "no need"
From 49236aca3d71ffdefd4d1e686b810d99f4dc5cdf Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 27 Jan 2021 22:46:52 +0530
Subject: [PATCH 136/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index bc6eda8..e9f38fd 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -83,7 +83,7 @@ spec:
echo " im deploying"
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- `mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/ `
+
}
else
From 88602869e02eb28c8e21e9f24902a8e75e5b0805 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:02:26 +0530
Subject: [PATCH 137/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index e9f38fd..7f9533a 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -81,11 +81,12 @@ spec:
if test "$deploy" = true
then
echo " im deploying"
+ '''
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
}
-
+ sh '''
else
echo "no need"
fi
From 7cc3d3e5fb2f329de5628d97d010147e9a69b6d9 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:12:08 +0530
Subject: [PATCH 138/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 7f9533a..127a582 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -70,7 +70,7 @@ spec:
}
}
}
- stage ("Deploy") {
+ /* stage ("Deploy") {
steps {
container ('gradle') {
sh '''
@@ -106,7 +106,22 @@ spec:
'''
}
}
- }
+ } */
+
+ stage ("Deploy") {
+ steps {
+ container ('gradle') {
+ script {
+ propfile = readProperties(file: './project.properties')
+ println ("deploy:"+ propfile['feature_deploy'])
+ println ("reading properties ...")
+println ("branch_name:"+ propfile['feature_deploy'])
+
+
+ }
+ }
+ }
+
stage ("use env vars") {
steps {
sh "printenv | sort"
From 4856b004808237746a511a6eee38df635a1abb16 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:13:33 +0530
Subject: [PATCH 139/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 127a582..151c56d 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -116,7 +116,7 @@ spec:
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
println ("branch_name:"+ propfile['feature_deploy'])
-
+ }
}
}
From 9fd423be1717d36948aa5a67d665b9dffc291a56 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:22:05 +0530
Subject: [PATCH 140/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 151c56d..b33322f 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -115,7 +115,16 @@ spec:
propfile = readProperties(file: './project.properties')
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
-println ("branch_name:"+ propfile['feature_deploy'])
+ if($deploy==true){
+ withMaven(maven: 'MAVEN-3.6.3') {
+ echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+
+ }
+ else
+ echo "no need"
+ }
+
+//println ("branch_name:"+ propfile['feature_deploy'])
}
}
From ebd0d0a46f24e861f51afabd9b36c2a74df74057 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:23:56 +0530
Subject: [PATCH 141/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index b33322f..484dd8e 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -120,8 +120,7 @@ spec:
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
}
- else
- echo "no need"
+
}
//println ("branch_name:"+ propfile['feature_deploy'])
From 76b8891d400f95de0b8985325ed08b996731c1c8 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:29:49 +0530
Subject: [PATCH 142/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 484dd8e..b7c8448 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -115,7 +115,7 @@ spec:
propfile = readProperties(file: './project.properties')
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
- if($deploy==true){
+ if($propfile==true){
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
From 29dfb2ff3d1c919ea283fbcb54aa99ac8a0f7d57 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:30:31 +0530
Subject: [PATCH 143/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index b7c8448..cded9d1 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -54,7 +54,7 @@ spec:
}
}
- stage('Code Quality') {
+ /* stage('Code Quality') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
@@ -69,7 +69,7 @@ spec:
}
}
}
- }
+ } */
/* stage ("Deploy") {
steps {
container ('gradle') {
From 0bda1daeab08e429c596d3d8e03dd31c99dbaf76 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:35:26 +0530
Subject: [PATCH 144/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index cded9d1..44fe64b 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -111,7 +111,7 @@ spec:
stage ("Deploy") {
steps {
container ('gradle') {
- script {
+ /*script {
propfile = readProperties(file: './project.properties')
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
@@ -119,12 +119,25 @@ spec:
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- }
+ }
}
//println ("branch_name:"+ propfile['feature_deploy'])
- }
+ } */
+
+ deploy=`cat project.properties | grep "feature_deploy" | cut -d'=' -f2 | awk '{print $1}' `
+
+
+ if test "$deploy" = true
+ then
+ echo " im deploying"
+ withMaven(maven: 'MAVEN-3.6.3') {
+ echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ else
+ echo "no need"
+ fi
+
}
}
From 934cb4d39c8a1a7da2276394ce746aa6daf33d99 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:37:28 +0530
Subject: [PATCH 145/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 1 +
1 file changed, 1 insertion(+)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 44fe64b..bfe1797 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -134,6 +134,7 @@ spec:
echo " im deploying"
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
+ }
else
echo "no need"
fi
From e1b320196267901a65af2cc03bf658daa13db1e3 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:39:22 +0530
Subject: [PATCH 146/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index bfe1797..e56bd4b 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -126,7 +126,7 @@ spec:
//println ("branch_name:"+ propfile['feature_deploy'])
} */
- deploy=`cat project.properties | grep "feature_deploy" | cut -d'=' -f2 | awk '{print $1}' `
+ sh 'deploy=`cat project.properties | grep "feature_deploy" | cut -d'=' -f2 | awk '{print $1}' ` '
if test "$deploy" = true
From 1d8a0dbd233e662e1a645b412d663173d7b086a8 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:41:30 +0530
Subject: [PATCH 147/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index e56bd4b..609b1f5 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -111,33 +111,23 @@ spec:
stage ("Deploy") {
steps {
container ('gradle') {
- /*script {
+ script {
propfile = readProperties(file: './project.properties')
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
- if($propfile==true){
+ echo $propfile
+ /* if($propfile==true){
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
}
- }
+ } */
//println ("branch_name:"+ propfile['feature_deploy'])
- } */
+ }
- sh 'deploy=`cat project.properties | grep "feature_deploy" | cut -d'=' -f2 | awk '{print $1}' ` '
-
-
- if test "$deploy" = true
- then
- echo " im deploying"
- withMaven(maven: 'MAVEN-3.6.3') {
- echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- }
- else
- echo "no need"
- fi
+
}
From 203a795c78bca6bf3f51f717653b06e4429752b3 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 14:47:15 +0530
Subject: [PATCH 148/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 609b1f5..a16a28d 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -115,7 +115,7 @@ spec:
propfile = readProperties(file: './project.properties')
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
- echo $propfile
+ echo propfile
/* if($propfile==true){
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
From fca78dac432946e6bcfc439e4c6f14174535fdcb Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 16:42:49 +0530
Subject: [PATCH 149/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index a16a28d..c8f329e 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -112,10 +112,10 @@ spec:
steps {
container ('gradle') {
script {
- propfile = readProperties(file: './project.properties')
+ /* propfile = readProperties(file: './project.properties')
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
- echo propfile
+ echo propfile */
/* if($propfile==true){
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
@@ -123,6 +123,13 @@ spec:
}
} */
+
+ when {
+ expression { return readFile('project.properties').contains('feature_deploy=true') }
+ echo "hi"
+}
+ }
+
//println ("branch_name:"+ propfile['feature_deploy'])
}
From 8d9da174b2c1e4578c1d63aa59f5e2d4842fdd2b Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 16:44:31 +0530
Subject: [PATCH 150/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index c8f329e..a2b6303 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -112,10 +112,10 @@ spec:
steps {
container ('gradle') {
script {
- /* propfile = readProperties(file: './project.properties')
+ propfile = readProperties(file: './project.properties')
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
- echo propfile */
+
/* if($propfile==true){
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
From f64b5ddf6e7d947754e8916fce5beec271bc839c Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 16:46:13 +0530
Subject: [PATCH 151/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index a2b6303..9370188 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -131,15 +131,12 @@ spec:
}
-//println ("branch_name:"+ propfile['feature_deploy'])
+
}
-
-
-
-
- }
+
}
}
+
stage ("use env vars") {
steps {
From 664d9b8590e404aff082e9ff70793a2fb9be97e5 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 17:53:15 +0530
Subject: [PATCH 152/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 9370188..15ffd86 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -116,18 +116,15 @@ spec:
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
- /* if($propfile==true){
+ if(propfile['feature_deploy']==true){
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
}
- } */
+ }
+
- when {
- expression { return readFile('project.properties').contains('feature_deploy=true') }
- echo "hi"
-}
}
From 7f3dd7f4d52c07e5f3a6f5ed5755bb563a10af3b Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 18:02:44 +0530
Subject: [PATCH 153/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 15ffd86..5d2dc94 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -116,7 +116,8 @@ spec:
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
- if(propfile['feature_deploy']==true){
+ if( propfile['feature_deploy'] == true ){
+ echo "hi"
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
From 45e6a1a89ff585f3430bcfb8e157d8d36c1ed3d6 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 18:10:16 +0530
Subject: [PATCH 154/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 5d2dc94..5a99866 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -116,14 +116,20 @@ spec:
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
- if( propfile['feature_deploy'] == true ){
+ //Boolean.TRUE.equals(propfile['feature_deploy'])
+
+ if( Boolean.TRUE.equals(propfile['feature_deploy']) ){
echo "hi"
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
}
+
}
+ else {
+ echo "no need"
+ }
}
From aa0b7baf507b5b1f6b924538e4c4336df3b1100a Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 18:17:46 +0530
Subject: [PATCH 155/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 5a99866..904222a 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -118,7 +118,7 @@ spec:
//Boolean.TRUE.equals(propfile['feature_deploy'])
- if( Boolean.TRUE.equals(propfile['feature_deploy']) ){
+ if ( propfile['feature_deploy'] == "true" ) {
echo "hi"
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
From 7ca6a1c046a777e529219027442fc8977aecd4a0 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 18:21:53 +0530
Subject: [PATCH 156/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 904222a..d3462fe 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -122,7 +122,7 @@ spec:
echo "hi"
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
-
+ sh 'mvn -X deploy:deploy-file -Dfile=$APP_NAME/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
}
From 24035b97081ea4e2d83a5c84bdf34b218200e739 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 18:25:22 +0530
Subject: [PATCH 157/166] Update project.properties
---
project.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/project.properties b/project.properties
index d3d6d58..76c7318 100644
--- a/project.properties
+++ b/project.properties
@@ -1,2 +1,2 @@
-feature_deploy=true
+feature_deploy=false
servers=lxapp.2378 lxapp.656 lxapp.5376
From 2b2ffb801986df2ac90f940c481b21e7fca10dee Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 22:30:58 +0530
Subject: [PATCH 158/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 83 ++++---------------------------------------------
1 file changed, 6 insertions(+), 77 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index d3462fe..3146cb8 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -54,7 +54,7 @@ spec:
}
}
- /* stage('Code Quality') {
+ stage('Code Quality') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
@@ -69,44 +69,8 @@ spec:
}
}
}
- } */
- /* stage ("Deploy") {
- steps {
- container ('gradle') {
- sh '''
-
- deploy=`cat project.properties | grep "feature_deploy" | cut -d'=' -f2 | awk '{print $1}' `
-
-
- if test "$deploy" = true
- then
- echo " im deploying"
- '''
- withMaven(maven: 'MAVEN-3.6.3') {
- echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
-
- }
- sh '''
- else
- echo "no need"
- fi
-
- server_list=`cat project.properties | grep "servers" | cut -d'=' -f2 `
- echo $server_list
-
- for server in $server_list
-
- do
-
- echo $server
- done
-
-
-
- '''
- }
- }
- } */
+ }
+
stage ("Deploy") {
steps {
@@ -116,28 +80,18 @@ spec:
println ("deploy:"+ propfile['feature_deploy'])
println ("reading properties ...")
- //Boolean.TRUE.equals(propfile['feature_deploy'])
-
if ( propfile['feature_deploy'] == "true" ) {
- echo "hi"
- withMaven(maven: 'MAVEN-3.6.3') {
+ withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
sh 'mvn -X deploy:deploy-file -Dfile=$APP_NAME/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
}
-
}
else {
echo "no need"
}
-
-
- }
-
-
-
- }
-
+ }
+ }
}
}
@@ -149,31 +103,6 @@ spec:
echo "BRANCH_NAME = ${env.BRANCH_NAME}"
}
}
- /* stage('Publish Package') {
- steps {
- container('gradle') {
- withMaven(maven: 'MAVEN-3.6.3') {
- echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
- }
- }
- }
- } */
-
- /* stage('Deploy Dev') {
- when { branch 'dev'}
- steps {
- echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
- echo "Work in progress"
- }
- }
- stage('Smoke Test'){
- when { branch 'dev'}
- steps {
- echo "I am executing Smoke Test on target dev environment post deployment"
- echo 'Work in progress'
- }
- } */
}
}
From cf5ffc5e544f56de6b9528f8d5f3c7b949c5c931 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Thu, 28 Jan 2021 22:35:41 +0530
Subject: [PATCH 159/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 3146cb8..7396997 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -90,7 +90,22 @@ spec:
else {
echo "no need"
}
+
}
+ sh '''
+ server_list=`cat project.properties | grep "servers" | cut -d'=' -f2 `
+ echo $server_list
+
+ for server in $server_list
+
+ do
+
+ echo $server
+ done
+
+
+
+ '''
}
}
}
@@ -101,6 +116,7 @@ spec:
sh "printenv | sort"
echo "BUILD_NUMBER = ${env.BUILD_NUMBER}"
echo "BRANCH_NAME = ${env.BRANCH_NAME}"
+
}
}
From 2807c484a9b8b209ed85fdd4b79b296ffc667504 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Tue, 2 Feb 2021 23:29:46 +0530
Subject: [PATCH 160/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 213 ++++++++++++++++++++++++++++--------------------
1 file changed, 124 insertions(+), 89 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 7396997..ad3aa46 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -1,12 +1,5 @@
pipeline {
- environment {
- PROJECT_ID = "sd-devops"
- APP_NAME = "sample-java-app"
- CLUSTER_NAME = "cluster-1"
- CLUSTER_ZONE = "us-central1-a"
- CREDENTIALS_ID = "sd-devops"
- }
- //agent any 2
+
agent {
kubernetes {
label 'SpringBootRestApp'
@@ -26,99 +19,141 @@ spec:
tty: true
"""
}
- }
+ }
- stages {
- stage('check_gradle_version') {
- steps {
- container('gradle') {
- sh 'gradle -v'
- sh 'echo workspace is $WORKSPACE'
- sh "ls -la ${pwd()}"
- sh 'chmod 777 * '
- sh './gradlew compileJava'
+stages {
+ stage('Build & Unit Test') {
+ steps {
+ container('gradle') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName: 'Sonarqube') {
+ echo 'I am executing unit test'
+ // sh 'for i in ESBAuditClient ESBAuditLog ESBErrorTranslator TaxESB FraudESB FulfillmentESB PaymentESB ESBRadial ESBAutomatedQueueRetry AlertESB OrderReconESB;do gradle --no-daemon -p ${i} clean build;done'
+ sh 'mvn -f sample-java-app/pom.xml clean package'
}
}
}
- stage('Unit Test') {
- steps {
- container('gradle') {
+ }
+ }
+ stage('Code Quality') {
+ steps {
+ container('gradle') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ withSonarQubeEnv(installationName: 'Sonarqube') {
+ echo 'I am executing code quality using sonarqube'
+ sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
+ }
+ /* sleep(60)
+ timeout(time: 1, unit: 'MINUTES') {
+ waitForQualityGate abortPipeline: true
+ } */
+ }
+ }
+ }
+ }
+ stage("Publish Package") {
+ steps {
+ container('gradle') {
+ script {
+ propfile = readProperties(file: './project.properties')
+ println("deploy:" + propfile['feature_deploy'])
+ println("reading properties ...")
+ if (propfile['feature_deploy'] == "true" || env.BRANCH_NAME == 'dev' || env.BRANCH_NAME == 'release') {
withMaven(maven: 'MAVEN-3.6.3') {
- withSonarQubeEnv(installationName: 'Sonarqube') {
- echo 'I am executing unit test'
- sh "ls -la ${pwd()}"
- sh 'mvn -f sample-java-app/pom.xml clean package'
- }
+ echo 'I am pushing the artifact with unique name showing the branch from which it is generated, to Archiva'
+ /* echo 'copying the jar and war files from the individual target directorrys and copying it to artifacts directory '
+ sh "mkdir -p $WORKSPACE/artifacts"
+ sh 'for i in ESBAuditClient ESBAuditLog ESBErrorTranslator TaxESB FraudESB FulfillmentESB PaymentESB ESBRadial ESBAutomatedQueueRetry AlertESB OrderReconESB;do cp -rp ${i}/dist/libs/* $WORKSPACE/artifacts/ ;done' */
+ /* echo 'create a tar file on the Jenkins server'
+ sh "cd $WORKSPACE/artifacts/ && tar -cvzf artifact.tar * && md5sum artifact.tar archiveArtifacts artifacts: 'artifacts/*.tar', fingerprint: true */
+ sh 'mv sample-java-app/target/sample-0.0.1-SNAPSHOT.jar sample-java-app/target/sample-build_${BUILD_NUMBER}-branch_${BRANCH_NAME}.jar'
+ sh 'ls -lrt sample-java-app/target/'
+ sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-build_${BUILD_NUMBER}-branch_${BRANCH_NAME}.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
+ echo "noooooooooooooooooo"
}
}
}
}
-
- stage('Code Quality') {
- steps {
- container('gradle') {
- withMaven(maven: 'MAVEN-3.6.3') {
- withSonarQubeEnv(installationName: 'Sonarqube') {
- echo 'I am executing code quality using sonarqube'
- sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
- }
- sleep(60)
- timeout(time: 1, unit: 'MINUTES') {
- waitForQualityGate abortPipeline: true
+ }
+ }
+ stage("Deploy") {
+ steps {
+ container('gradle') {
+ script {
+ propfile = readProperties(file: './project.properties')
+ println("deploy:" + propfile['feature_deploy'])
+ println("reading properties ...")
+ if (propfile['feature_deploy'] == "true" || env.BRANCH_NAME == 'dev' || env.BRANCH_NAME == 'release') {
+ withMaven(maven: 'MAVEN-3.6.3') {
+ echo 'I am deploying the artifact into the target environment'
+ echo 'shutting down the tomcat ESB server'
+ /* sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "$ESB_BIN_PATH stop || sleep 20"'
+ echo 'force stop any remaining mule process'
+ sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "if [[ $(ps aux | grep /opt/mule/latest/ | grep -vc grep) > 0 ]]; then "kill -9 $(ps -ef|pgrep -f "/opt/mule/latest/bin")"; else echo "do nothing"; fi"' */
+ echo 'tomcat server stopped'
+ echo 'copying the tar file from jenkins to deployment directory on app and remove the old folders and untarring the new jar and war files'
+ /* sh 'scp -rp $WORKSPACE/artifacts/artifact.tar $DEPLOYMENT_USER@$DEPOYMENT_SERVER:$DEPLOYMENT_STAGE_DIR/'
+ sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "cd $DEPLOYMENT_STAGE_DIR && rm -rf *.war *.jar"'
+ sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "cd $DEPLOYMENT_STAGE_DIR && tar -xvzf artifact.tar && rm -rf *.jar"'
+ sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "cd $DEPLOYMENT_DIR && rm -rf $ESB_WAR_FOLDERS && cp -rp $DEPLOYMENT_STAGE_DIR/*.war $DEPLOYMENT_DIR"' */
+ echo 'Deployment has been completed'
+ echo 'starting the tomcat ESB server'
+ /* sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "$ESB_BIN_PATH start"'
+ sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "sleep 20"' */
+ echo 'tomcat server started'
}
+ } else {
+ echo "no need"
}
}
}
- }
-
-
- stage ("Deploy") {
- steps {
- container ('gradle') {
- script {
- propfile = readProperties(file: './project.properties')
- println ("deploy:"+ propfile['feature_deploy'])
- println ("reading properties ...")
-
- if ( propfile['feature_deploy'] == "true" ) {
- withMaven(maven: 'MAVEN-3.6.3') {
- echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
- sh 'mvn -X deploy:deploy-file -Dfile=$APP_NAME/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
- }
-
- }
- else {
- echo "no need"
- }
-
+ }
+ }
+ stage('Smoke Test') {
+ parallel {
+ stage('Security Test') {
+ steps {
+ echo 'I am running Security Test here'
+ echo 'I am running Smoke Test here'
}
- sh '''
- server_list=`cat project.properties | grep "servers" | cut -d'=' -f2 `
- echo $server_list
-
- for server in $server_list
-
- do
-
- echo $server
- done
-
-
-
- '''
- }
- }
- }
-
-
- stage ("use env vars") {
- steps {
- sh "printenv | sort"
- echo "BUILD_NUMBER = ${env.BUILD_NUMBER}"
- echo "BRANCH_NAME = ${env.BRANCH_NAME}"
-
- }
- }
-
-}
+ /*RESP=`curl -X GET "${bamboo.uri}/RequestsRunning" -H "accept: application/xml" -H "authorization: bearer lR0AA2qfq7v9Ry96vDAgqcer1GPVd5yStmv1_aJVFS43rk06EytB7WsS0_owoiXIgpOXmZVEfkY4ST0JwHtRBk7RH0QRaldWtQT8udC0VdimdGx38RddY2sGaeeF0t9Aflr5rh1Jc_EUfkNK8YrKVxQ6kxB05aCe46CD2fkognv7TiJATmht-ycUjEsd_oy8jH5EK9fmn9eL-wXavNTQcEdsUmFm3-2r3IJDzMK7XCa74qu353yOKLvVyZ1yYQBnc1_fY5GS1BDrFLUZprxpAS30lGEu-d_JTTOQ989UJtIEB3cZzDkIQzeqdYBGCsiDdjdHo2DC1FK2kVPyBITTbQ"`
+ echo "The response for current execution status is: $RESP"
+ if [ "$RESP" != "[]" ];
+ then
+ echo "There is a test executing currently in Worksoft. Hence, not proceeding with the execution of Worksoft test cases."
+ exit 1
+ else
+ echo "There are no tests executing right now. Hence, proceeding with Worksoft test execution"
+ fi
+ # To abort the request before attempting to re-run, uncomment and run below line.
+ # abort=$(curl -X PUT -H "Authorization: Bearer $token" -d "" -H "id: ${bamboo.RequestID}" ${bamboo.uri}/Request/${bamboo.RequestID}/abort/)
+ guid=$(curl -X PUT -H "Authorization: Bearer $token" -d "" -H "parameters: {TestEnv}{${bamboo.stage_name}}" -H "id: ${bamboo.RequestID}" ${bamboo.uri}/ExecuteRequest/ | tr -d \")
+ echo "The GUID is: $guid"
+ status=$(curl -X GET -H "Authorization: Bearer $token" -d "" -H "APIRequestID: $guid" ${bamboo.uri}/ExecutionStatus/ | awk -F':' '{print $2}' | tr -d \" | tr -d \})
+ echo "The status is: $status"
+ while [[ $status != *"Completed"* ]]
+ do
+ status=$(curl -X GET -H "Authorization: Bearer $token" -d "" -H "APIRequestID: $guid" ${bamboo.uri}/ExecutionStatus/ | awk -F':' '{print $2}' | tr -d \" | tr -d \})
+ echo "The status is: $status"
+ sleep 15
+ done
+ status=$(curl -X GET -H "Authorization: Bearer $token" -d "" -H "APIRequestID: $guid" ${bamboo.uri}/ExecutionStatus/)
+ echo "The status is: $status"
+ execstatus=$(curl -X GET -H "Authorization: Bearer $token" -d "" -H "APIRequestID: $guid" ${bamboo.uri}/ExecutionStatus/ | awk -F':' '{print $3}' | tr -d \" | tr -d \})
+ echo "The exec status is: $execstatus"
+ if [[ $execstatus != *Passed* ]];
+ then
+ echo "Failed"
+ exit 1
+ else
+ echo "Passed"
+ exit
+ fi
+ exit */
+ }
+ }
+ }
+
+
+ }
}
From 55d7cf61129ee71e92b2e2e9c10158c51879d8bc Mon Sep 17 00:00:00 2001
From: sdgcpae <77853202+sdgcpae@users.noreply.github.com>
Date: Tue, 2 Feb 2021 14:05:43 -0600
Subject: [PATCH 161/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index ad3aa46..28290bc 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -156,4 +156,17 @@ stages {
}
+ /* post {
+ failure {
+ mail bcc: '',
+ body: "Example
\n
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
URL de build: ${env.BUILD_URL}",
+ cc: '',
+ charset: 'UTF-8',
+ from: '',
+ mimeType: 'text/html',
+ replyTo: '',
+ subject: "ERROR CI: Project name -> ${env.JOB_NAME}",
+ to: "foo@foomail.com";
+ }
+ } */
}
From 1a7cec704544dc6ddaf91f6cd5692e35fb779d7a Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Tue, 2 Feb 2021 15:24:55 -0500
Subject: [PATCH 162/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 28290bc..89f7f9a 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -109,11 +109,10 @@ stages {
}
}
}
- stage('Smoke Test') {
+ stage('Post Deploy Tests') {
parallel {
- stage('Security Test') {
+ stage('Smoke Test') {
steps {
- echo 'I am running Security Test here'
echo 'I am running Smoke Test here'
}
/*RESP=`curl -X GET "${bamboo.uri}/RequestsRunning" -H "accept: application/xml" -H "authorization: bearer lR0AA2qfq7v9Ry96vDAgqcer1GPVd5yStmv1_aJVFS43rk06EytB7WsS0_owoiXIgpOXmZVEfkY4ST0JwHtRBk7RH0QRaldWtQT8udC0VdimdGx38RddY2sGaeeF0t9Aflr5rh1Jc_EUfkNK8YrKVxQ6kxB05aCe46CD2fkognv7TiJATmht-ycUjEsd_oy8jH5EK9fmn9eL-wXavNTQcEdsUmFm3-2r3IJDzMK7XCa74qu353yOKLvVyZ1yYQBnc1_fY5GS1BDrFLUZprxpAS30lGEu-d_JTTOQ989UJtIEB3cZzDkIQzeqdYBGCsiDdjdHo2DC1FK2kVPyBITTbQ"`
@@ -151,10 +150,13 @@ stages {
fi
exit */
}
+ stage('Security Test') {
+ steps {
+ echo 'I am running Security Test here'
+ }
+ }
}
- }
-
-
+ }
}
/* post {
failure {
From efde1584bef0816173676a424408c4dcbcd3a85b Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Tue, 2 Feb 2021 15:54:27 -0500
Subject: [PATCH 163/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 89f7f9a..630c2e6 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -109,11 +109,11 @@ stages {
}
}
}
- stage('Post Deploy Tests') {
+ stage('Post Deploy Tests') {
parallel {
stage('Smoke Test') {
steps {
- echo 'I am running Smoke Test here'
+ echo "I am executing Smoke Test on target dev environment post deployment"
}
/*RESP=`curl -X GET "${bamboo.uri}/RequestsRunning" -H "accept: application/xml" -H "authorization: bearer lR0AA2qfq7v9Ry96vDAgqcer1GPVd5yStmv1_aJVFS43rk06EytB7WsS0_owoiXIgpOXmZVEfkY4ST0JwHtRBk7RH0QRaldWtQT8udC0VdimdGx38RddY2sGaeeF0t9Aflr5rh1Jc_EUfkNK8YrKVxQ6kxB05aCe46CD2fkognv7TiJATmht-ycUjEsd_oy8jH5EK9fmn9eL-wXavNTQcEdsUmFm3-2r3IJDzMK7XCa74qu353yOKLvVyZ1yYQBnc1_fY5GS1BDrFLUZprxpAS30lGEu-d_JTTOQ989UJtIEB3cZzDkIQzeqdYBGCsiDdjdHo2DC1FK2kVPyBITTbQ"`
echo "The response for current execution status is: $RESP"
@@ -158,9 +158,9 @@ stages {
}
}
}
- /* post {
+ post {
failure {
- mail bcc: '',
+ /*mail bcc: '',
body: "Example
\n
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
URL de build: ${env.BUILD_URL}",
cc: '',
charset: 'UTF-8',
@@ -168,7 +168,11 @@ stages {
mimeType: 'text/html',
replyTo: '',
subject: "ERROR CI: Project name -> ${env.JOB_NAME}",
- to: "foo@foomail.com";
+ to: "foo@foomail.com";*/
+ echo 'I am sending a notification with failure'
}
- } */
+ success {
+ echo 'I am sending a notification with success'
+ }
+ }
}
From 3ecacb1343590687c888a327b54e82265c257669 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 3 Feb 2021 17:27:10 +0530
Subject: [PATCH 164/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 630c2e6..95cdad6 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -34,7 +34,7 @@ stages {
}
}
}
- }
+}
stage('Code Quality') {
steps {
container('gradle') {
From 84426ceba88cbd11d06fa3c53bda38fd149e0673 Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 3 Feb 2021 17:27:32 +0530
Subject: [PATCH 165/166] Update Jenkinsfile_AIP
---
Jenkinsfile_AIP | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Jenkinsfile_AIP b/Jenkinsfile_AIP
index 95cdad6..13d061d 100644
--- a/Jenkinsfile_AIP
+++ b/Jenkinsfile_AIP
@@ -34,7 +34,7 @@ stages {
}
}
}
-}
+ }
stage('Code Quality') {
steps {
container('gradle') {
@@ -43,10 +43,10 @@ stages {
echo 'I am executing code quality using sonarqube'
sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
}
- /* sleep(60)
+ sleep(60)
timeout(time: 1, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
- } */
+ }
}
}
}
From 71942b7d59469740dca7a0e85721e4148689ff4a Mon Sep 17 00:00:00 2001
From: sdgcpsb <76002842+sdgcpsb@users.noreply.github.com>
Date: Wed, 3 Feb 2021 20:02:28 +0530
Subject: [PATCH 166/166] Update Jenkinsfile_AIP