From b97599ab2f2e2cc38d8ef821952ddfa7cda06fa3 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 26 Feb 2021 17:23:52 -0500 Subject: [PATCH 001/190] Initial commit to create jenkinsfile in the repo --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..fae0a4ad86 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,11 @@ +pipeline { + agent any + stages { + stage('Print Message') { + steps { + echo 'Squad5 First blue ocean pipeline' + } + } + + } +} \ No newline at end of file From cabe2d49642c0d7a0f38b6250688affa54fce56c Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Mon, 1 Mar 2021 14:54:19 -0500 Subject: [PATCH 002/190] adding build info --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index fae0a4ad86..d0575f4c52 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,7 @@ pipeline { stage('Print Message') { steps { echo 'Squad5 First blue ocean pipeline' + jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') } } From 7ca2696362c0cae384ca85d0ee3ff660a55418f3 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Mon, 1 Mar 2021 15:44:53 -0500 Subject: [PATCH 003/190] commit for Jira Integration Commit for JIRA integration --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d0575f4c52..df3133bfe2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,9 +4,14 @@ pipeline { stage('Print Message') { steps { echo 'Squad5 First blue ocean pipeline' + } + post { + always { jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') + } } + } } } -} \ No newline at end of file +} From 18ba82b5ccadc763bf1d37b0e473f996f47b765a Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Mon, 1 Mar 2021 15:46:05 -0500 Subject: [PATCH 004/190] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index df3133bfe2..237fd20f7b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') } } - } + } } } From e8bb07257fc66c1ac0ab7e01f5ea7b09482f3097 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Mon, 1 Mar 2021 15:46:45 -0500 Subject: [PATCH 005/190] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 237fd20f7b..9f4fabe140 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') } } - } + } } From 987f92c88a7a82761725351fb309c89f4f63d5db Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Tue, 2 Mar 2021 01:06:14 -0500 Subject: [PATCH 006/190] SQUAD5-1 Test --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9f4fabe140..b29eb5c14c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages { stage('Print Message') { steps { - echo 'Squad5 First blue ocean pipeline' + echo 'Squad5 First blue ocean pipeline 1' } post { always { From 08a4c0bb254e194e59e9f57e2b315971f324292c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 01:14:30 -0500 Subject: [PATCH 007/190] Added the sonar qube analysis stage --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fae0a4ad86..99b5ae0961 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,10 @@ pipeline { agent any stages { - stage('Print Message') { - steps { - echo 'Squad5 First blue ocean pipeline' - } + stage('Sonar Qube Analysis') { + withSonarQubeEnv(credentialsId: 'a802ff2c895911f06c87a736ee911f1a46d27fb6', installationName: 'sonarqube-scanner') { // You can override the credential to be used + sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:4.6.0.2311:sonar' + } } } From a9bcc45474928c263a0ce17b56aed90b7ee8382c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 01:35:32 -0500 Subject: [PATCH 008/190] Added the sonarqube analysis --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 201237b141..947066ee44 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,9 +2,13 @@ pipeline { agent any stages { stage('Sonar Qube Analysis') { - withSonarQubeEnv(credentialsId: 'a802ff2c895911f06c87a736ee911f1a46d27fb6', installationName: 'sonarqube-scanner') { // You can override the credential to be used - sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:4.6.0.2311:sonar' - } + steps { + withSonarQubeEnv(credentialsId: 'a802ff2c895911f06c87a736ee911f1a46d27fb6', installationName: 'sonarqube-scanner') { + // You can override the credential to be used + sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:4.6.0.2311:sonar' + } + } + post { always { jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') From bf329217c2a9de2a42441859f9dd31006fa8337f Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 01:37:09 -0500 Subject: [PATCH 009/190] Updated the installationName of sonarqube --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 947066ee44..f2d37e00e4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages { stage('Sonar Qube Analysis') { steps { - withSonarQubeEnv(credentialsId: 'a802ff2c895911f06c87a736ee911f1a46d27fb6', installationName: 'sonarqube-scanner') { + withSonarQubeEnv(credentialsId: 'a802ff2c895911f06c87a736ee911f1a46d27fb6', installationName: 'sonarqube-server') { // You can override the credential to be used sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:4.6.0.2311:sonar' } From a3a21beda65d84c540d88f566b86cee4b78984cd Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 01:38:59 -0500 Subject: [PATCH 010/190] Updated the installationName of sonarqube --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f2d37e00e4..3839d1a076 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,17 +3,17 @@ pipeline { stages { stage('Sonar Qube Analysis') { steps { - withSonarQubeEnv(credentialsId: 'a802ff2c895911f06c87a736ee911f1a46d27fb6', installationName: 'sonarqube-server') { + withSonarQubeEnv(installationName: 'sonarqube-server') { // You can override the credential to be used sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:4.6.0.2311:sonar' } } - post { - always { - jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') - } - } + // post { + // always { + // jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') + // } + // } } } From 591973a21f2985c5abcba56925b9aa92d0abeaca Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 01:40:54 -0500 Subject: [PATCH 011/190] Updated the installationName of sonarqube --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3839d1a076..504ac181e3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,8 @@ pipeline { steps { withSonarQubeEnv(installationName: 'sonarqube-server') { // You can override the credential to be used - sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:4.6.0.2311:sonar' + // sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:4.6.0.2311:sonar' + println ${env.SONAR_HOST_URL} } } From 612e34368647d25060d7de02f944da2da0e925de Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 01:41:50 -0500 Subject: [PATCH 012/190] Updated the installationName of sonarqube --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 504ac181e3..6eb95c8d63 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { withSonarQubeEnv(installationName: 'sonarqube-server') { // You can override the credential to be used // sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:4.6.0.2311:sonar' - println ${env.SONAR_HOST_URL} + println env.SONAR_HOST_URL } } From e77e476a8c56e177b9a3e151f960c8433702cb09 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 01:44:25 -0500 Subject: [PATCH 013/190] Updated the installationName of sonarqube --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6eb95c8d63..2c0d71df6f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,8 +5,10 @@ pipeline { steps { withSonarQubeEnv(installationName: 'sonarqube-server') { // You can override the credential to be used - // sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:4.6.0.2311:sonar' - println env.SONAR_HOST_URL + sh ''' + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=sonar -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + ''' + // println env.SONAR_HOST_URL } } From b217f93c34bedf655cccef0c36e806e3c2d967e4 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 01:52:51 -0500 Subject: [PATCH 014/190] Updated the installationName of sonarqube --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2c0d71df6f..8c11b64023 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { withSonarQubeEnv(installationName: 'sonarqube-server') { // You can override the credential to be used sh ''' - mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=sonar -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven3.6.3/bin/mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=sonar -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} ''' // println env.SONAR_HOST_URL } From 567444da368b66344ad6e657308b7c93f0acffb2 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 02:05:47 -0500 Subject: [PATCH 015/190] Updated the installationName of sonarqube --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8c11b64023..ffd95aaf9c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,12 +1,18 @@ pipeline { agent any + tools { + maven 'Maven 3.6.3' + jdk 'jdk8' + } stages { stage('Sonar Qube Analysis') { steps { withSonarQubeEnv(installationName: 'sonarqube-server') { // You can override the credential to be used sh ''' - /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven3.6.3/bin/mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=sonar -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + echo "PATH = ${PATH}" + echo "M2_HOME = ${M2_HOME}" + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=sonar -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} ''' // println env.SONAR_HOST_URL } From d32c254f0495d6dead1c00c57f81adeb37dbe038 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 02:07:04 -0500 Subject: [PATCH 016/190] Updated the installationName of sonarqube --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ffd95aaf9c..4249e85a36 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,8 @@ pipeline { agent any tools { - maven 'Maven 3.6.3' - jdk 'jdk8' + maven 'Maven3.6.3' + jdk 'JDK' } stages { stage('Sonar Qube Analysis') { From 2d4f086cd001033826b8b6d205df6a23da80ff9f Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 02:20:05 -0500 Subject: [PATCH 017/190] Print Message revert --- Jenkinsfile | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4249e85a36..67c6f72ab3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,25 +5,16 @@ pipeline { jdk 'JDK' } stages { - stage('Sonar Qube Analysis') { + stage('Print Message') { steps { - withSonarQubeEnv(installationName: 'sonarqube-server') { - // You can override the credential to be used - sh ''' - echo "PATH = ${PATH}" - echo "M2_HOME = ${M2_HOME}" - mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=sonar -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - ''' - // println env.SONAR_HOST_URL - } + echo "Squad5 First blue ocean pipeline" } + } - // post { - // always { - // jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') - // } - // } + post { + always { + jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') + } } - } } From a33e65fb470c3c2b8c633558e23e6bc3e09d1c2b Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 02:20:40 -0500 Subject: [PATCH 018/190] Print Message revert --- Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 67c6f72ab3..1fa1cf6862 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,5 @@ pipeline { agent any - tools { - maven 'Maven3.6.3' - jdk 'JDK' - } stages { stage('Print Message') { steps { From f5fd9879824c6babd0869db9c2996227772f3452 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 02:32:52 -0500 Subject: [PATCH 019/190] Added the sonarqube stage in the dev-master branch --- Jenkinsfile | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1fa1cf6862..99b0eb38f8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,16 +1,30 @@ pipeline { agent any - stages { - stage('Print Message') { + tools { + maven 'Maven3.6.3' + jdk 'JDK' + } + stages{ + stage('Sonar Qube Analysis') { steps { - echo "Squad5 First blue ocean pipeline" + withSonarQubeEnv(installationName: 'sonarqube-server') { + sh ''' + echo "PATH = ${PATH}" + echo "M2_HOME = ${M2_HOME}" + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + ''' + } } } + } + - post { - always { - jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') - } - } + // post { + // always { + // jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') + // } + // } + environment { + SONAR_AUTH=credentials('sonar-login') } } From bb8bf4673ee7f21d09b4b866cf691222426b34ce Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 03:06:10 -0500 Subject: [PATCH 020/190] Added the mvn compile step --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 99b0eb38f8..4b065de4b2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,6 +16,15 @@ pipeline { } } } + stage('Build the project') { + steps { + script { + sh ''' + mvn compile + ''' + } + } + } } From 67a5a6b1c8b7f5c994785e980ee920f334f2a788 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 03:11:21 -0500 Subject: [PATCH 021/190] Added the mvn compile step --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4b065de4b2..3425945f17 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { steps { script { sh ''' - mvn compile + mvn -B -f pom.xml compile ''' } } From 90bb84c7e4041c3f1d1f9901bd2151283ec31334 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 2 Mar 2021 03:24:50 -0500 Subject: [PATCH 022/190] Added the mvn compile step --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 3425945f17..354d4c75fc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,6 +25,16 @@ pipeline { } } } + stage('UI Test') { + steps { + script { + sh ''' + mvn -B -f functionaltest/pom.xml test + ''' + } + } + } + } From 225770644a6529ae64341170046425006cc06f52 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Tue, 2 Mar 2021 14:44:10 -0500 Subject: [PATCH 023/190] SQUAD5-3 SQUAD5-3 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1fa1cf6862..995bad9db7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages { stage('Print Message') { steps { - echo "Squad5 First blue ocean pipeline" + echo "Squad5 First blue ocean pipeline 1" } } From 27ab5c926b73d39365ee0ca6ff6124450da28914 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Tue, 2 Mar 2021 14:47:37 -0500 Subject: [PATCH 024/190] LOGIN-5 SQUAD5-3 LOGIN-5 SQUAD5-3 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 995bad9db7..e4d4ff80ca 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages { stage('Print Message') { steps { - echo "Squad5 First blue ocean pipeline 1" + echo "Squad5 First blue ocean pipeline 2" } } From e69a9680cf316aeebd40ad496821cd94b5daf98f Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Tue, 2 Mar 2021 15:05:15 -0500 Subject: [PATCH 025/190] LOGIN-5 LOGIN-5 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e4d4ff80ca..c7132221cb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages { stage('Print Message') { steps { - echo "Squad5 First blue ocean pipeline 2" + echo "Squad5 First blue ocean pipeline 3" } } From 6e85f76216e51b3ef0e8e0ea15fe1ef66941f763 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Tue, 2 Mar 2021 16:57:42 -0500 Subject: [PATCH 026/190] Docker file added docker file added --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..8c76b45b0b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM openjdk:8-jre-alpine +EXPOSE 8080 +ADD target/*.jar app.jar +ENTRYPOINT [ "sh", "-c", "java -jar /app.jar" ] From f7cbf5d7d44a2457dc06f9a4f5e92b6859186f5c Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Tue, 2 Mar 2021 17:03:38 -0500 Subject: [PATCH 027/190] Added Jenkinsfile --- Jenkinsfile | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 354d4c75fc..57ee8cf54f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,49 +1,48 @@ pipeline { agent any - tools { - maven 'Maven3.6.3' - jdk 'JDK' - } - stages{ + stages { stage('Sonar Qube Analysis') { steps { - withSonarQubeEnv(installationName: 'sonarqube-server') { + withSonarQubeEnv('sonarqube-server') { sh ''' echo "PATH = ${PATH}" echo "M2_HOME = ${M2_HOME}" mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} ''' } + } } + stage('Build the project') { steps { - script { + script { sh ''' - mvn -B -f pom.xml compile - ''' +mvn -B -f pom.xml compile +''' } + } } - stage('UI Test') { + + stage('Deploy To Test') { steps { - script { + script { sh ''' - mvn -B -f functionaltest/pom.xml test - ''' +mvn -B -f pom.xml package +''' } + + sh 'docker build -t devops-docker-squad5-1 .' } } } - - - // post { - // always { - // jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') - // } - // } + tools { + maven 'Maven3.6.3' + jdk 'JDK' + } environment { - SONAR_AUTH=credentials('sonar-login') + SONAR_AUTH = credentials('sonar-login') } -} +} \ No newline at end of file From cc78aeb0baeac4f62a1376cf835233a8f253bc1e Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Tue, 2 Mar 2021 18:57:19 -0500 Subject: [PATCH 028/190] test server ip changes --- .../src/test/java/acceptancetest/acat.java | 4 ++-- Jenkinsfile | 14 ++++++++++++++ .../src/test/java/functionaltest/ftat.java | 4 ++-- src/test/java/servlet/cancelpage.java | 2 +- src/test/java/servlet/createpage.java | 2 +- src/test/java/servlet/viewticket.java | 2 +- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Acceptancetest/src/test/java/acceptancetest/acat.java b/Acceptancetest/src/test/java/acceptancetest/acat.java index b66f0fe334..213aa1e459 100644 --- a/Acceptancetest/src/test/java/acceptancetest/acat.java +++ b/Acceptancetest/src/test/java/acceptancetest/acat.java @@ -12,8 +12,8 @@ public class acat { public HtmlUnitDriver driver; //public WebDriver driver; public WebDriverWait wait; - public String URL = "http://172.31.45.127:8080/ProdWebapp"; - public String URL1 = "http://172.31.45.127:8080/ProdWebapp/avncreatepage.jsp"; + public String URL = "http://squadprodserver:8080/ProdWebapp"; + public String URL1 = "http://squadprodserver:8080/ProdWebapp/avncreatepage.jsp"; //public String URL = "http://localhost:8080/AVNCommunication-1.0/avnlogin.jsp"; //public String URL1 = "http://localhost:8080/AVNCommunication-1.0/avncreatepage.jsp"; diff --git a/Jenkinsfile b/Jenkinsfile index 57ee8cf54f..cef7bd2834 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,6 +25,20 @@ mvn -B -f pom.xml compile } } + stage('Configure Test Server') { + steps { + script { + sh ''' + gcloud auth activate-service-account --key-file=gcloud_auth + gcloud config set compute/zone us-central1-a + test-server=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` + sed -i 's/squadtestserver/$test-server/g' $(find . -type f) + ''' + } + + } + } + stage('Deploy To Test') { steps { script { diff --git a/functionaltest/src/test/java/functionaltest/ftat.java b/functionaltest/src/test/java/functionaltest/ftat.java index 33478958cd..4f04cbafd2 100644 --- a/functionaltest/src/test/java/functionaltest/ftat.java +++ b/functionaltest/src/test/java/functionaltest/ftat.java @@ -16,8 +16,8 @@ public class ftat { public HtmlUnitDriver driver; //public WebDriver driver; public WebDriverWait wait; - public String URL = "http://172.31.46.182:8080/QAWebapp/"; - public String URL1 = "http://172.31.46.182:8080/QAWebapp/avncreatepage.jsp"; + public String URL = "http://squadtestserver:8080/QAWebapp/"; + public String URL1 = "http://squadtestserver:8080/QAWebapp/avncreatepage.jsp"; //public String URL = "http://localhost:8080/AVNCommunication-1.0/avnlogin.jsp"; //public String URL1 = "http://localhost:8080/AVNCommunication-1.0/avncreatepage.jsp"; diff --git a/src/test/java/servlet/cancelpage.java b/src/test/java/servlet/cancelpage.java index f38f8bce12..c3c2ec875a 100644 --- a/src/test/java/servlet/cancelpage.java +++ b/src/test/java/servlet/cancelpage.java @@ -17,7 +17,7 @@ public void doPost(HttpServletRequest req,HttpServletResponse res) try { Class.forName("org.postgresql.Driver"); - String jdbcUrl="jdbc:postgresql://172.31.46.182:5432/postgres"; + String jdbcUrl="jdbc:postgresql://squadtestserver:5432/postgres"; String username="postgres"; String password="password"; diff --git a/src/test/java/servlet/createpage.java b/src/test/java/servlet/createpage.java index 7269a16311..e1625a0043 100644 --- a/src/test/java/servlet/createpage.java +++ b/src/test/java/servlet/createpage.java @@ -17,7 +17,7 @@ public void doPost(HttpServletRequest req,HttpServletResponse res) try { Class.forName("org.postgresql.Driver"); - String jdbcUrl="jdbc:postgresql://172.31.46.182:5432/postgres"; + String jdbcUrl="jdbc:postgresql://squadtestserver:5432/postgres"; String username="postgres"; String password="password"; diff --git a/src/test/java/servlet/viewticket.java b/src/test/java/servlet/viewticket.java index 0ad7e27bb8..7709a6bdca 100644 --- a/src/test/java/servlet/viewticket.java +++ b/src/test/java/servlet/viewticket.java @@ -16,7 +16,7 @@ public void service(HttpServletRequest req,HttpServletResponse res) try { Class.forName("org.postgresql.Driver"); - String jdbcUrl="jdbc:postgresql://172.31.46.182:5432/postgres"; + String jdbcUrl="jdbc:postgresql://squadtestserver:5432/postgres"; String username="postgres"; String password="password"; From fefc66dc356fc169e883c32672de15c56f7fca05 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Tue, 2 Mar 2021 19:26:38 -0500 Subject: [PATCH 029/190] update test server ip update test server ip --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cef7bd2834..8affb906a4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,8 +31,8 @@ mvn -B -f pom.xml compile sh ''' gcloud auth activate-service-account --key-file=gcloud_auth gcloud config set compute/zone us-central1-a - test-server=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` - sed -i 's/squadtestserver/$test-server/g' $(find . -type f) + testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` + sed -i "s/squadtestserver/$testserver/g" $(find . -type f) ''' } @@ -59,4 +59,4 @@ mvn -B -f pom.xml package environment { SONAR_AUTH = credentials('sonar-login') } -} \ No newline at end of file +} From c800f7cfdc49223c5a1fd534e387ad7ee9b83618 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Tue, 2 Mar 2021 19:35:05 -0500 Subject: [PATCH 030/190] Updated the gcloud auth file path Updated the gcloud auth file path --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8affb906a4..e5c93cac8b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ mvn -B -f pom.xml compile steps { script { sh ''' - gcloud auth activate-service-account --key-file=gcloud_auth + gcloud auth activate-service-account --key-file=/var/lib/jenkins/workspace/gcloud_auth gcloud config set compute/zone us-central1-a testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` sed -i "s/squadtestserver/$testserver/g" $(find . -type f) From b9947e7b85e8a84a5310a3f3fbe54d3946cfa15e Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Wed, 3 Mar 2021 17:16:43 -0500 Subject: [PATCH 031/190] Updated the dockerfile --- Jenkinsfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e5c93cac8b..8441b0d60d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,7 @@ pipeline { echo "PATH = ${PATH}" echo "M2_HOME = ${M2_HOME}" mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - ''' + ''' } } @@ -18,8 +18,8 @@ pipeline { steps { script { sh ''' -mvn -B -f pom.xml compile -''' + mvn -B -f pom.xml compile + ''' } } @@ -33,21 +33,21 @@ mvn -B -f pom.xml compile gcloud config set compute/zone us-central1-a testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` sed -i "s/squadtestserver/$testserver/g" $(find . -type f) - ''' + ''' } } } - stage('Deploy To Test') { + stage('Run the Unit Testing ') { steps { script { sh ''' -mvn -B -f pom.xml package -''' + mvn -B -f pom.xml package + ''' } - sh 'docker build -t devops-docker-squad5-1 .' + // sh 'docker build -t devops-docker-squad5-1 .' } } From 9cbe211a64c4182a9fa2f1630e20b3d2c8aca377 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Wed, 3 Mar 2021 17:24:20 -0500 Subject: [PATCH 032/190] Updated the dockerfile --- Jenkinsfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8441b0d60d..2adeafdd0c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,17 +39,17 @@ pipeline { } } - stage('Run the Unit Testing ') { - steps { - script { - sh ''' - mvn -B -f pom.xml package - ''' - } - - // sh 'docker build -t devops-docker-squad5-1 .' - } - } + // stage('Run the Unit Testing ') { + // steps { + // script { + // sh ''' + // mvn -B -f pom.xml package + // ''' + // } + + // // sh 'docker build -t devops-docker-squad5-1 .' + // } + // } } tools { From c087015f7ce1561642b5b588c67523cee23d91b6 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Wed, 3 Mar 2021 18:29:35 -0500 Subject: [PATCH 033/190] DP-2 #comment This is first commit DP-2 #comment This is first commit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8e684e418d..40870fb94e 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,5 @@ This is a sample project used for learning the devops end to end concepts my intial commit 01/26 testing polling SCM + +testing Poll JIRA From 800912e7e854d17f0cb7eceb606d832dab6c635b Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Wed, 3 Mar 2021 18:34:35 -0500 Subject: [PATCH 034/190] #comment DP-2 test #comment DP-2 test --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40870fb94e..0d869ea290 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,4 @@ my intial commit 01/26 testing polling SCM -testing Poll JIRA +testing Poll JIR From a8ddf1a2c3198ad452205698767720e5bcacff8f Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 15:04:10 -0500 Subject: [PATCH 035/190] DP-2 trigger JIRA DP-2 trigger JIRA --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d869ea290..40870fb94e 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,4 @@ my intial commit 01/26 testing polling SCM -testing Poll JIR +testing Poll JIRA From 1d08fed937cd70192b30afe84eb91eb18a179da1 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 15:05:45 -0500 Subject: [PATCH 036/190] DP-2 testing JIRA DP-2 testing JIRA --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8e684e418d..5fcadf0a8d 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,5 @@ This is a sample project used for learning the devops end to end concepts my intial commit 01/26 testing polling SCM + +testing JIRA polling From 0ab6e664b467d6dfe5bd1c0da23146f5b8bc9df2 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 17:06:47 -0500 Subject: [PATCH 037/190] Add files via upload Creation of test server tomcat,postgresql --- TestServerCreation.yml | 20 +++++++++++++ postgresql.sh | 67 ++++++++++++++++++++++++++++++++++++++++++ tomcat.sh | 26 ++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 TestServerCreation.yml create mode 100644 postgresql.sh create mode 100644 tomcat.sh diff --git a/TestServerCreation.yml b/TestServerCreation.yml new file mode 100644 index 0000000000..1b8581a433 --- /dev/null +++ b/TestServerCreation.yml @@ -0,0 +1,20 @@ +--- #sonar qube creation +- hosts: "{{ myhostserver }}" + become: yes + tasks: + - name: "Transfer the Tomcat installation script" + copy: + src: tomcat.sh + dest: /root/tomcat.sh + tags: tomcatInstall + - name: "Transfer the postgresql installation script" + copy: + src: postgresql.sh + dest: /root/postgresql.sh + - name: "Install Tomcat" + shell: bash tomcat.sh > tomcatinstallLog.txt + tags: tomcatInstall + - name: "Install Postgresql" + shell: bash postgresql.sh > postgresqlinstallLog.txt + tags: postgresqlInstall + diff --git a/postgresql.sh b/postgresql.sh new file mode 100644 index 0000000000..7e953ba88b --- /dev/null +++ b/postgresql.sh @@ -0,0 +1,67 @@ +#!/bin/bash -ex + +# This script is for use with the DevOps Challenge of installing PostgreSQL 9.6 on to a instance running Ubuntu. + +# Section 1 - Variable Creation + +# $rfolder is the install directory for PostgreSQL +rfolder='/postgres' +# $dfolder is the root directory for various types of read-only data files +dfolder='/postgres/data' +# $sysuser is the system user for running PostgreSQL +sysuser='postgres' +# $scripts directory +scripts="/home/$USER/scripts" +# $sqlscript is the sql script for creating the PSQL user and creating a database. +sqlscript="$scripts/initial-table.sql" +# $logfile is the log file for this installation. +logfile='psqlinstall-log' + +# Section 2 - Package Installation + +# Ensures the server is up to date before proceeding. +echo "Updating server..." +sudo apt-get update -y >> $logfile + +# This for-loop will pull all packages from the package array and install them using apt-get +echo "Installing PostgreSQL dependencies" +sudo apt-get install ${packages[@]} -y >> $logfile + + +# Section 3 - Create required directories +echo "Creating folders $dfolder..." +sudo mkdir -p $dfolder >> $logfile +sudo mkdir -p $scripts >> $logfile + +# Section 4 - Create system user + +#echo "Creating system user '$sysuser'" +#sudo adduser --system $sysuser >> $logfile + +# Section 5 - Installing PSQL + +echo "installing PostgreSQL" +sudo apt-get install -y postgresql postgresql-contrib +echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/10/main/pg_hba.conf +sed -i 's+localhost+*+gI' /etc/postgresql/10/main/postgresql.conf +sed -i 's+#listen_addresses+listen_addresses+gI' /etc/postgresql/10/main/postgresql.conf +#listen_addresses = 'localhost' +# Section 7 - Start PSQL + +echo "Wait for PostgreSQL to finish starting up..." +sleep 5 + + +# Section 8 - initial-table.sql script is ran + +# The initial-table.sql script is downloaded and ran to create the user, database, and populate the database. +echo "Downloading SQL script" +wget -P $scripts https://raw.githubusercontent.com/devopsbc01/Scripts/master/initial-table.sql + +echo "Running script" +#$rfolder/bin/psql -U postgres -f $sqlscript + +sudo -u postgres psql -f $sqlscript + +echo "Restarting postgres DB" +sudo /etc/init.d/postgresql restart \ No newline at end of file diff --git a/tomcat.sh b/tomcat.sh new file mode 100644 index 0000000000..2f97102f4e --- /dev/null +++ b/tomcat.sh @@ -0,0 +1,26 @@ +#bash to install tomcat + +#---------------------- +echo "Updating server..." +sudo apt-get -y update +sudo apt-get -y upgrade +echo "Updating Java..." +sudo apt-get install -y default-jdk +echo "Installing tomcat8..." +sudo apt-get install -y tomcat8 +sudo apt-get install -y tomcat8-docs tomcat8-examples tomcat8-admin +#bash to admin-user in tomcat +#---------------------------- +sed -i 's++ +gI' /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo "" >> /var/lib/tomcat8/conf/tomcat-users.xml +#bash to restart tomcat +#---------------------- +echo "Restart tomcat8..." +sudo service tomcat8 restart +sleep 5 \ No newline at end of file From b514cfe7fdbb0a06f856149130c7d7c1ed85572a Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 4 Mar 2021 17:09:13 -0500 Subject: [PATCH 038/190] Updated for the dockerfile --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8c76b45b0b..95023ad459 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM openjdk:8-jre-alpine -EXPOSE 8080 -ADD target/*.jar app.jar -ENTRYPOINT [ "sh", "-c", "java -jar /app.jar" ] +# FROM openjdk:8-jre-alpine +# EXPOSE 8080 +# ADD target/*.jar app.jar +# ENTRYPOINT [ "sh", "-c", "java -jar /app.jar" ] +FROM docker.io/devopsbcsquad5/squad5tomcat +COPY target/AVNCommunication-1.0.war /usr/local/tomcat/webapps/AVNCommunication-1.0.war +RUN service tomcat8 start From 47fd064d5a7d85cc9b21fc41156625fd1bd9ee10 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 4 Mar 2021 17:12:34 -0500 Subject: [PATCH 039/190] Added the playbook for configuring testserver --- Dockerfile | 2 +- Jenkinsfile | 1 + TestServerCreation.yml | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 95023ad459..49d5738846 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,6 @@ # EXPOSE 8080 # ADD target/*.jar app.jar # ENTRYPOINT [ "sh", "-c", "java -jar /app.jar" ] -FROM docker.io/devopsbcsquad5/squad5tomcat +FROM squad5 COPY target/AVNCommunication-1.0.war /usr/local/tomcat/webapps/AVNCommunication-1.0.war RUN service tomcat8 start diff --git a/Jenkinsfile b/Jenkinsfile index 2adeafdd0c..fe6015ca2c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,6 +33,7 @@ pipeline { gcloud config set compute/zone us-central1-a testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` sed -i "s/squadtestserver/$testserver/g" $(find . -type f) + ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml ''' } diff --git a/TestServerCreation.yml b/TestServerCreation.yml index 1b8581a433..a38fb693c3 100644 --- a/TestServerCreation.yml +++ b/TestServerCreation.yml @@ -2,11 +2,11 @@ - hosts: "{{ myhostserver }}" become: yes tasks: - - name: "Transfer the Tomcat installation script" - copy: + - name: "Transfer the Tomcat installation script" + copy: src: tomcat.sh dest: /root/tomcat.sh - tags: tomcatInstall + tags: tomcatInstall - name: "Transfer the postgresql installation script" copy: src: postgresql.sh From 791a910c61a3b70273dbc8f3eea9a5d3347eb93c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 4 Mar 2021 17:29:17 -0500 Subject: [PATCH 040/190] sudo command inclusion --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fe6015ca2c..79bdec99e3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,7 +33,7 @@ pipeline { gcloud config set compute/zone us-central1-a testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` sed -i "s/squadtestserver/$testserver/g" $(find . -type f) - ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml + sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml ''' } From c3b05580c3a4ad100a9a9d48aaf57e8ad7629543 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 4 Mar 2021 17:36:50 -0500 Subject: [PATCH 041/190] sudo command inclusion --- Jenkinsfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 79bdec99e3..819663cee8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,18 +1,18 @@ pipeline { agent any stages { - stage('Sonar Qube Analysis') { - steps { - withSonarQubeEnv('sonarqube-server') { - sh ''' - echo "PATH = ${PATH}" - echo "M2_HOME = ${M2_HOME}" - mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - ''' - } + // stage('Sonar Qube Analysis') { + // steps { + // withSonarQubeEnv('sonarqube-server') { + // sh ''' + // echo "PATH = ${PATH}" + // echo "M2_HOME = ${M2_HOME}" + // mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + // ''' + // } - } - } + // } + // } stage('Build the project') { steps { From f26fc994950fc25bbd3f8fb8735db2319456326a Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 4 Mar 2021 18:16:10 -0500 Subject: [PATCH 042/190] sudo command inclusion --- TestServerCreation.yml | 3 +- postgresql.sh | 132 ++++++++++++++++++++--------------------- tomcat.sh | 50 ++++++++-------- 3 files changed, 92 insertions(+), 93 deletions(-) diff --git a/TestServerCreation.yml b/TestServerCreation.yml index a38fb693c3..ee01b5d12c 100644 --- a/TestServerCreation.yml +++ b/TestServerCreation.yml @@ -16,5 +16,4 @@ tags: tomcatInstall - name: "Install Postgresql" shell: bash postgresql.sh > postgresqlinstallLog.txt - tags: postgresqlInstall - + tags: postgresqlInstall \ No newline at end of file diff --git a/postgresql.sh b/postgresql.sh index 7e953ba88b..bc2079213d 100644 --- a/postgresql.sh +++ b/postgresql.sh @@ -1,67 +1,67 @@ -#!/bin/bash -ex - -# This script is for use with the DevOps Challenge of installing PostgreSQL 9.6 on to a instance running Ubuntu. - -# Section 1 - Variable Creation - -# $rfolder is the install directory for PostgreSQL -rfolder='/postgres' -# $dfolder is the root directory for various types of read-only data files -dfolder='/postgres/data' -# $sysuser is the system user for running PostgreSQL -sysuser='postgres' -# $scripts directory -scripts="/home/$USER/scripts" -# $sqlscript is the sql script for creating the PSQL user and creating a database. -sqlscript="$scripts/initial-table.sql" -# $logfile is the log file for this installation. -logfile='psqlinstall-log' - -# Section 2 - Package Installation - -# Ensures the server is up to date before proceeding. -echo "Updating server..." -sudo apt-get update -y >> $logfile - -# This for-loop will pull all packages from the package array and install them using apt-get -echo "Installing PostgreSQL dependencies" -sudo apt-get install ${packages[@]} -y >> $logfile - - -# Section 3 - Create required directories -echo "Creating folders $dfolder..." -sudo mkdir -p $dfolder >> $logfile -sudo mkdir -p $scripts >> $logfile - -# Section 4 - Create system user - -#echo "Creating system user '$sysuser'" -#sudo adduser --system $sysuser >> $logfile - -# Section 5 - Installing PSQL - -echo "installing PostgreSQL" -sudo apt-get install -y postgresql postgresql-contrib -echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/10/main/pg_hba.conf -sed -i 's+localhost+*+gI' /etc/postgresql/10/main/postgresql.conf -sed -i 's+#listen_addresses+listen_addresses+gI' /etc/postgresql/10/main/postgresql.conf -#listen_addresses = 'localhost' -# Section 7 - Start PSQL - -echo "Wait for PostgreSQL to finish starting up..." -sleep 5 - - -# Section 8 - initial-table.sql script is ran - -# The initial-table.sql script is downloaded and ran to create the user, database, and populate the database. -echo "Downloading SQL script" -wget -P $scripts https://raw.githubusercontent.com/devopsbc01/Scripts/master/initial-table.sql - -echo "Running script" -#$rfolder/bin/psql -U postgres -f $sqlscript - -sudo -u postgres psql -f $sqlscript - -echo "Restarting postgres DB" +#!/bin/bash -ex + +# This script is for use with the DevOps Challenge of installing PostgreSQL 9.6 on to a instance running Ubuntu. + +# Section 1 - Variable Creation + +# $rfolder is the install directory for PostgreSQL +rfolder='/postgres' +# $dfolder is the root directory for various types of read-only data files +dfolder='/postgres/data' +# $sysuser is the system user for running PostgreSQL +sysuser='postgres' +# $scripts directory +scripts="/home/$USER/scripts" +# $sqlscript is the sql script for creating the PSQL user and creating a database. +sqlscript="$scripts/initial-table.sql" +# $logfile is the log file for this installation. +logfile='psqlinstall-log' + +# Section 2 - Package Installation + +# Ensures the server is up to date before proceeding. +echo "Updating server..." +sudo apt-get update -y >> $logfile + +# This for-loop will pull all packages from the package array and install them using apt-get +echo "Installing PostgreSQL dependencies" +sudo apt-get install ${packages[@]} -y >> $logfile + + +# Section 3 - Create required directories +echo "Creating folders $dfolder..." +sudo mkdir -p $dfolder >> $logfile +sudo mkdir -p $scripts >> $logfile + +# Section 4 - Create system user + +#echo "Creating system user '$sysuser'" +#sudo adduser --system $sysuser >> $logfile + +# Section 5 - Installing PSQL + +echo "installing PostgreSQL" +sudo apt-get install -y postgresql postgresql-contrib +echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/10/main/pg_hba.conf +sed -i 's+localhost+*+gI' /etc/postgresql/10/main/postgresql.conf +sed -i 's+#listen_addresses+listen_addresses+gI' /etc/postgresql/10/main/postgresql.conf +#listen_addresses = 'localhost' +# Section 7 - Start PSQL + +echo "Wait for PostgreSQL to finish starting up..." +sleep 5 + + +# Section 8 - initial-table.sql script is ran + +# The initial-table.sql script is downloaded and ran to create the user, database, and populate the database. +echo "Downloading SQL script" +wget -P $scripts https://raw.githubusercontent.com/devopsbc01/Scripts/master/initial-table.sql + +echo "Running script" +#$rfolder/bin/psql -U postgres -f $sqlscript + +sudo -u postgres psql -f $sqlscript + +echo "Restarting postgres DB" sudo /etc/init.d/postgresql restart \ No newline at end of file diff --git a/tomcat.sh b/tomcat.sh index 2f97102f4e..608a37f7d3 100644 --- a/tomcat.sh +++ b/tomcat.sh @@ -1,26 +1,26 @@ -#bash to install tomcat - -#---------------------- -echo "Updating server..." -sudo apt-get -y update -sudo apt-get -y upgrade -echo "Updating Java..." -sudo apt-get install -y default-jdk -echo "Installing tomcat8..." -sudo apt-get install -y tomcat8 -sudo apt-get install -y tomcat8-docs tomcat8-examples tomcat8-admin -#bash to admin-user in tomcat -#---------------------------- -sed -i 's++ +gI' /var/lib/tomcat8/conf/tomcat-users.xml -echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml -echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml -echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml -echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml -echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml -echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml -echo "" >> /var/lib/tomcat8/conf/tomcat-users.xml -#bash to restart tomcat -#---------------------- -echo "Restart tomcat8..." -sudo service tomcat8 restart +#bash to install tomcat + +#---------------------- +echo "Updating server..." +sudo apt-get -y update +sudo apt-get -y upgrade +echo "Updating Java..." +sudo apt-get install -y default-jdk +echo "Installing tomcat8..." +sudo apt-get install -y tomcat8 +sudo apt-get install -y tomcat8-docs tomcat8-examples tomcat8-admin +#bash to admin-user in tomcat +#---------------------------- +sed -i 's++ +gI' /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo ' ' >> /var/lib/tomcat8/conf/tomcat-users.xml +echo "" >> /var/lib/tomcat8/conf/tomcat-users.xml +#bash to restart tomcat +#---------------------- +echo "Restart tomcat8..." +sudo service tomcat8 restart sleep 5 \ No newline at end of file From 9052e52476b061552c31ea818edfefbdb0524ef2 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 4 Mar 2021 18:17:26 -0500 Subject: [PATCH 043/190] sudo command inclusion --- Jenkinsfile | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 819663cee8..8a9c56e4ea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,17 +40,21 @@ pipeline { } } - // stage('Run the Unit Testing ') { - // steps { - // script { - // sh ''' - // mvn -B -f pom.xml package - // ''' - // } + stage('Deploy War on Test server') { + steps { + script { + sh ''' + sudo ssh root@test-server -o StrictHostKeyChecking=no" + mvn -B -f pom.xml package + scp target/*.war /var/lib/tomcat8/webapps/ + systemctl restart tomcat8 + " + ''' + } - // // sh 'docker build -t devops-docker-squad5-1 .' - // } - // } + // sh 'docker build -t devops-docker-squad5-1 .' + } + } } tools { From 93f2fcae558cf9ffe1827ff2aaf03b62db8c6236 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 4 Mar 2021 18:20:09 -0500 Subject: [PATCH 044/190] sudo command inclusion --- Jenkinsfile | 1 + postgresql.sh | 2 +- tomcat.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8a9c56e4ea..7c11cfc21a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -51,6 +51,7 @@ pipeline { " ''' } + // sh 'docker build -t devops-docker-squad5-1 .' } diff --git a/postgresql.sh b/postgresql.sh index bc2079213d..c94629e85e 100644 --- a/postgresql.sh +++ b/postgresql.sh @@ -64,4 +64,4 @@ echo "Running script" sudo -u postgres psql -f $sqlscript echo "Restarting postgres DB" -sudo /etc/init.d/postgresql restart \ No newline at end of file +sudo /etc/init.d/postgresql restart diff --git a/tomcat.sh b/tomcat.sh index 608a37f7d3..7b8f4fd7a6 100644 --- a/tomcat.sh +++ b/tomcat.sh @@ -23,4 +23,4 @@ echo "" >> /var/lib/tomcat8/conf/tomcat-users.xml #---------------------- echo "Restart tomcat8..." sudo service tomcat8 restart -sleep 5 \ No newline at end of file +sleep 5 From ce763f4bd59467a8e1c85895c3251e125e01ecf0 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 4 Mar 2021 18:51:04 -0500 Subject: [PATCH 045/190] Added the mvn package and pusing the war file to tomcat --- Jenkinsfile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7c11cfc21a..af38391d59 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,17 +43,16 @@ pipeline { stage('Deploy War on Test server') { steps { script { - sh ''' - sudo ssh root@test-server -o StrictHostKeyChecking=no" - mvn -B -f pom.xml package - scp target/*.war /var/lib/tomcat8/webapps/ + sh """ + sudo ssh root@test-server -o StrictHostKeyChecking=no ' + git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git + cd DevOps-Demo-WebApp + mvn package -Dmaven.test.skip=true + cp "target/AVNCommunication-1.0.war" /var/lib/tomcat8/webapps/ systemctl restart tomcat8 - " - ''' + ' + """ } - - - // sh 'docker build -t devops-docker-squad5-1 .' } } From 4a74969f9bb7db7ffa6cd5c82bd472eec1b3a740 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 20:14:22 -0500 Subject: [PATCH 046/190] DP-2 jenkins commit DP-2 jenkins commit --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c7132221cb..bbc05a1cc5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,6 @@ pipeline { echo "Squad5 First blue ocean pipeline 3" } } - post { always { jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') From f153a1bd844d6674d42dcba1bdf9c6c94cb36594 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 20:21:19 -0500 Subject: [PATCH 047/190] DP-2 test jenkins DP-2 Test jenkins --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bbc05a1cc5..d7c3688348 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,6 @@ pipeline { steps { echo "Squad5 First blue ocean pipeline 3" } - } post { always { jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') From 9e0b7d02358ec9374ab373e4a3c562dc88dfd5c4 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 20:27:43 -0500 Subject: [PATCH 048/190] DP-2 test comited test commited --- Jenkinsfile | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d7c3688348..7ef06c6984 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,14 +1,13 @@ pipeline { agent any - stages { - stage('Print Message') { - steps { - echo "Squad5 First blue ocean pipeline 3" - } - post { - always { - jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net', branch: 'matser') - } - } + stage('Build') { + steps { + echo 'Building...' + } + post { + always { + jiraSendBuildInfo site: '.atlassian.net' + } + } } } From b30ee886b19684e2935493062f2e46bd88318065 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 20:29:59 -0500 Subject: [PATCH 049/190] DP-2 DP-2 --- Jenkinsfile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7ef06c6984..e787e4138b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,13 +1,15 @@ pipeline { agent any - stage('Build') { - steps { - echo 'Building...' - } - post { - always { - jiraSendBuildInfo site: '.atlassian.net' - } - } - } + stages{ + stage('Build') { + steps { + echo 'Building...' + } + post { + always { + jiraSendBuildInfo site: '.atlassian.net' + } + } + } + } } From 3ed6af8af77dc7f0addce01679f38b27dfc2f719 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 20:32:28 -0500 Subject: [PATCH 050/190] DP-2 test commit DP-2 test commit --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e787e4138b..b5ffec7096 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,7 @@ pipeline { } post { always { - jiraSendBuildInfo site: '.atlassian.net' + jiraSendBuildInfo site: 'https://devopsbctcs03.atlassian.net' } } } From c80e42b3a195ddce740f710eb79f5208e505ff47 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 20:53:26 -0500 Subject: [PATCH 051/190] DP-2 DP-2 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b5ffec7096..bce49bb1c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,7 @@ pipeline { } post { always { - jiraSendBuildInfo site: 'https://devopsbctcs03.atlassian.net' + jiraSendBuildInfo site: 'https://devopsbctcs03.atlassian.net/secure/RapidBoard.jspa?rapidView=2&projectKey=DP&selectedIssue=DP-2' } } } From d069256ce327d6676790ea46f93b29ac6e2786fe Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 20:58:01 -0500 Subject: [PATCH 052/190] DP-2 DP-2 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bce49bb1c8..9fd9d3c5fb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,7 @@ pipeline { } post { always { - jiraSendBuildInfo site: 'https://devopsbctcs03.atlassian.net/secure/RapidBoard.jspa?rapidView=2&projectKey=DP&selectedIssue=DP-2' + jiraSendBuildInfo site: 'devopsbctcs03.atlassian.net' } } } From 552f1f2249535a112d6d4e3298b0a97e99f101ef Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Thu, 4 Mar 2021 21:00:24 -0500 Subject: [PATCH 053/190] DP-2 DP-2 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9fd9d3c5fb..284f2b394b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages{ stage('Build') { steps { - echo 'Building...' + echo 'Building....' } post { always { From 7f94b63594cc614e1824b928439b84cb965c6e74 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 16:43:59 -0500 Subject: [PATCH 054/190] Added the mvn package and pusing the war file to tomcat --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index af38391d59..3585c21c60 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,6 +62,6 @@ pipeline { jdk 'JDK' } environment { - SONAR_AUTH = credentials('sonar-login') + SONAR_AUTH = credentials('sonar-user-token') } } From f84bc3c2d090829c1f729568eec69dfbb9e4c81b Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 16:49:37 -0500 Subject: [PATCH 055/190] Added the mvn package and pusing the war file to tomcat --- Jenkinsfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3585c21c60..e3827b0c71 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,18 +1,18 @@ pipeline { agent any stages { - // stage('Sonar Qube Analysis') { - // steps { - // withSonarQubeEnv('sonarqube-server') { - // sh ''' - // echo "PATH = ${PATH}" - // echo "M2_HOME = ${M2_HOME}" - // mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - // ''' - // } + stage('Sonar Qube Analysis') { + steps { + withSonarQubeEnv('sonarqube-server') { + sh ''' + echo "PATH = ${PATH}" + echo "M2_HOME = ${M2_HOME}" + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + ''' + } - // } - // } + } + } stage('Build the project') { steps { @@ -62,6 +62,6 @@ pipeline { jdk 'JDK' } environment { - SONAR_AUTH = credentials('sonar-user-token') + SONAR_AUTH = credentials('sonar-login') } } From 5c50e782c106edc43383f138db28e1057cc68390 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 17:23:18 -0500 Subject: [PATCH 056/190] Added the artifactory publish step --- Jenkinsfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index e3827b0c71..25ecdac95d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,6 @@ +def server +def buildInfo +def rtMaven pipeline { agent any stages { @@ -55,6 +58,23 @@ pipeline { } } } + stage('Store Artifacts') { + steps { + script { + server = Artifactory.server artifactory + rtMaven = Artifactory.newMavenBuild() + rtMaven.tool = maven // Tool name from Jenkins configuration + rtMaven.deployer releaseRepo: 'squad5-libs-release-local', snapshotRepo: 'squad5-libs-snapshot-local', server: server + rtMaven.resolver releaseRepo: 'squad5-libs-release', snapshotRepo: 'squad5-libs-snapshot', server: server + rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run + buildInfo = Artifactory.newBuildInfo() + rtMaven.run pom: 'target/pom.xml', goals: 'clean test' + rtMaven.run pom: 'target/pom.xml', goals: 'install', buildInfo: buildInfo + rtMaven.deployer.deployArtifacts buildInfo + server.publishBuildInfo buildInfo + } + } + } } tools { From b606e971ac6ae69b38658c776dcdef7d66a4274c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 17:24:15 -0500 Subject: [PATCH 057/190] Added the artifactory publish step --- Jenkinsfile | 96 ++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 25ecdac95d..33080fca68 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,60 +4,60 @@ def rtMaven pipeline { agent any stages { - stage('Sonar Qube Analysis') { - steps { - withSonarQubeEnv('sonarqube-server') { - sh ''' - echo "PATH = ${PATH}" - echo "M2_HOME = ${M2_HOME}" - mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - ''' - } + // stage('Sonar Qube Analysis') { + // steps { + // withSonarQubeEnv('sonarqube-server') { + // sh ''' + // echo "PATH = ${PATH}" + // echo "M2_HOME = ${M2_HOME}" + // mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + // ''' + // } - } - } + // } + // } - stage('Build the project') { - steps { - script { - sh ''' - mvn -B -f pom.xml compile - ''' - } + // stage('Build the project') { + // steps { + // script { + // sh ''' + // mvn -B -f pom.xml compile + // ''' + // } - } - } + // } + // } - stage('Configure Test Server') { - steps { - script { - sh ''' - gcloud auth activate-service-account --key-file=/var/lib/jenkins/workspace/gcloud_auth - gcloud config set compute/zone us-central1-a - testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` - sed -i "s/squadtestserver/$testserver/g" $(find . -type f) - sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml - ''' - } + // stage('Configure Test Server') { + // steps { + // script { + // sh ''' + // gcloud auth activate-service-account --key-file=/var/lib/jenkins/workspace/gcloud_auth + // gcloud config set compute/zone us-central1-a + // testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` + // sed -i "s/squadtestserver/$testserver/g" $(find . -type f) + // sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml + // ''' + // } - } - } + // } + // } - stage('Deploy War on Test server') { - steps { - script { - sh """ - sudo ssh root@test-server -o StrictHostKeyChecking=no ' - git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git - cd DevOps-Demo-WebApp - mvn package -Dmaven.test.skip=true - cp "target/AVNCommunication-1.0.war" /var/lib/tomcat8/webapps/ - systemctl restart tomcat8 - ' - """ - } - } - } + // stage('Deploy War on Test server') { + // steps { + // script { + // sh """ + // sudo ssh root@test-server -o StrictHostKeyChecking=no ' + // git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git + // cd DevOps-Demo-WebApp + // mvn package -Dmaven.test.skip=true + // cp "target/AVNCommunication-1.0.war" /var/lib/tomcat8/webapps/ + // systemctl restart tomcat8 + // ' + // """ + // } + // } + // } stage('Store Artifacts') { steps { script { From 54b0c7210745b8a42429baf7fc8a0a112bfa19dc Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 17:26:42 -0500 Subject: [PATCH 058/190] Added the artifactory publish step --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 33080fca68..06ce219712 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,7 +61,7 @@ pipeline { stage('Store Artifacts') { steps { script { - server = Artifactory.server artifactory + server = Artifactory.server 'artifactory' rtMaven = Artifactory.newMavenBuild() rtMaven.tool = maven // Tool name from Jenkins configuration rtMaven.deployer releaseRepo: 'squad5-libs-release-local', snapshotRepo: 'squad5-libs-snapshot-local', server: server From 6c584b0a8b82d37ac2ee7826915997183982c5cf Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 17:27:37 -0500 Subject: [PATCH 059/190] Added the artifactory publish step --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 06ce219712..8119d45cb5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -63,7 +63,7 @@ pipeline { script { server = Artifactory.server 'artifactory' rtMaven = Artifactory.newMavenBuild() - rtMaven.tool = maven // Tool name from Jenkins configuration + rtMaven.tool = 'Maven3.6.3' // Tool name from Jenkins configuration rtMaven.deployer releaseRepo: 'squad5-libs-release-local', snapshotRepo: 'squad5-libs-snapshot-local', server: server rtMaven.resolver releaseRepo: 'squad5-libs-release', snapshotRepo: 'squad5-libs-snapshot', server: server rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run From 265967e877e8df87a8704992624f09f2b0edd877 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 17:28:46 -0500 Subject: [PATCH 060/190] Added the artifactory publish step --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8119d45cb5..a03c5b5a5e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -68,8 +68,8 @@ pipeline { rtMaven.resolver releaseRepo: 'squad5-libs-release', snapshotRepo: 'squad5-libs-snapshot', server: server rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run buildInfo = Artifactory.newBuildInfo() - rtMaven.run pom: 'target/pom.xml', goals: 'clean test' - rtMaven.run pom: 'target/pom.xml', goals: 'install', buildInfo: buildInfo + rtMaven.run pom: 'pom.xml', goals: 'clean test' + rtMaven.run pom: 'pom.xml', goals: 'install', buildInfo: buildInfo rtMaven.deployer.deployArtifacts buildInfo server.publishBuildInfo buildInfo } From 60920f66cd6ad90a4fb13e2141541b58915901ec Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 17:46:01 -0500 Subject: [PATCH 061/190] Added the artifactory publish step --- Jenkinsfile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a03c5b5a5e..da0fb4d9cf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -68,10 +68,20 @@ pipeline { rtMaven.resolver releaseRepo: 'squad5-libs-release', snapshotRepo: 'squad5-libs-snapshot', server: server rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run buildInfo = Artifactory.newBuildInfo() - rtMaven.run pom: 'pom.xml', goals: 'clean test' - rtMaven.run pom: 'pom.xml', goals: 'install', buildInfo: buildInfo - rtMaven.deployer.deployArtifacts buildInfo - server.publishBuildInfo buildInfo + // rtMaven.run pom: 'pom.xml', goals: 'clean test' + // rtMaven.run pom: 'pom.xml', goals: 'install', buildInfo: buildInfo + // rtMaven.deployer.deployArtifacts buildInfo + //def uploadSpec = readFile 'target/ + //server.publishBuildInfo buildInfo + def uploadSpec = """{ + "files": [ + { + "target": "squad5-libs-release-local" + } + ] + }""" + server.upload spec: uploadSpec + } } } From 2f32cf1ef68ce03072cfa6c2b4d86f9b9ff236dd Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 17:49:37 -0500 Subject: [PATCH 062/190] Added the artifactory publish step --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index da0fb4d9cf..2ed69b62c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -76,6 +76,7 @@ pipeline { def uploadSpec = """{ "files": [ { + "pattern": "target/*.war", "target": "squad5-libs-release-local" } ] From 6d40df3f323a49fc9b3f8f0e77dcd63d3792c242 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 17:56:54 -0500 Subject: [PATCH 063/190] Added the artifactory publish step --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2ed69b62c9..7b4c299fe9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -76,7 +76,7 @@ pipeline { def uploadSpec = """{ "files": [ { - "pattern": "target/*.war", + "pattern": "avnsqlreadme.txt", "target": "squad5-libs-release-local" } ] From 019ff486ba3d2b5d8dd36a2898261cb4f42822f4 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 17:58:47 -0500 Subject: [PATCH 064/190] Added the artifactory publish step --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7b4c299fe9..4b4094b7c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,12 +62,12 @@ pipeline { steps { script { server = Artifactory.server 'artifactory' - rtMaven = Artifactory.newMavenBuild() - rtMaven.tool = 'Maven3.6.3' // Tool name from Jenkins configuration - rtMaven.deployer releaseRepo: 'squad5-libs-release-local', snapshotRepo: 'squad5-libs-snapshot-local', server: server - rtMaven.resolver releaseRepo: 'squad5-libs-release', snapshotRepo: 'squad5-libs-snapshot', server: server - rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run - buildInfo = Artifactory.newBuildInfo() + // rtMaven = Artifactory.newMavenBuild() + // rtMaven.tool = 'Maven3.6.3' // Tool name from Jenkins configuration + // rtMaven.deployer releaseRepo: 'squad5-libs-release-local', snapshotRepo: 'squad5-libs-snapshot-local', server: server + // rtMaven.resolver releaseRepo: 'squad5-libs-release', snapshotRepo: 'squad5-libs-snapshot', server: server + // rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run + // buildInfo = Artifactory.newBuildInfo() // rtMaven.run pom: 'pom.xml', goals: 'clean test' // rtMaven.run pom: 'pom.xml', goals: 'install', buildInfo: buildInfo // rtMaven.deployer.deployArtifacts buildInfo From 476f9b5835f64f45b104d09c2f425b4b791a62c2 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 18:02:57 -0500 Subject: [PATCH 065/190] Added the artifactory path --- Jenkinsfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4b4094b7c6..4339ade55c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -73,15 +73,16 @@ pipeline { // rtMaven.deployer.deployArtifacts buildInfo //def uploadSpec = readFile 'target/ //server.publishBuildInfo buildInfo + mvn package -Dmaven.test.skip=true def uploadSpec = """{ "files": [ - { - "pattern": "avnsqlreadme.txt", - "target": "squad5-libs-release-local" - } - ] - }""" - server.upload spec: uploadSpec + { + "pattern": "target/*.war", + "target": "squad5-libs-release-local, squad5-libs-snapshot-local" + } + ] + }""" + server.upload spec: uploadSpec } } From d6c6e9cae42c3615c61db3418676b1809792945d Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 18:04:06 -0500 Subject: [PATCH 066/190] Added the artifactory path --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4339ade55c..43b7c29f2b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -73,7 +73,7 @@ pipeline { // rtMaven.deployer.deployArtifacts buildInfo //def uploadSpec = readFile 'target/ //server.publishBuildInfo buildInfo - mvn package -Dmaven.test.skip=true + sh """ mvn package -Dmaven.test.skip=true """ def uploadSpec = """{ "files": [ { From 3b7346840eb2c6ea094a82707163206c47e4a35b Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 18:05:31 -0500 Subject: [PATCH 067/190] Added the artifactory path --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 43b7c29f2b..4952c763b2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -78,7 +78,11 @@ pipeline { "files": [ { "pattern": "target/*.war", - "target": "squad5-libs-release-local, squad5-libs-snapshot-local" + "target": "squad5-libs-release-local" + }, + { + "pattern": "target/*.war", + "target": "squad5-libs-snapshot-local" } ] }""" From 49e2cdda19b26322e7e6368f39c64cd4ffe91a64 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 18:33:30 -0500 Subject: [PATCH 068/190] Added the deploy from artifaction to test server --- Jenkinsfile | 54 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4952c763b2..fdbe8f2e87 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,21 +43,21 @@ pipeline { // } // } - // stage('Deploy War on Test server') { - // steps { - // script { - // sh """ - // sudo ssh root@test-server -o StrictHostKeyChecking=no ' - // git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git - // cd DevOps-Demo-WebApp - // mvn package -Dmaven.test.skip=true - // cp "target/AVNCommunication-1.0.war" /var/lib/tomcat8/webapps/ - // systemctl restart tomcat8 - // ' - // """ - // } - // } - // } + stage('Deploy War on Test server') { + steps { + script { + sh """ + sudo ssh root@test-server -o StrictHostKeyChecking=no ' + git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git + cd DevOps-Demo-WebApp + mvn package -Dmaven.test.skip=true + cp "target/AVNCommunication-1.0.war" /var/lib/tomcat8/webapps/ + systemctl restart tomcat8 + ' + """ + } + } + } stage('Store Artifacts') { steps { script { @@ -91,6 +91,30 @@ pipeline { } } } + stage('Deploy War on Test server') { + steps { + // script { + // def downloadSpec = """{ + // "files": [ + // { + // "pattern": "target/*.war", + // "target": "squad5-libs-release-local" + // } + // ] + // }""" + // server.download spec: downloadSpec + + sh """ + sudo ssh root@test-server -o StrictHostKeyChecking=no " + #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git + #cd DevOps-Demo-WebApp + curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war + systemctl restart tomcat8 + " + """ + } + } + } } tools { From b8581dbf8b2edcce67aa0a0245c149375334d13a Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 18:34:23 -0500 Subject: [PATCH 069/190] Added the deploy from artifaction to test server --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fdbe8f2e87..e80bc05c38 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -114,7 +114,7 @@ pipeline { """ } } - } + } tools { From 5c99f358c72dcb6e5cef2c8b2b9aa7d3e0767766 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 5 Mar 2021 18:35:48 -0500 Subject: [PATCH 070/190] Added the deploy from artifaction to test server --- Jenkinsfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e80bc05c38..1049e075b6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,21 +43,21 @@ pipeline { // } // } - stage('Deploy War on Test server') { - steps { - script { - sh """ - sudo ssh root@test-server -o StrictHostKeyChecking=no ' - git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git - cd DevOps-Demo-WebApp - mvn package -Dmaven.test.skip=true - cp "target/AVNCommunication-1.0.war" /var/lib/tomcat8/webapps/ - systemctl restart tomcat8 - ' - """ - } - } - } + // stage('Deploy War on Test server') { + // steps { + // script { + // sh """ + // sudo ssh root@test-server -o StrictHostKeyChecking=no ' + // git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git + // cd DevOps-Demo-WebApp + // mvn package -Dmaven.test.skip=true + // cp "target/AVNCommunication-1.0.war" /var/lib/tomcat8/webapps/ + // systemctl restart tomcat8 + // ' + // """ + // } + // } + // } stage('Store Artifacts') { steps { script { From 793e8501f246d91a3f003e5ae7c7289b23805961 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 19:01:43 -0500 Subject: [PATCH 071/190] DP-2 DP-2 --- Jenkinsfile | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 284f2b394b..bea9e2fc40 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,9 @@ pipeline { agent any stages{ - stage('Build') { + stage('Build-1') { steps { - echo 'Building....' + echo 'Building......' } post { always { @@ -11,5 +11,25 @@ pipeline { } } } + stage('test') { + steps { + echo 'Building......' + } + post { + always { + jiraSendBuildInfo site: 'devopsbctcs03.atlassian.net' + } + } + } + stage('Deploy') { + steps { + echo 'Building......' + } + post { + always { + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testcatalina', environmentType: 'testing', issueKeys: ['DP-2'] + } + } + } } } From 8f849935a57ae630f407b644c15bfe50c62d9410 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 19:07:52 -0500 Subject: [PATCH 072/190] DP-2 --- Jenkinsfile | 63 +++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bea9e2fc40..2b1b17a972 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,35 +1,42 @@ pipeline { agent any - stages{ + stages { stage('Build-1') { - steps { - echo 'Building......' - } - post { - always { - jiraSendBuildInfo site: 'devopsbctcs03.atlassian.net' - } - } + post { + always { + jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net') + } + + } + steps { + echo 'Building......' + } } + stage('test') { - steps { - echo 'Building......' - } - post { - always { - jiraSendBuildInfo site: 'devopsbctcs03.atlassian.net' - } - } + post { + always { + jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net') + } + + } + steps { + echo 'Building......' + jiraSendBuildInfo(branch: 'DP-2', site: 'https://devopsbctcs03.atlassian.net/') + } } - stage('Deploy') { - steps { - echo 'Building......' - } - post { - always { - jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testcatalina', environmentType: 'testing', issueKeys: ['DP-2'] - } - } + + stage('Deploy') { + post { + always { + jiraSendDeploymentInfo(site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testcatalina', environmentType: 'testing', issueKeys: ['DP-2']) + } + + } + steps { + echo 'Building......' + } } - } -} + + } +} \ No newline at end of file From 11fdf414ecdb6e33abed187061f23ec605e272cd Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 19:10:44 -0500 Subject: [PATCH 073/190] DP-2 Dp-2 --- Jenkinsfile | 63 ++++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2b1b17a972..eb0e3c5cf5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,42 +1,35 @@ pipeline { agent any - stages { + stages{ stage('Build-1') { - post { - always { - jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net') - } - - } - steps { - echo 'Building......' - } + steps { + echo 'Building......' + } + post { + always { + jiraSendBuildInfo site: 'devopsbctcs03.atlassian.net', issueKeys: ['DP-2'] + } + } } - stage('test') { - post { - always { - jiraSendBuildInfo(site: 'devopsbctcs03.atlassian.net') - } - - } - steps { - echo 'Building......' - jiraSendBuildInfo(branch: 'DP-2', site: 'https://devopsbctcs03.atlassian.net/') - } + steps { + echo 'Building......' + } + post { + always { + jiraSendBuildInfo site: 'devopsbctcs03.atlassian.net', issueKeys: ['DP-2'] + } + } } - - stage('Deploy') { - post { - always { - jiraSendDeploymentInfo(site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testcatalina', environmentType: 'testing', issueKeys: ['DP-2']) - } - - } - steps { - echo 'Building......' - } + stage('Deploy') { + steps { + echo 'Building......' + } + post { + always { + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testcatalina', environmentType: 'testing', issueKeys: ['DP-2'] + } + } } - - } -} \ No newline at end of file + } +} From 283cb6c997f3032377289fd012e249383e5a5604 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 20:56:01 -0500 Subject: [PATCH 074/190] DP-2 DP-2 --- Jenkinsfile | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index eb0e3c5cf5..058c29e725 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,32 +4,8 @@ pipeline { stage('Build-1') { steps { echo 'Building......' - } - post { - always { - jiraSendBuildInfo site: 'devopsbctcs03.atlassian.net', issueKeys: ['DP-2'] - } - } - } - stage('test') { - steps { - echo 'Building......' - } - post { - always { - jiraSendBuildInfo site: 'devopsbctcs03.atlassian.net', issueKeys: ['DP-2'] - } - } - } - stage('Deploy') { - steps { - echo 'Building......' - } - post { - always { - jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testcatalina', environmentType: 'testing', issueKeys: ['DP-2'] - } + slackSend channel: 'notify', message: 'Performance Testing started: ${env.JOB_NAME} ${env.BUILD_NUMBER}' } } - } + } } From 0f4555d2c73ccd7ea6af965827d8656201d679ba Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:00:51 -0500 Subject: [PATCH 075/190] DP-2 Dp-2 --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 058c29e725..3e60cfb654 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,8 +3,9 @@ pipeline { stages{ stage('Build-1') { steps { + slackSend channel: 'notify', message: 'Performance Testing started: ${BUILD_NUMBER}' echo 'Building......' - slackSend channel: 'notify', message: 'Performance Testing started: ${env.JOB_NAME} ${env.BUILD_NUMBER}' + slackSend channel: 'notify', message: 'Performance Testing ended: ${BUILD_NUMBER}' } } } From fa36535970c3424f949a158e935275b2f9c013e5 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:03:04 -0500 Subject: [PATCH 076/190] DP-2 DP-2 --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3e60cfb654..814eb7883f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,9 +3,9 @@ pipeline { stages{ stage('Build-1') { steps { - slackSend channel: 'notify', message: 'Performance Testing started: ${BUILD_NUMBER}' + slackSend channel: 'notify', message: 'Performance Testing started: ' ${BUILD_NUMBER} echo 'Building......' - slackSend channel: 'notify', message: 'Performance Testing ended: ${BUILD_NUMBER}' + slackSend channel: 'notify', message: 'Performance Testing ended: ' ${BUILD_NUMBER} } } } From 76632892a870b08735f85dfdac3f0e89fc658dea Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:05:05 -0500 Subject: [PATCH 077/190] h h --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 814eb7883f..d291f1b63c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,9 +3,9 @@ pipeline { stages{ stage('Build-1') { steps { - slackSend channel: 'notify', message: 'Performance Testing started: ' ${BUILD_NUMBER} + slackSend channel: 'notify', message: 'Performance Testing started: $BUILD_NUMBER' echo 'Building......' - slackSend channel: 'notify', message: 'Performance Testing ended: ' ${BUILD_NUMBER} + slackSend channel: 'notify', message: 'Performance Testing ended: $BUILD_NUMBER' } } } From 3c550177d67bba970b652362afb65a05d4a1d1c5 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:07:25 -0500 Subject: [PATCH 078/190] h --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d291f1b63c..96a4e046ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,9 +3,9 @@ pipeline { stages{ stage('Build-1') { steps { - slackSend channel: 'notify', message: 'Performance Testing started: $BUILD_NUMBER' + slackSend channel: 'notify', message: 'Performance Testing started: $env.BUILD_NUMBER' echo 'Building......' - slackSend channel: 'notify', message: 'Performance Testing ended: $BUILD_NUMBER' + slackSend channel: 'notify', message: 'Performance Testing ended: $env.BUILD_NUMBER' } } } From e528bc0c72a86b6563fa88c42af75c5376c84bbf Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:08:11 -0500 Subject: [PATCH 079/190] h --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 96a4e046ed..c5f9183a53 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,9 +3,9 @@ pipeline { stages{ stage('Build-1') { steps { - slackSend channel: 'notify', message: 'Performance Testing started: $env.BUILD_NUMBER' + slackSend channel: 'notify', message: 'Performance Testing started: ${env.BUILD_NUMBER}' echo 'Building......' - slackSend channel: 'notify', message: 'Performance Testing ended: $env.BUILD_NUMBER' + slackSend channel: 'notify', message: 'Performance Testing ended: ${env.BUILD_NUMBER}' } } } From 9012eb2362dd1dd8c520c4ac322bd74bbf91ac7f Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:14:41 -0500 Subject: [PATCH 080/190] j --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c5f9183a53..e9e8bba8fc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,8 @@ pipeline { stages{ stage('Build-1') { steps { - slackSend channel: 'notify', message: 'Performance Testing started: ${env.BUILD_NUMBER}' + buildid=${env.BUILD_NUMBER} + slackSend channel: 'notify', message: ${env.BUILD_NUMBER} echo 'Building......' slackSend channel: 'notify', message: 'Performance Testing ended: ${env.BUILD_NUMBER}' } From 5f39a51eff5fd66a13e50869dd5f3f90cc0cae1c Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:19:13 -0500 Subject: [PATCH 081/190] j --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e9e8bba8fc..a82967b181 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,8 +3,9 @@ pipeline { stages{ stage('Build-1') { steps { - buildid=${env.BUILD_NUMBER} - slackSend channel: 'notify', message: ${env.BUILD_NUMBER} + def buildid = ${env.BUILD_NUMBER} + echo buildid + slackSend channel: 'notify', message: 'Performance Testing ended: ${env.BUILD_NUMBER}' echo 'Building......' slackSend channel: 'notify', message: 'Performance Testing ended: ${env.BUILD_NUMBER}' } From 2fb2a59e383726668ee5d007e060d3b653d31848 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:20:26 -0500 Subject: [PATCH 082/190] k --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a82967b181..3ea1a57869 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,9 +3,7 @@ pipeline { stages{ stage('Build-1') { steps { - def buildid = ${env.BUILD_NUMBER} - echo buildid - slackSend channel: 'notify', message: 'Performance Testing ended: ${env.BUILD_NUMBER}' + slackSend channel: 'notify', message: ${env.BUILD_NUMBER} echo 'Building......' slackSend channel: 'notify', message: 'Performance Testing ended: ${env.BUILD_NUMBER}' } From b8e2a3d06dfb0a7625ce7b33bae7e2569e1a6fb8 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:21:09 -0500 Subject: [PATCH 083/190] h --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3ea1a57869..0e2f627fd4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages{ stage('Build-1') { steps { - slackSend channel: 'notify', message: ${env.BUILD_NUMBER} + slackSend channel: 'notify', message: "${env.BUILD_NUMBER}" echo 'Building......' slackSend channel: 'notify', message: 'Performance Testing ended: ${env.BUILD_NUMBER}' } From e419c13e7e297228b689b4d9fecec61cc44db318 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:22:55 -0500 Subject: [PATCH 084/190] DP-2 DP-2 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0e2f627fd4..d3c2b34331 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { steps { slackSend channel: 'notify', message: "${env.BUILD_NUMBER}" echo 'Building......' - slackSend channel: 'notify', message: 'Performance Testing ended: ${env.BUILD_NUMBER}' + slackSend channel: 'notify', message: "Performance Testing ended: ${env.BUILD_NUMBER}" } } } From 3e1ce0d8941ede27a2dc7eef9cee4fa9cfc490a9 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Sat, 6 Mar 2021 10:33:16 -0500 Subject: [PATCH 085/190] added selenium and blazemeter test added selenium and blazemeter test --- Jenkinsfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 1049e075b6..3d6ed256d9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -115,6 +115,28 @@ pipeline { } } + stage('UI Selenium Tests') { + steps { + slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + mvn -B -f functionaltest/pom.xml test + ''' + } + // publish html + publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) + } + } + + stage('Performance test'){ + steps { + slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' + } + } + + + } tools { From ccffc5e2e58ab379411e7f7595ce7ba7f5204421 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Sat, 6 Mar 2021 10:34:54 -0500 Subject: [PATCH 086/190] uncomment test server config uncomment test server config --- Jenkinsfile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3d6ed256d9..71687bcbb7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,20 +28,20 @@ pipeline { // } // } - // stage('Configure Test Server') { - // steps { - // script { - // sh ''' - // gcloud auth activate-service-account --key-file=/var/lib/jenkins/workspace/gcloud_auth - // gcloud config set compute/zone us-central1-a - // testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` - // sed -i "s/squadtestserver/$testserver/g" $(find . -type f) - // sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml - // ''' - // } + stage('Configure Test Server') { + steps { + script { + sh ''' + gcloud auth activate-service-account --key-file=/var/lib/jenkins/workspace/gcloud_auth + gcloud config set compute/zone us-central1-a + testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` + sed -i "s/squadtestserver/$testserver/g" $(find . -type f) + sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml + ''' + } - // } - // } + } + } // stage('Deploy War on Test server') { // steps { From 23ce608feb75c5837784e5ea8067158189cf6cf8 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 11:04:35 -0500 Subject: [PATCH 087/190] transfer war file to test server --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 71687bcbb7..ec625e15cd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -105,10 +105,11 @@ pipeline { // server.download spec: downloadSpec sh """ + sudo scp "target/AVNCommunication-1.0.war" root@test-server:/var/lib/tomcat8/webapps/ sudo ssh root@test-server -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git #cd DevOps-Demo-WebApp - curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war + #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war systemctl restart tomcat8 " """ From 9ce77420c885898520c149cd42e4f633b639384a Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 11:16:14 -0500 Subject: [PATCH 088/190] transfer war file to test server --- postgresql.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/postgresql.sh b/postgresql.sh index c94629e85e..431cdc84bf 100644 --- a/postgresql.sh +++ b/postgresql.sh @@ -11,7 +11,8 @@ dfolder='/postgres/data' # $sysuser is the system user for running PostgreSQL sysuser='postgres' # $scripts directory -scripts="/home/$USER/scripts" +#scripts="/home/$USER/scripts" +scripts="scripts" # $sqlscript is the sql script for creating the PSQL user and creating a database. sqlscript="$scripts/initial-table.sql" # $logfile is the log file for this installation. From ff41c4049fe227c935280c8d99444d7e67b583d6 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 11:35:49 -0500 Subject: [PATCH 089/190] transfer war file to test server --- Jenkinsfile | 2 +- postgresql.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ec625e15cd..b00da62231 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,7 +36,7 @@ pipeline { gcloud config set compute/zone us-central1-a testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` sed -i "s/squadtestserver/$testserver/g" $(find . -type f) - sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml + #sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml ''' } diff --git a/postgresql.sh b/postgresql.sh index 431cdc84bf..f8c3749ab2 100644 --- a/postgresql.sh +++ b/postgresql.sh @@ -11,8 +11,8 @@ dfolder='/postgres/data' # $sysuser is the system user for running PostgreSQL sysuser='postgres' # $scripts directory -#scripts="/home/$USER/scripts" -scripts="scripts" +scripts="/home/$USER/scripts" +#scripts="scripts" # $sqlscript is the sql script for creating the PSQL user and creating a database. sqlscript="$scripts/initial-table.sql" # $logfile is the log file for this installation. From 538292da78efef3a21b5f920dd901ddb974cf6d5 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 11:41:28 -0500 Subject: [PATCH 090/190] transfer war file to test server --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index b00da62231..b5b5050f2e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -111,6 +111,7 @@ pipeline { #cd DevOps-Demo-WebApp #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war systemctl restart tomcat8 + sleep 10s " """ } From 113524764037d0bded6cfde3c97ae89d82a2522c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sat, 6 Mar 2021 11:56:26 -0500 Subject: [PATCH 091/190] Renamed the war file --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b5b5050f2e..1cbd5e9836 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -105,7 +105,7 @@ pipeline { // server.download spec: downloadSpec sh """ - sudo scp "target/AVNCommunication-1.0.war" root@test-server:/var/lib/tomcat8/webapps/ + sudo scp "target/AVNCommunication-1.0.war" root@test-server:/var/lib/tomcat8/webapps/QAWebapp.war sudo ssh root@test-server -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git #cd DevOps-Demo-WebApp From 30710d72f2ce1c9890faedf7f9f78034dc4ba50a Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sat, 6 Mar 2021 12:35:58 -0500 Subject: [PATCH 092/190] Renamed the war file --- functionaltest/src/test/java/functionaltest/ftat.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functionaltest/src/test/java/functionaltest/ftat.java b/functionaltest/src/test/java/functionaltest/ftat.java index 4f04cbafd2..b356a9dda4 100644 --- a/functionaltest/src/test/java/functionaltest/ftat.java +++ b/functionaltest/src/test/java/functionaltest/ftat.java @@ -51,9 +51,9 @@ public void viewrepairticket() throws Exception { WebElement prepair = wait.until(ExpectedConditions .visibilityOfElementLocated(By.xpath("//p[text()='REPAIR']"))); prepair.isDisplayed(); - driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); + driver.manage().timeouts().implicitlyWait(25, TimeUnit.SECONDS); driver.get(URL1); - driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); + driver.manage().timeouts().implicitlyWait(25, TimeUnit.SECONDS); WebElement repair = wait.until( ExpectedConditions.visibilityOfElementLocated(By.xpath("//font[text()='Create Repair Ticket']"))); repair.isDisplayed(); From 5d2c5edb0825ee02c18a86fe5be7cd2bf14cddea Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Sat, 6 Mar 2021 12:51:17 -0500 Subject: [PATCH 093/190] commited selenium tyest commited selenium tyest --- Jenkinsfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1cbd5e9836..dc6d2409c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -117,18 +117,18 @@ pipeline { } } - stage('UI Selenium Tests') { - steps { - slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - script { - sh ''' - mvn -B -f functionaltest/pom.xml test - ''' - } - // publish html - publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) - } - } + //stage('UI Selenium Tests') { + // steps { + // slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + // script { + // sh ''' + // mvn -B -f functionaltest/pom.xml test + // ''' + // } + // // publish html + // publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) + // } + // } stage('Performance test'){ steps { From 9760e97abe6a3e1089ab4cf699d43d6ccdb22ea5 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sat, 6 Mar 2021 13:03:20 -0500 Subject: [PATCH 094/190] Updated the prod server --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1cbd5e9836..e83d02b722 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,7 +34,7 @@ pipeline { sh ''' gcloud auth activate-service-account --key-file=/var/lib/jenkins/workspace/gcloud_auth gcloud config set compute/zone us-central1-a - testserver=`gcloud compute instances describe test-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` + testserver=`gcloud compute instances describe prod-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` sed -i "s/squadtestserver/$testserver/g" $(find . -type f) #sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml ''' @@ -105,8 +105,8 @@ pipeline { // server.download spec: downloadSpec sh """ - sudo scp "target/AVNCommunication-1.0.war" root@test-server:/var/lib/tomcat8/webapps/QAWebapp.war - sudo ssh root@test-server -o StrictHostKeyChecking=no " + sudo scp "target/AVNCommunication-1.0.war" root@prod-server:/var/lib/tomcat8/webapps/QAWebapp.war + sudo ssh root@prod-server -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git #cd DevOps-Demo-WebApp #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war From 1f042402507936b59bd2482c205b0a5fd0622c3f Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sat, 6 Mar 2021 13:17:03 -0500 Subject: [PATCH 095/190] Updated the prod server --- Jenkinsfile | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7a078029e7..25b1d3407c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -105,7 +105,7 @@ pipeline { // server.download spec: downloadSpec sh """ - sudo scp "target/AVNCommunication-1.0.war" root@prod-server:/var/lib/tomcat8/webapps/QAWebapp.war + sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@prod-server:/var/lib/tomcat8/webapps/QAWebapp.war sudo ssh root@prod-server -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git #cd DevOps-Demo-WebApp @@ -117,25 +117,25 @@ pipeline { } } - //stage('UI Selenium Tests') { - // steps { - // slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - // script { - // sh ''' - // mvn -B -f functionaltest/pom.xml test - // ''' - // } - // // publish html - // publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) - // } - // } + stage('UI Selenium Tests') { + steps { + slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + mvn -B -f functionaltest/pom.xml test + ''' + } + // publish html + publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) + } + } - stage('Performance test'){ - steps { - slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - } - } + // stage('Performance test'){ + // steps { + // slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' + // } + // } From 8459df73529cb5a05f71e65dfe828e0401d0269a Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Sat, 6 Mar 2021 20:13:04 -0500 Subject: [PATCH 096/190] Update TestServerCreation.yml Added Java Code --- TestServerCreation.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/TestServerCreation.yml b/TestServerCreation.yml index ee01b5d12c..d6ad322f88 100644 --- a/TestServerCreation.yml +++ b/TestServerCreation.yml @@ -16,4 +16,8 @@ tags: tomcatInstall - name: "Install Postgresql" shell: bash postgresql.sh > postgresqlinstallLog.txt - tags: postgresqlInstall \ No newline at end of file + tags: postgresqlInstall + - name: "Install Java" + apt: + name: openjdk-8-jdk + state: present From 12e6146fddbfdac13fa4d98c2f1a3d5754c856f3 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 21:00:21 -0500 Subject: [PATCH 097/190] updated sonar server name --- Jenkinsfile | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b5b5050f2e..86af5a86cd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,29 +4,29 @@ def rtMaven pipeline { agent any stages { - // stage('Sonar Qube Analysis') { - // steps { - // withSonarQubeEnv('sonarqube-server') { - // sh ''' - // echo "PATH = ${PATH}" - // echo "M2_HOME = ${M2_HOME}" - // mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - // ''' - // } + stage('Sonar Qube Analysis') { + steps { + withSonarQubeEnv('sonarqube-server') { + sh ''' + echo "PATH = ${PATH}" + echo "M2_HOME = ${M2_HOME}" + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + ''' + } - // } - // } + } + } - // stage('Build the project') { - // steps { - // script { - // sh ''' - // mvn -B -f pom.xml compile - // ''' - // } + stage('Build the project') { + steps { + script { + sh ''' + mvn -B -f pom.xml compile + ''' + } - // } - // } + } + } stage('Configure Test Server') { steps { @@ -146,6 +146,6 @@ pipeline { jdk 'JDK' } environment { - SONAR_AUTH = credentials('sonar-login') + SONAR_AUTH = credentials('sonar') } } From d65caefa8b87b714fc4c66a7a826e9d31473b1a3 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 21:03:32 -0500 Subject: [PATCH 098/190] updated sonar server name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e9a39a7752..c27f5accb5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -146,6 +146,6 @@ pipeline { jdk 'JDK' } environment { - SONAR_AUTH = credentials('sonar') + SONAR_AUTH = credentials('admin') } } From 3468ef31494516145db6abe13f4edbbbb5974ada Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 21:08:37 -0500 Subject: [PATCH 099/190] updated sonar server name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c27f5accb5..e9a39a7752 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -146,6 +146,6 @@ pipeline { jdk 'JDK' } environment { - SONAR_AUTH = credentials('admin') + SONAR_AUTH = credentials('sonar') } } From bf63fc37a2f8d7d521cfe100c736f40221197654 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 21:32:33 -0500 Subject: [PATCH 100/190] updated sonar server name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e9a39a7752..f7c04b55ee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { sh ''' echo "PATH = ${PATH}" echo "M2_HOME = ${M2_HOME}" - mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=sonar -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} ''' } From 2dc8541697c2a7c4a85c12038329fe8d616c6d60 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 21:37:43 -0500 Subject: [PATCH 101/190] updated sonar server name --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f7c04b55ee..e1b2f1a53f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { sh ''' echo "PATH = ${PATH}" echo "M2_HOME = ${M2_HOME}" - mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=sonar -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} ''' } @@ -146,6 +146,6 @@ pipeline { jdk 'JDK' } environment { - SONAR_AUTH = credentials('sonar') + SONAR_AUTH = credentials('sonar-login') } } From 88d64fc1ead78aa2a723adbcb9d137dbdc19d638 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 21:52:46 -0500 Subject: [PATCH 102/190] updated sonar server name --- Jenkinsfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e1b2f1a53f..e500688865 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,9 +32,10 @@ pipeline { steps { script { sh ''' - gcloud auth activate-service-account --key-file=/var/lib/jenkins/workspace/gcloud_auth - gcloud config set compute/zone us-central1-a - testserver=`gcloud compute instances describe prod-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` + #gcloud auth activate-service-account --key-file=/var/lib/jenkins/workspace/gcloud_auth + #gcloud config set compute/zone us-central1-a + #testserver=`gcloud compute instances describe prod-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` + testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` sed -i "s/squadtestserver/$testserver/g" $(find . -type f) #sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml ''' From e7f8c162c3d6f6a7655f4d64cbfca0c1a666ba3a Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 22:12:51 -0500 Subject: [PATCH 103/190] updated sonar server name --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e500688865..4357752275 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,8 +106,9 @@ pipeline { // server.download spec: downloadSpec sh """ - sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@prod-server:/var/lib/tomcat8/webapps/QAWebapp.war - sudo ssh root@prod-server -o StrictHostKeyChecking=no " + testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` + sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@${testserver}:/var/lib/tomcat8/webapps/QAWebapp.war + sudo ssh root@${testserver} -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git #cd DevOps-Demo-WebApp #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war From 0938744bbe435397b607d0a88eef322374ee665b Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 22:16:37 -0500 Subject: [PATCH 104/190] updated sonar server name --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4357752275..85c1986e55 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -107,8 +107,8 @@ pipeline { sh """ testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@${testserver}:/var/lib/tomcat8/webapps/QAWebapp.war - sudo ssh root@${testserver} -o StrictHostKeyChecking=no " + sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war + sudo ssh root@$testserver -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git #cd DevOps-Demo-WebApp #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war From 7ed876a3f93895b9aace81d5d98d49ffc8043ca4 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 22:22:51 -0500 Subject: [PATCH 105/190] updated sonar server name --- Jenkinsfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 85c1986e55..49b980b846 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -107,13 +107,14 @@ pipeline { sh """ testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war - sudo ssh root@$testserver -o StrictHostKeyChecking=no " + echo testserver + #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/#tomcat8/webapps/QAWebapp.war + #sudo ssh root@$testserver -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git #cd DevOps-Demo-WebApp #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war - systemctl restart tomcat8 - sleep 10s + # systemctl restart tomcat8 + #sleep 10s " """ } From 63e90fc88e67c357ed5905fa0f97647fcab72a1b Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 22:26:43 -0500 Subject: [PATCH 106/190] updated sonar server name --- Jenkinsfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 49b980b846..e8873796fe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,15 +106,14 @@ pipeline { // server.download spec: downloadSpec sh """ - testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - echo testserver - #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/#tomcat8/webapps/QAWebapp.war - #sudo ssh root@$testserver -o StrictHostKeyChecking=no " + #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` + sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@3.17.134.255:/var/lib/tomcat8/webapps/QAWebapp.war + sudo ssh root@3.17.134.255 -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git #cd DevOps-Demo-WebApp #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war - # systemctl restart tomcat8 - #sleep 10s + systemctl restart tomcat8 + sleep 10s " """ } From e1bc286464bb75d58bf73e86b2204bb60661655a Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 22:27:23 -0500 Subject: [PATCH 107/190] updated sonar server name --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e8873796fe..6e4b95e1d4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,7 +106,6 @@ pipeline { // server.download spec: downloadSpec sh """ - #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@3.17.134.255:/var/lib/tomcat8/webapps/QAWebapp.war sudo ssh root@3.17.134.255 -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git From 2a0cbaac78ae2f1c30380ca92cc5b8ee5ac74509 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 22:41:23 -0500 Subject: [PATCH 108/190] updated sonar server name --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6e4b95e1d4..276ba9e291 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -107,13 +107,13 @@ pipeline { sh """ sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@3.17.134.255:/var/lib/tomcat8/webapps/QAWebapp.war - sudo ssh root@3.17.134.255 -o StrictHostKeyChecking=no " + #sudo ssh root@3.17.134.255 -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git #cd DevOps-Demo-WebApp #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war - systemctl restart tomcat8 - sleep 10s - " + #systemctl restart tomcat8 + #sleep 10s + #" """ } } From 42b21f6b14cbdede9d488b2aa29e57f504fd64db Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 22:50:20 -0500 Subject: [PATCH 109/190] updated sonar server name --- Jenkinsfile | 177 ++++++++++++++++++++++++++-------------------------- 1 file changed, 89 insertions(+), 88 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 276ba9e291..4039f59fa0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,29 +4,29 @@ def rtMaven pipeline { agent any stages { - stage('Sonar Qube Analysis') { - steps { - withSonarQubeEnv('sonarqube-server') { - sh ''' - echo "PATH = ${PATH}" - echo "M2_HOME = ${M2_HOME}" - mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - ''' - } + // stage('Sonar Qube Analysis') { + // steps { + // withSonarQubeEnv('sonarqube-server') { + // sh ''' + // echo "PATH = ${PATH}" + // echo "M2_HOME = ${M2_HOME}" + // mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + // ''' + // } - } - } + // } + // } - stage('Build the project') { - steps { - script { - sh ''' - mvn -B -f pom.xml compile - ''' - } + // stage('Build the project') { + // steps { + // script { + // sh ''' + // mvn -B -f pom.xml compile + // ''' + // } - } - } + // } + // } stage('Configure Test Server') { steps { @@ -36,6 +36,7 @@ pipeline { #gcloud config set compute/zone us-central1-a #testserver=`gcloud compute instances describe prod-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` + echo $testserver sed -i "s/squadtestserver/$testserver/g" $(find . -type f) #sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml ''' @@ -59,77 +60,77 @@ pipeline { // } // } // } - stage('Store Artifacts') { - steps { - script { - server = Artifactory.server 'artifactory' - // rtMaven = Artifactory.newMavenBuild() - // rtMaven.tool = 'Maven3.6.3' // Tool name from Jenkins configuration - // rtMaven.deployer releaseRepo: 'squad5-libs-release-local', snapshotRepo: 'squad5-libs-snapshot-local', server: server - // rtMaven.resolver releaseRepo: 'squad5-libs-release', snapshotRepo: 'squad5-libs-snapshot', server: server - // rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run - // buildInfo = Artifactory.newBuildInfo() - // rtMaven.run pom: 'pom.xml', goals: 'clean test' - // rtMaven.run pom: 'pom.xml', goals: 'install', buildInfo: buildInfo - // rtMaven.deployer.deployArtifacts buildInfo - //def uploadSpec = readFile 'target/ - //server.publishBuildInfo buildInfo - sh """ mvn package -Dmaven.test.skip=true """ - def uploadSpec = """{ - "files": [ - { - "pattern": "target/*.war", - "target": "squad5-libs-release-local" - }, - { - "pattern": "target/*.war", - "target": "squad5-libs-snapshot-local" - } - ] - }""" - server.upload spec: uploadSpec + // stage('Store Artifacts') { + // steps { + // script { + // server = Artifactory.server 'artifactory' + // // rtMaven = Artifactory.newMavenBuild() + // // rtMaven.tool = 'Maven3.6.3' // Tool name from Jenkins configuration + // // rtMaven.deployer releaseRepo: 'squad5-libs-release-local', snapshotRepo: 'squad5-libs-snapshot-local', server: server + // // rtMaven.resolver releaseRepo: 'squad5-libs-release', snapshotRepo: 'squad5-libs-snapshot', server: server + // // rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run + // // buildInfo = Artifactory.newBuildInfo() + // // rtMaven.run pom: 'pom.xml', goals: 'clean test' + // // rtMaven.run pom: 'pom.xml', goals: 'install', buildInfo: buildInfo + // // rtMaven.deployer.deployArtifacts buildInfo + // //def uploadSpec = readFile 'target/ + // //server.publishBuildInfo buildInfo + // sh """ mvn package -Dmaven.test.skip=true """ + // def uploadSpec = """{ + // "files": [ + // { + // "pattern": "target/*.war", + // "target": "squad5-libs-release-local" + // }, + // { + // "pattern": "target/*.war", + // "target": "squad5-libs-snapshot-local" + // } + // ] + // }""" + // server.upload spec: uploadSpec - } - } - } - stage('Deploy War on Test server') { - steps { - // script { - // def downloadSpec = """{ - // "files": [ - // { - // "pattern": "target/*.war", - // "target": "squad5-libs-release-local" - // } - // ] - // }""" - // server.download spec: downloadSpec + // } + // } + // } + // stage('Deploy War on Test server') { + // steps { + // // script { + // // def downloadSpec = """{ + // // "files": [ + // // { + // // "pattern": "target/*.war", + // // "target": "squad5-libs-release-local" + // // } + // // ] + // // }""" + // // server.download spec: downloadSpec - sh """ - sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@3.17.134.255:/var/lib/tomcat8/webapps/QAWebapp.war - #sudo ssh root@3.17.134.255 -o StrictHostKeyChecking=no " - #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git - #cd DevOps-Demo-WebApp - #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war - #systemctl restart tomcat8 - #sleep 10s - #" - """ - } - } + // sh """ + // sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@3.17.134.255:/var/lib/tomcat8/webapps/QAWebapp.war + // #sudo ssh root@3.17.134.255 -o StrictHostKeyChecking=no " + // #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git + // #cd DevOps-Demo-WebApp + // #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war + // #systemctl restart tomcat8 + // #sleep 10s + // #" + // """ + // } + // } - stage('UI Selenium Tests') { - steps { - slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - script { - sh ''' - mvn -B -f functionaltest/pom.xml test - ''' - } - // publish html - publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) - } - } + // stage('UI Selenium Tests') { + // steps { + // slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + // script { + // sh ''' + // mvn -B -f functionaltest/pom.xml test + // ''' + // } + // // publish html + // publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) + // } + // } // stage('Performance test'){ // steps { From 76ab1789b371ab42b535e15bb6becdc3b59fda16 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 22:56:34 -0500 Subject: [PATCH 110/190] updated sonar server name --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 4039f59fa0..e22802b869 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,6 +28,17 @@ pipeline { // } // } + stage('Build the project') { + steps { + script { + sh ''' + mvn package -Dmaven.test.skip=true + ''' + } + + } + } + stage('Configure Test Server') { steps { script { From 14091f8153f05ac9c944b0ed03913e82fd83ff13 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 22:59:28 -0500 Subject: [PATCH 111/190] updated sonar server name --- Jenkinsfile | 72 ++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e22802b869..4be5e1455d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -104,44 +104,44 @@ pipeline { // } // } // } - // stage('Deploy War on Test server') { - // steps { - // // script { - // // def downloadSpec = """{ - // // "files": [ - // // { - // // "pattern": "target/*.war", - // // "target": "squad5-libs-release-local" - // // } - // // ] - // // }""" - // // server.download spec: downloadSpec + stage('Deploy War on Test server') { + steps { + // script { + // def downloadSpec = """{ + // "files": [ + // { + // "pattern": "target/*.war", + // "target": "squad5-libs-release-local" + // } + // ] + // }""" + // server.download spec: downloadSpec - // sh """ - // sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@3.17.134.255:/var/lib/tomcat8/webapps/QAWebapp.war - // #sudo ssh root@3.17.134.255 -o StrictHostKeyChecking=no " - // #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git - // #cd DevOps-Demo-WebApp - // #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war - // #systemctl restart tomcat8 - // #sleep 10s - // #" - // """ - // } - // } + sh """ + sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@3.17.134.255:/var/lib/tomcat8/webapps/QAWebapp.war + #sudo ssh root@3.17.134.255 -o StrictHostKeyChecking=no " + #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git + #cd DevOps-Demo-WebApp + #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war + #systemctl restart tomcat8 + #sleep 10s + #" + """ + } + } - // stage('UI Selenium Tests') { - // steps { - // slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - // script { - // sh ''' - // mvn -B -f functionaltest/pom.xml test - // ''' - // } - // // publish html - // publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) - // } - // } + stage('UI Selenium Tests') { + steps { + slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + mvn -B -f functionaltest/pom.xml test + ''' + } + // publish html + publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) + } + } // stage('Performance test'){ // steps { From febba34aaae65c1e2122ccc7606100cc77a1a915 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 23:12:19 -0500 Subject: [PATCH 112/190] updated sonar server name --- Jenkinsfile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4be5e1455d..a05d597c0d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,17 +28,6 @@ pipeline { // } // } - stage('Build the project') { - steps { - script { - sh ''' - mvn package -Dmaven.test.skip=true - ''' - } - - } - } - stage('Configure Test Server') { steps { script { @@ -56,6 +45,17 @@ pipeline { } } + stage('Build the project') { + steps { + script { + sh ''' + mvn package -Dmaven.test.skip=true + ''' + } + + } + } + // stage('Deploy War on Test server') { // steps { // script { @@ -132,7 +132,8 @@ pipeline { stage('UI Selenium Tests') { steps { - slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + slackSend channel: 'notify', message: "UI Testing started for JOB and build : $ + {env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' mvn -B -f functionaltest/pom.xml test From 0c1f1ca68d45ebe10a359c2543facf7e38e00289 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 23:14:48 -0500 Subject: [PATCH 113/190] updated sonar server name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a05d597c0d..0301ae00ad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { } } - stage('Build the project') { + stage('Build the project') { steps { script { sh ''' From 3f4042b423421b7eaf203534a042046dbc14beed Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 23:15:58 -0500 Subject: [PATCH 114/190] updated sonar server name --- Jenkinsfile | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0301ae00ad..60b5403abb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,17 +45,6 @@ pipeline { } } - stage('Build the project') { - steps { - script { - sh ''' - mvn package -Dmaven.test.skip=true - ''' - } - - } - } - // stage('Deploy War on Test server') { // steps { // script { From 4b74220f8992041b2fd487ca470756a3afbefa9f Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 23:17:02 -0500 Subject: [PATCH 115/190] updated sonar server name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 60b5403abb..f882dfeccb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,7 +44,7 @@ pipeline { } } - + // stage('Deploy War on Test server') { // steps { // script { From fdb160e7fba89dbb2736156b7e28daeb4bd479d6 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sat, 6 Mar 2021 23:18:43 -0500 Subject: [PATCH 116/190] update the package code --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index f882dfeccb..1401bdc05f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,6 +45,16 @@ pipeline { } } + stage('Build the project') { + steps { + script { + sh ''' + mvn -B -f pom.xml compile + ''' + } + + } + } // stage('Deploy War on Test server') { // steps { // script { From b1631e9c192a224a2aa194f8141556eae5b5eef2 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 23:21:22 -0500 Subject: [PATCH 117/190] updated sonar server name --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1401bdc05f..e3743f6760 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -131,8 +131,7 @@ pipeline { stage('UI Selenium Tests') { steps { - slackSend channel: 'notify', message: "UI Testing started for JOB and build : $ - {env.JOB_NAME} ${env.BUILD_NUMBER}" + slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' mvn -B -f functionaltest/pom.xml test From 90bc22039a1f799966076d13b59166cb11337dca Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sat, 6 Mar 2021 23:23:15 -0500 Subject: [PATCH 118/190] updated sonar server name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e3743f6760..352c62ba45 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,7 +49,7 @@ pipeline { steps { script { sh ''' - mvn -B -f pom.xml compile + mvn package -Dmaven.test.skip=true ''' } From de3f36cb1c61100f7a33af81c4a246b4399ddfa5 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Sun, 7 Mar 2021 10:36:35 -0500 Subject: [PATCH 119/190] Update Jenkinsfile IP Address Changed, Slack notifications added, Jira steps added --- Jenkinsfile | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 352c62ba45..e5b0c9a38d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,7 @@ pipeline { stages { // stage('Sonar Qube Analysis') { // steps { + // slackSend channel: 'notify', message: "Sonar Qube Analysis started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // withSonarQubeEnv('sonarqube-server') { // sh ''' // echo "PATH = ${PATH}" @@ -19,17 +20,23 @@ pipeline { // stage('Build the project') { // steps { + // slackSend channel: 'notify', message: "Build the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // script { // sh ''' // mvn -B -f pom.xml compile // ''' // } - // } + // post { + // always { + // jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] + // } + // } // } stage('Configure Test Server') { steps { + slackSend channel: 'notify', message: "Configure Test Server started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' #gcloud auth activate-service-account --key-file=/var/lib/jenkins/workspace/gcloud_auth @@ -45,8 +52,9 @@ pipeline { } } - stage('Build the project') { + stage('Compile the project') { steps { + slackSend channel: 'notify', message: "Compile the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' mvn package -Dmaven.test.skip=true @@ -115,10 +123,10 @@ pipeline { // ] // }""" // server.download spec: downloadSpec - + slackSend channel: 'notify', message: "Deploy War on Test server started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" sh """ - sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@3.17.134.255:/var/lib/tomcat8/webapps/QAWebapp.war - #sudo ssh root@3.17.134.255 -o StrictHostKeyChecking=no " + sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@18.222.101.244:/var/lib/tomcat8/webapps/QAWebapp.war + #sudo ssh root@18.222.101.244 -o StrictHostKeyChecking=no " #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git #cd DevOps-Demo-WebApp #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war @@ -127,6 +135,11 @@ pipeline { #" """ } + post { + always { + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] + } + } } stage('UI Selenium Tests') { From 0d0f2c686335c37b1504236ec5dcc791684f8b82 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 11:37:07 -0500 Subject: [PATCH 120/190] Added deploywar stage --- Jenkinsfile | 82 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 31 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e5b0c9a38d..78eea41209 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,7 +52,7 @@ pipeline { } } - stage('Compile the project') { + stage('Build the project') { steps { slackSend channel: 'notify', message: "Compile the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { @@ -63,6 +63,26 @@ pipeline { } } + + stage('Deploy War on Test Server') { + steps { + slackSend channel: 'notify', message: "Compile the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh """ + testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` + sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@${testserver}:/opt/tomcat/webapps/QAWebapp.war + + """ + } + post { + always { + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] + } + } + + } + } + // stage('Deploy War on Test server') { // steps { // script { @@ -111,36 +131,36 @@ pipeline { // } // } // } - stage('Deploy War on Test server') { - steps { - // script { - // def downloadSpec = """{ - // "files": [ - // { - // "pattern": "target/*.war", - // "target": "squad5-libs-release-local" - // } - // ] - // }""" - // server.download spec: downloadSpec - slackSend channel: 'notify', message: "Deploy War on Test server started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - sh """ - sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@18.222.101.244:/var/lib/tomcat8/webapps/QAWebapp.war - #sudo ssh root@18.222.101.244 -o StrictHostKeyChecking=no " - #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git - #cd DevOps-Demo-WebApp - #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war - #systemctl restart tomcat8 - #sleep 10s - #" - """ - } - post { - always { - jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] - } - } - } + // stage('Deploy War on Test server') { + // steps { + // // script { + // // def downloadSpec = """{ + // // "files": [ + // // { + // // "pattern": "target/*.war", + // // "target": "squad5-libs-release-local" + // // } + // // ] + // // }""" + // // server.download spec: downloadSpec + // slackSend channel: 'notify', message: "Deploy War on Test server started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + // sh """ + // sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@18.222.101.244:/var/lib/tomcat8/webapps/QAWebapp.war + // #sudo ssh root@18.222.101.244 -o StrictHostKeyChecking=no " + // #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git + // #cd DevOps-Demo-WebApp + // #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war + // #systemctl restart tomcat8 + // #sleep 10s + // #" + // """ + // } + // post { + // always { + // jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] + // } + // } + // } stage('UI Selenium Tests') { steps { From 09e7b1c9c5a8dee3161cdd2eb46f4fefa4156cac Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 11:42:56 -0500 Subject: [PATCH 121/190] Added deploywar stage --- Jenkinsfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 78eea41209..3f7ccb3935 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,17 +70,17 @@ pipeline { script { sh """ testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@${testserver}:/opt/tomcat/webapps/QAWebapp.war + sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/opt/tomcat/webapps/QAWebapp.war """ } - post { - always { - jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] - } - } + // post { + // always { + // jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] + // } + // } - } + // } } // stage('Deploy War on Test server') { From f975756dda0a2e7538a6ab4f6fcc1aff0926d7c3 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 11:45:03 -0500 Subject: [PATCH 122/190] Added deploywar stage --- Jenkinsfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3f7ccb3935..bfa531d253 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -68,19 +68,19 @@ pipeline { steps { slackSend channel: 'notify', message: "Compile the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { - sh """ + sh ''' testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/opt/tomcat/webapps/QAWebapp.war - """ + ''' } - // post { - // always { - // jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] - // } - // } + post { + always { + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] + } + } - // } + } } // stage('Deploy War on Test server') { From e51d37cb79e0ee6f2d8874c15009964befca967e Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 11:47:35 -0500 Subject: [PATCH 123/190] Added deploywar stage --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bfa531d253..135b9e3169 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,13 +74,13 @@ pipeline { ''' } - post { - always { - jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] - } - } + // post { + // always { + // jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] + // } + // } - } + // } } // stage('Deploy War on Test server') { From 1aa421e7e84e8edbd0e6545097501255f19f45e6 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 11:48:08 -0500 Subject: [PATCH 124/190] Added deploywar stage --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 135b9e3169..19b90815c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -80,7 +80,7 @@ pipeline { // } // } - // } + } } // stage('Deploy War on Test server') { From a7409bb7b38c22ffbbf7865717e73f56118f5bb6 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sun, 7 Mar 2021 12:40:32 -0500 Subject: [PATCH 125/190] Running e2E test --- Jenkinsfile | 163 ++++++++++++++++------------------------------------ 1 file changed, 49 insertions(+), 114 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 19b90815c5..2516a0457d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,44 +4,36 @@ def rtMaven pipeline { agent any stages { - // stage('Sonar Qube Analysis') { - // steps { - // slackSend channel: 'notify', message: "Sonar Qube Analysis started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - // withSonarQubeEnv('sonarqube-server') { - // sh ''' - // echo "PATH = ${PATH}" - // echo "M2_HOME = ${M2_HOME}" - // mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - // ''' - // } + stage('Sonar Qube Analysis') { + steps { + slackSend channel: 'notify', message: "Sonar Qube Analysis started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + withSonarQubeEnv('sonarqube-server') { + sh ''' + echo "PATH = ${PATH}" + echo "M2_HOME = ${M2_HOME}" + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + ''' + } - // } - // } + } + } - // stage('Build the project') { - // steps { - // slackSend channel: 'notify', message: "Build the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - // script { - // sh ''' - // mvn -B -f pom.xml compile - // ''' - // } - // } - // post { - // always { - // jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] - // } - // } - // } + stage('Build the project') { + steps { + slackSend channel: 'notify', message: "Build the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + mvn -B -f pom.xml compile + ''' + } + } + } stage('Configure Test Server') { steps { slackSend channel: 'notify', message: "Configure Test Server started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' - #gcloud auth activate-service-account --key-file=/var/lib/jenkins/workspace/gcloud_auth - #gcloud config set compute/zone us-central1-a - #testserver=`gcloud compute instances describe prod-server --format='get(networkInterfaces[0].accessConfigs[0].natIP)'` testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` echo $testserver sed -i "s/squadtestserver/$testserver/g" $(find . -type f) @@ -70,97 +62,35 @@ pipeline { script { sh ''' testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/opt/tomcat/webapps/QAWebapp.war + sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war ''' } - // post { - // always { - // jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] - // } - // } - } } + stage('Store Artifacts') { + steps { + script { + server = Artifactory.server 'artifactory' + sh """ mvn package -Dmaven.test.skip=true """ + def uploadSpec = """{ + "files": [ + { + "pattern": "target/*.war", + "target": "squad5-libs-release-local" + }, + { + "pattern": "target/*.war", + "target": "squad5-libs-snapshot-local" + } + ] + }""" + server.upload spec: uploadSpec - // stage('Deploy War on Test server') { - // steps { - // script { - // sh """ - // sudo ssh root@test-server -o StrictHostKeyChecking=no ' - // git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git - // cd DevOps-Demo-WebApp - // mvn package -Dmaven.test.skip=true - // cp "target/AVNCommunication-1.0.war" /var/lib/tomcat8/webapps/ - // systemctl restart tomcat8 - // ' - // """ - // } - // } - // } - // stage('Store Artifacts') { - // steps { - // script { - // server = Artifactory.server 'artifactory' - // // rtMaven = Artifactory.newMavenBuild() - // // rtMaven.tool = 'Maven3.6.3' // Tool name from Jenkins configuration - // // rtMaven.deployer releaseRepo: 'squad5-libs-release-local', snapshotRepo: 'squad5-libs-snapshot-local', server: server - // // rtMaven.resolver releaseRepo: 'squad5-libs-release', snapshotRepo: 'squad5-libs-snapshot', server: server - // // rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run - // // buildInfo = Artifactory.newBuildInfo() - // // rtMaven.run pom: 'pom.xml', goals: 'clean test' - // // rtMaven.run pom: 'pom.xml', goals: 'install', buildInfo: buildInfo - // // rtMaven.deployer.deployArtifacts buildInfo - // //def uploadSpec = readFile 'target/ - // //server.publishBuildInfo buildInfo - // sh """ mvn package -Dmaven.test.skip=true """ - // def uploadSpec = """{ - // "files": [ - // { - // "pattern": "target/*.war", - // "target": "squad5-libs-release-local" - // }, - // { - // "pattern": "target/*.war", - // "target": "squad5-libs-snapshot-local" - // } - // ] - // }""" - // server.upload spec: uploadSpec + } + } + } - // } - // } - // } - // stage('Deploy War on Test server') { - // steps { - // // script { - // // def downloadSpec = """{ - // // "files": [ - // // { - // // "pattern": "target/*.war", - // // "target": "squad5-libs-release-local" - // // } - // // ] - // // }""" - // // server.download spec: downloadSpec - // slackSend channel: 'notify', message: "Deploy War on Test server started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - // sh """ - // sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@18.222.101.244:/var/lib/tomcat8/webapps/QAWebapp.war - // #sudo ssh root@18.222.101.244 -o StrictHostKeyChecking=no " - // #git clone https://github.com/devopsbcsquad5/DevOps-Demo-WebApp.git - // #cd DevOps-Demo-WebApp - // #curl -u deploy:'AKCp8ihLPHza9DUHyWNyeq9YND2aZCq91nFTUUiKuYCFomp27gU1GcG4HhqaUZitEiKp7xgrt' https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war -o /var/lib/tomcat8/webapps/AVNCommunication-1.0.war - // #systemctl restart tomcat8 - // #sleep 10s - // #" - // """ - // } - // post { - // always { - // jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'Test', environmentType: 'testing', issueKeys: ['DP-2'] - // } - // } - // } stage('UI Selenium Tests') { steps { @@ -173,6 +103,11 @@ pipeline { // publish html publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) } + post { + always { + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testserver', environmentType: 'testing', issueKeys: ['DP-2'] + } + } } // stage('Performance test'){ From 4d4ae3d30fea8479c0d82a89ecc17b321ce73c5f Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sun, 7 Mar 2021 12:42:09 -0500 Subject: [PATCH 126/190] Running e2E test --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2516a0457d..f123b6ae55 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,9 +44,9 @@ pipeline { } } - stage('Build the project') { + stage('Package the project') { steps { - slackSend channel: 'notify', message: "Compile the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + slackSend channel: 'notify', message: "Package the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' mvn package -Dmaven.test.skip=true From b270e761d439c46b656b709bea249b873e16526a Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sun, 7 Mar 2021 13:02:08 -0500 Subject: [PATCH 127/190] Running e2E test --- dwnldArtifact.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 dwnldArtifact.yml diff --git a/dwnldArtifact.yml b/dwnldArtifact.yml new file mode 100644 index 0000000000..94194f2e5b --- /dev/null +++ b/dwnldArtifact.yml @@ -0,0 +1,10 @@ +--- +- hosts: test-server + tasks: + - name: Download artifact test + become: true + get_url: + url: https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war + dest: /tmp + url_username: devopsbc.squad5.jfrog@gmail.com + url_password: AP6VPuxua2CQhM633iiB9Qnd8Ue \ No newline at end of file From 27ba5fa5b2eeb3a49b3f457441966cc12fa12e40 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sun, 7 Mar 2021 13:05:46 -0500 Subject: [PATCH 128/190] Running e2E test --- dwnldArtifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwnldArtifact.yml b/dwnldArtifact.yml index 94194f2e5b..eef9c81394 100644 --- a/dwnldArtifact.yml +++ b/dwnldArtifact.yml @@ -5,6 +5,6 @@ become: true get_url: url: https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war - dest: /tmp + dest: /tmp/QAWebapp.war url_username: devopsbc.squad5.jfrog@gmail.com url_password: AP6VPuxua2CQhM633iiB9Qnd8Ue \ No newline at end of file From d622608dc3a7fdec49c6a1c48fffbb7271000216 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sun, 7 Mar 2021 13:09:14 -0500 Subject: [PATCH 129/190] Running e2E test --- Jenkinsfile | 5 +++-- dwnldArtifact.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f123b6ae55..c6db960773 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,8 +61,9 @@ pipeline { slackSend channel: 'notify', message: "Compile the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' - testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war + #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` + #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war + ansible-playbook dwnldArtifact.yml ''' } diff --git a/dwnldArtifact.yml b/dwnldArtifact.yml index eef9c81394..f6afe3d952 100644 --- a/dwnldArtifact.yml +++ b/dwnldArtifact.yml @@ -5,6 +5,6 @@ become: true get_url: url: https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war - dest: /tmp/QAWebapp.war + dest: /var/lib/tomcat8/webapps/QAWebapp.war url_username: devopsbc.squad5.jfrog@gmail.com url_password: AP6VPuxua2CQhM633iiB9Qnd8Ue \ No newline at end of file From b557fe34170a2cb3064c4b08f15d237a67544128 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sun, 7 Mar 2021 13:11:32 -0500 Subject: [PATCH 130/190] Running e2E test --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c6db960773..e49b0bca0a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -63,7 +63,7 @@ pipeline { sh ''' #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war - ansible-playbook dwnldArtifact.yml + sudo ansible-playbook dwnldArtifact.yml ''' } From b703e5b1d44c05d62d1d42912752db98d2cbbec8 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sun, 7 Mar 2021 13:11:53 -0500 Subject: [PATCH 131/190] Running e2E test --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e49b0bca0a..d7f40a310a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -63,7 +63,8 @@ pipeline { sh ''' #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war - sudo ansible-playbook dwnldArtifact.yml + sudo su - + ansible-playbook dwnldArtifact.yml ''' } From d10195b6faf0c53740a06de6f136735e10be1355 Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sun, 7 Mar 2021 13:19:40 -0500 Subject: [PATCH 132/190] Running e2E test --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index d7f40a310a..3d707892b3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -63,6 +63,7 @@ pipeline { sh ''' #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war + config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" sudo su - ansible-playbook dwnldArtifact.yml From d2be77a138165dbc3f300d15c98ef05ab013b36f Mon Sep 17 00:00:00 2001 From: devopsbcsquad5 Date: Sun, 7 Mar 2021 13:23:28 -0500 Subject: [PATCH 133/190] Running e2E test --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3d707892b3..5bd39e01ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -63,9 +63,9 @@ pipeline { sh ''' #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war - config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" + #config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" sudo su - - ansible-playbook dwnldArtifact.yml + sudo ansible-playbook dwnldArtifact.yml ''' } From 68c1b8dab7cf44f56e04e50237e197d832a6c972 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 13:27:15 -0500 Subject: [PATCH 134/190] Added deploywar stage --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5bd39e01ab..61b703bab0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -64,7 +64,6 @@ pipeline { #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war #config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" - sudo su - sudo ansible-playbook dwnldArtifact.yml ''' From 2bdfa9d4f63c608e8076ac66f7ee6b39ee1dcb92 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 13:38:56 -0500 Subject: [PATCH 135/190] Added deploywar stage --- Jenkinsfile | 17 ++++++++++++++++- dwnldArtifact.yml | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 61b703bab0..0910b98907 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -64,7 +64,7 @@ pipeline { #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war #config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" - sudo ansible-playbook dwnldArtifact.yml + sudo ansible-playbook -e "deployservers=test-server" dwnldArtifact.yml ''' } @@ -112,6 +112,21 @@ pipeline { } } + stage('Deploy War on Prod Server') { + steps { + slackSend channel: 'notify', message: "Compile the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` + #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war + #config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" + sudo ansible-playbook -e "deployservers=prod-server" dwnldArtifact.yml + + ''' + } + } + } + // stage('Performance test'){ // steps { // slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" diff --git a/dwnldArtifact.yml b/dwnldArtifact.yml index f6afe3d952..4ef9f302c3 100644 --- a/dwnldArtifact.yml +++ b/dwnldArtifact.yml @@ -1,5 +1,5 @@ --- -- hosts: test-server +- hosts: {{ deployservers }} tasks: - name: Download artifact test become: true From deeba26bc31e3c55c0a1cca375f8252db30de202 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 13:55:37 -0500 Subject: [PATCH 136/190] Added deploywar stage --- Jenkinsfile | 10 +++++----- dwnldArtifact.yml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0910b98907..80b6b551d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,8 +35,10 @@ pipeline { script { sh ''' testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` + prodserver=`grep prod-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` echo $testserver sed -i "s/squadtestserver/$testserver/g" $(find . -type f) + sed -i "s/squadprodserver/$prodserver/g" $(find . -type f) #sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml ''' } @@ -64,7 +66,7 @@ pipeline { #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war #config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" - sudo ansible-playbook -e "deployservers=test-server" dwnldArtifact.yml + sudo ansible-playbook -e 'deployservers="test-server" lcp="QA"' dwnldArtifact.yml ''' } @@ -117,10 +119,8 @@ pipeline { slackSend channel: 'notify', message: "Compile the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' - #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war - #config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" - sudo ansible-playbook -e "deployservers=prod-server" dwnldArtifact.yml + + sudo ansible-playbook -e 'deployservers="prod-server" lcp="Prod"' dwnldArtifact.yml ''' } diff --git a/dwnldArtifact.yml b/dwnldArtifact.yml index 4ef9f302c3..b0525a7ba6 100644 --- a/dwnldArtifact.yml +++ b/dwnldArtifact.yml @@ -1,10 +1,10 @@ --- -- hosts: {{ deployservers }} +- hosts: "{{ deployservers }}" tasks: - name: Download artifact test become: true get_url: url: https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war - dest: /var/lib/tomcat8/webapps/QAWebapp.war + dest: /var/lib/tomcat8/webapps/{{lcp}}Webapp.war url_username: devopsbc.squad5.jfrog@gmail.com url_password: AP6VPuxua2CQhM633iiB9Qnd8Ue \ No newline at end of file From 2c591481079198c2874804b4a57859e1d5e7efbb Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 14:48:18 -0500 Subject: [PATCH 137/190] Added deploywar stage --- Jenkinsfile | 68 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 80b6b551d2..923d7cbcd9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,9 +4,9 @@ def rtMaven pipeline { agent any stages { - stage('Sonar Qube Analysis') { + stage('Static Code Analysis') { steps { - slackSend channel: 'notify', message: "Sonar Qube Analysis started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + slackSend channel: 'notify', message: "Static Code Analysis started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" withSonarQubeEnv('sonarqube-server') { sh ''' echo "PATH = ${PATH}" @@ -20,7 +20,7 @@ pipeline { stage('Build the project') { steps { - slackSend channel: 'notify', message: "Build the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + slackSend channel: 'notify', message: "Build the project started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' mvn -B -f pom.xml compile @@ -29,9 +29,9 @@ pipeline { } } - stage('Configure Test Server') { + stage('Configure Test & Prod Server') { steps { - slackSend channel: 'notify', message: "Configure Test Server started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + slackSend channel: 'notify', message: "Configure Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` @@ -39,7 +39,6 @@ pipeline { echo $testserver sed -i "s/squadtestserver/$testserver/g" $(find . -type f) sed -i "s/squadprodserver/$prodserver/g" $(find . -type f) - #sudo ansible-playbook -e "myhostserver=test-server" TestServerCreation.yml ''' } @@ -48,24 +47,20 @@ pipeline { stage('Package the project') { steps { - slackSend channel: 'notify', message: "Package the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + slackSend channel: 'notify', message: "Package the project started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' mvn package -Dmaven.test.skip=true ''' } - } } - stage('Deploy War on Test Server') { + stage('Deploy on Test Server') { steps { - slackSend channel: 'notify', message: "Compile the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + slackSend channel: 'notify', message: "Deployment of War on Test Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' - #testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - #sudo scp -o StrictHostKeyChecking=no "target/AVNCommunication-1.0.war" root@$testserver:/var/lib/tomcat8/webapps/QAWebapp.war - #config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" sudo ansible-playbook -e 'deployservers="test-server" lcp="QA"' dwnldArtifact.yml ''' @@ -74,6 +69,7 @@ pipeline { } stage('Store Artifacts') { steps { + slackSend channel: 'notify', message: "Upload artifacts started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { server = Artifactory.server 'artifactory' sh """ mvn package -Dmaven.test.skip=true """ @@ -96,9 +92,9 @@ pipeline { } - stage('UI Selenium Tests') { + stage('UI Testing on Test Server') { steps { - slackSend channel: 'notify', message: "UI Testing started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + slackSend channel: 'notify', message: "UI Testing started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' mvn -B -f functionaltest/pom.xml test @@ -112,30 +108,44 @@ pipeline { jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testserver', environmentType: 'testing', issueKeys: ['DP-2'] } } - } + } + + // stage('Performance test'){ + // steps { + // slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' + // } + // } - stage('Deploy War on Prod Server') { + stage('Deploy on Prod Server') { steps { - slackSend channel: 'notify', message: "Compile the project started for JOB and build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + slackSend channel: 'notify', message: "Deployment of War on Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { sh ''' - sudo ansible-playbook -e 'deployservers="prod-server" lcp="Prod"' dwnldArtifact.yml - ''' } } } - // stage('Performance test'){ - // steps { - // slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - // } - // } - - - + + stage('Sanity Tests') { + steps { + slackSend channel: 'notify', message: "Sanity Testing on Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + mvn -B -f Acceptancetest/pom.xml test + ''' + } + // publish html + publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\Acceptancetest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) + } + post { + always { + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testserver', environmentType: 'testing', issueKeys: ['DP-2'] + } + } + } } tools { From 1dd7f8ce0a5a39188c2e32a7a2266c34a420fd64 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 14:59:12 -0500 Subject: [PATCH 138/190] Testing jira --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 923d7cbcd9..da7ab73317 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,7 +91,6 @@ pipeline { } } - stage('UI Testing on Test Server') { steps { slackSend channel: 'notify', message: "UI Testing started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" From 136901214cec124855ee6f2044850357e76485f5 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 15:02:48 -0500 Subject: [PATCH 139/190] Testing jira --- Jenkinsfile | 3 +-- README.md | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index da7ab73317..fef68c8436 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -126,8 +126,7 @@ pipeline { } } } - - + stage('Sanity Tests') { steps { slackSend channel: 'notify', message: "Sanity Testing on Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" diff --git a/README.md b/README.md index c826b3c1a6..be153bd86b 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ my intial commit 01/26 testing polling SCM - testing JIRA polling +NEw commit for Dp-4 + From 3cf81834c2da556030980ca742fce7d28d118a1b Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Sun, 7 Mar 2021 15:14:35 -0500 Subject: [PATCH 140/190] Testing jira for dp-4 second time --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index be153bd86b..f2e66473dc 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,5 @@ testing JIRA polling NEw commit for Dp-4 +NEw commit for Dp-4 second time + From 929b128e38c7c67199b937246448853575701290 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 02:23:18 -0500 Subject: [PATCH 141/190] Added the docker stage --- Jenkinsfile | 69 ++++++++++++++++++++++++++++++----------------- dwnldArtifact.yml | 2 +- 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fef68c8436..e1d63a1cd5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,31 +4,50 @@ def rtMaven pipeline { agent any stages { - stage('Static Code Analysis') { - steps { - slackSend channel: 'notify', message: "Static Code Analysis started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - withSonarQubeEnv('sonarqube-server') { - sh ''' - echo "PATH = ${PATH}" - echo "M2_HOME = ${M2_HOME}" - mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - ''' + stage('Initalize') { + parallel { + stage('Static Code Analysis') { + steps { + slackSend channel: 'notify', message: "Static Code Analysis started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + withSonarQubeEnv('sonarqube-server') { + sh ''' + echo "PATH = ${PATH}" + echo "M2_HOME = ${M2_HOME}" + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + ''' + } + } } - } - } - - stage('Build the project') { - steps { - slackSend channel: 'notify', message: "Build the project started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - script { - sh ''' - mvn -B -f pom.xml compile - ''' + stage('Build the project') { + steps { + slackSend channel: 'notify', message: "Build the project started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + mvn -B -f pom.xml compile + ''' + } + } + } + stage('Startup Test & Prod Server') { + steps { + slackSend channel: 'notify', message: "Initialize Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` + prodserver=`grep prod-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` + for server in $testserver $prodserver + do + sudo ssh -o StrictHostKeyChecking=no root@${server} ' + docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 + docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 + ' + done + ''' + } + } } } - } - stage('Configure Test & Prod Server') { steps { slackSend channel: 'notify', message: "Configure Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" @@ -41,10 +60,9 @@ pipeline { sed -i "s/squadprodserver/$prodserver/g" $(find . -type f) ''' } - } } - + stage('Package the project') { steps { slackSend channel: 'notify', message: "Package the project started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" @@ -55,7 +73,8 @@ pipeline { } } } - + + stage('Deploy on Test Server') { steps { slackSend channel: 'notify', message: "Deployment of War on Test Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" @@ -144,7 +163,7 @@ pipeline { } } } - + } } tools { maven 'Maven3.6.3' diff --git a/dwnldArtifact.yml b/dwnldArtifact.yml index b0525a7ba6..5ad6944c18 100644 --- a/dwnldArtifact.yml +++ b/dwnldArtifact.yml @@ -5,6 +5,6 @@ become: true get_url: url: https://devopssquad5.jfrog.io/artifactory/squad5-libs-release-local/AVNCommunication-1.0.war - dest: /var/lib/tomcat8/webapps/{{lcp}}Webapp.war + dest: /opt/tomcat/webapps/{{lcp}}Webapp.war url_username: devopsbc.squad5.jfrog@gmail.com url_password: AP6VPuxua2CQhM633iiB9Qnd8Ue \ No newline at end of file From 1becc00866cf85d38e2563deb1003d7cd6f7a411 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 02:33:24 -0500 Subject: [PATCH 142/190] Added the docker stage --- Jenkinsfile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e1d63a1cd5..9648163598 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,13 +9,16 @@ pipeline { stage('Static Code Analysis') { steps { slackSend channel: 'notify', message: "Static Code Analysis started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - withSonarQubeEnv('sonarqube-server') { - sh ''' - echo "PATH = ${PATH}" - echo "M2_HOME = ${M2_HOME}" - mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - ''' + script { + withSonarQubeEnv('sonarqube-server') { + sh ''' + echo "PATH = ${PATH}" + echo "M2_HOME = ${M2_HOME}" + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + ''' + } } + } } @@ -48,6 +51,7 @@ pipeline { } } } + } stage('Configure Test & Prod Server') { steps { slackSend channel: 'notify', message: "Configure Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" @@ -163,7 +167,7 @@ pipeline { } } } - } + } tools { maven 'Maven3.6.3' From ef323c87d83bab96dba69eaec706987c464bc003 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 02:36:53 -0500 Subject: [PATCH 143/190] Added the docker stage --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9648163598..099b13c463 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { stage('Static Code Analysis') { steps { slackSend channel: 'notify', message: "Static Code Analysis started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - script { + withSonarQubeEnv('sonarqube-server') { sh ''' echo "PATH = ${PATH}" @@ -17,7 +17,7 @@ pipeline { mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} ''' } - } + } } From 715f311b226609814883f1199ec759ac89f74089 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 03:05:18 -0500 Subject: [PATCH 144/190] Added the docker restart policy --- Jenkinsfile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 099b13c463..ae033347cb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,8 +42,20 @@ pipeline { for server in $testserver $prodserver do sudo ssh -o StrictHostKeyChecking=no root@${server} ' - docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 - docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 + if [[ `docker ps | grep 5432 wc -l` -ne 1 ]] + then + docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 + else + docker container stop `docker ps | grep 5432 | awk '{print $1}'` + docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 + fi + if [[ `docker ps | grep 8080 wc -l` -ne 1 ]] + then + docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 + else + docker container stop `docker ps | grep 8080| awk '{print $1}'` + docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 + fi ' done ''' From 14be6b6b315cdea7a0bf43b476c21043ef3ff9eb Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 03:09:11 -0500 Subject: [PATCH 145/190] Added the docker restart policy --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ae033347cb..7b4421ca23 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,14 +42,14 @@ pipeline { for server in $testserver $prodserver do sudo ssh -o StrictHostKeyChecking=no root@${server} ' - if [[ `docker ps | grep 5432 wc -l` -ne 1 ]] + if [[ `docker ps | grep 5432 | wc -l` -ne 1 ]] then docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 else docker container stop `docker ps | grep 5432 | awk '{print $1}'` docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 fi - if [[ `docker ps | grep 8080 wc -l` -ne 1 ]] + if [[ `docker ps | grep 8080 | wc -l` -ne 1 ]] then docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 else From 39266ce445b90d770819824d8a0343c682dec126 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 03:17:56 -0500 Subject: [PATCH 146/190] Added the docker restart policy --- Jenkinsfile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7b4421ca23..f16ee7f6b4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,18 +42,13 @@ pipeline { for server in $testserver $prodserver do sudo ssh -o StrictHostKeyChecking=no root@${server} ' - if [[ `docker ps | grep 5432 | wc -l` -ne 1 ]] + if [[ `docker ps -q | wc -l` -gt 0 ]] then + docker container stop $(docker ps -q ) docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 - else - docker container stop `docker ps | grep 5432 | awk '{print $1}'` - docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 - fi - if [[ `docker ps | grep 8080 | wc -l` -ne 1 ]] - then docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 else - docker container stop `docker ps | grep 8080| awk '{print $1}'` + docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 fi ' From e3746e19aa324431bc32119c664d0a8cb030a31c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 03:36:54 -0500 Subject: [PATCH 147/190] Added the docker restart policy --- Jenkinsfile | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f16ee7f6b4..3795d2704c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,9 +45,11 @@ pipeline { if [[ `docker ps -q | wc -l` -gt 0 ]] then docker container stop $(docker ps -q ) + rm -fr /opt/tomcat /opt/postgresql docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 else + rm -fr /opt/tomcat /opt/postgresql docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 fi @@ -85,18 +87,6 @@ pipeline { } } - - stage('Deploy on Test Server') { - steps { - slackSend channel: 'notify', message: "Deployment of War on Test Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - script { - sh ''' - sudo ansible-playbook -e 'deployservers="test-server" lcp="QA"' dwnldArtifact.yml - - ''' - } - } - } stage('Store Artifacts') { steps { slackSend channel: 'notify', message: "Upload artifacts started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" @@ -120,6 +110,19 @@ pipeline { } } } + + stage('Deploy on Test Server') { + steps { + slackSend channel: 'notify', message: "Deployment of War on Test Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + sudo ansible-playbook -e 'deployservers="test-server" lcp="QA"' dwnldArtifact.yml + + ''' + } + } + } + stage('UI Testing on Test Server') { steps { From 173a2c9d0150ec3b3f9a044735ab52e6da50d5ad Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 03:56:40 -0500 Subject: [PATCH 148/190] Added the docker restart policy --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3795d2704c..d6b11b0992 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -46,12 +46,13 @@ pipeline { then docker container stop $(docker ps -q ) rm -fr /opt/tomcat /opt/postgresql - docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 + docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 else rm -fr /opt/tomcat /opt/postgresql - docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 + docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 + fi ' done From fe38df28957741f41621f0e8564cc0ab4b823df8 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 13:29:26 -0500 Subject: [PATCH 149/190] Added the docker restart policy --- Jenkinsfile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d6b11b0992..8ca8352495 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,21 +6,21 @@ pipeline { stages { stage('Initalize') { parallel { - stage('Static Code Analysis') { - steps { - slackSend channel: 'notify', message: "Static Code Analysis started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + // stage('Static Code Analysis') { + // steps { + // slackSend channel: 'notify', message: "Static Code Analysis started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - withSonarQubeEnv('sonarqube-server') { - sh ''' - echo "PATH = ${PATH}" - echo "M2_HOME = ${M2_HOME}" - mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - ''' - } + // withSonarQubeEnv('sonarqube-server') { + // sh ''' + // echo "PATH = ${PATH}" + // echo "M2_HOME = ${M2_HOME}" + // mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + // ''' + // } - } - } + // } + // } stage('Build the project') { steps { @@ -46,11 +46,11 @@ pipeline { then docker container stop $(docker ps -q ) rm -fr /opt/tomcat /opt/postgresql - docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 + docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcat:8-jdk8-openjdk-slim docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 else rm -fr /opt/tomcat /opt/postgresql - docker run -v /opt/tomcat/webapps:/opt/tomcat/webapps -v /opt/tomcat/logs:/opt/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcatserversquad5 + docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcat:8-jdk8-openjdk-slim docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 fi From ee5b25e1772a41e0e3e8290d98897e9fe40c640d Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 13:42:36 -0500 Subject: [PATCH 150/190] Added the docker image --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8ca8352495..d8fe63db78 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -46,13 +46,16 @@ pipeline { then docker container stop $(docker ps -q ) rm -fr /opt/tomcat /opt/postgresql + mkdir /opt/tomcat /opt/postgresql docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcat:8-jdk8-openjdk-slim docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 + chown -R 777 /opt/tomcat /opt/postgresql else rm -fr /opt/tomcat /opt/postgresql + mkdir /opt/tomcat /opt/postgresql docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcat:8-jdk8-openjdk-slim docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 - + chown -R 777 /opt/tomcat /opt/postgresql fi ' done From 5f133def686ae5dc764105b2daa4712591076448 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 13:50:52 -0500 Subject: [PATCH 151/190] changed the for condition --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d8fe63db78..54e71a98e9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,9 @@ pipeline { sh ''' testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` prodserver=`grep prod-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - for server in $testserver $prodserver + echo "$testserver" > servers + echo "$prodserver" >> servers + for server in `cat servers` do sudo ssh -o StrictHostKeyChecking=no root@${server} ' if [[ `docker ps -q | wc -l` -gt 0 ]] From e2c4b7d6c884d1d76111643c55fe90391044b9ee Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 13:57:14 -0500 Subject: [PATCH 152/190] changed the for condition --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 54e71a98e9..8ae5f2314e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,13 +49,13 @@ pipeline { docker container stop $(docker ps -q ) rm -fr /opt/tomcat /opt/postgresql mkdir /opt/tomcat /opt/postgresql - docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcat:8-jdk8-openjdk-slim + docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 chown -R 777 /opt/tomcat /opt/postgresql else rm -fr /opt/tomcat /opt/postgresql mkdir /opt/tomcat /opt/postgresql - docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d devopsbcsquad5/tomcat:8-jdk8-openjdk-slim + docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 chown -R 777 /opt/tomcat /opt/postgresql fi From 4be339a343c05b1b6428a6be72087b56a1ad4152 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 13:58:09 -0500 Subject: [PATCH 153/190] changed the for condition --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8ae5f2314e..6d10f0bc6c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,9 +39,7 @@ pipeline { sh ''' testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` prodserver=`grep prod-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - echo "$testserver" > servers - echo "$prodserver" >> servers - for server in `cat servers` + for server in $testserver $prodserver do sudo ssh -o StrictHostKeyChecking=no root@${server} ' if [[ `docker ps -q | wc -l` -gt 0 ]] From 909802c2aff855acbcadb6e413c77b694a123425 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 14:09:12 -0500 Subject: [PATCH 154/190] changed the for condition --- Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6d10f0bc6c..3ac78c6191 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,14 +45,10 @@ pipeline { if [[ `docker ps -q | wc -l` -gt 0 ]] then docker container stop $(docker ps -q ) - rm -fr /opt/tomcat /opt/postgresql - mkdir /opt/tomcat /opt/postgresql docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 chown -R 777 /opt/tomcat /opt/postgresql else - rm -fr /opt/tomcat /opt/postgresql - mkdir /opt/tomcat /opt/postgresql docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 chown -R 777 /opt/tomcat /opt/postgresql From 2ff606b247008e8f3aea7f71f436ce0e7c1ea7ec Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 14:16:13 -0500 Subject: [PATCH 155/190] changed the for condition --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 3ac78c6191..eb6618730a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -71,6 +71,8 @@ pipeline { echo $testserver sed -i "s/squadtestserver/$testserver/g" $(find . -type f) sed -i "s/squadprodserver/$prodserver/g" $(find . -type f) + grep URL functionaltest/src/test/java/functionaltest/ftat.java + grep URL Acceptancetest/src/test/java/acceptancetest/acat.java ''' } } From cad8ba39d224a1e4f00fa6303849dce370acafce Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 14:33:30 -0500 Subject: [PATCH 156/190] changed the for condition --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index eb6618730a..416bfbf5b9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,7 +32,7 @@ pipeline { } } } - stage('Startup Test & Prod Server') { + stage('Initalize Docker on Test & Prod Servers') { steps { slackSend channel: 'notify', message: "Initialize Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { From 2341b8f9356efd1134f4fcfbe6adf9a26224bdaa Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 15:28:24 -0500 Subject: [PATCH 157/190] changed the for condition --- Jenkinsfile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 416bfbf5b9..90599dbe06 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,21 +6,21 @@ pipeline { stages { stage('Initalize') { parallel { - // stage('Static Code Analysis') { - // steps { - // slackSend channel: 'notify', message: "Static Code Analysis started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + stage('Static Code Analysis') { + steps { + slackSend channel: 'notify', message: "Static Code Analysis started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - // withSonarQubeEnv('sonarqube-server') { - // sh ''' - // echo "PATH = ${PATH}" - // echo "M2_HOME = ${M2_HOME}" - // mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} - // ''' - // } + withSonarQubeEnv('sonarqube-server') { + sh ''' + echo "PATH = ${PATH}" + echo "M2_HOME = ${M2_HOME}" + mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} + ''' + } - // } - // } + } + } stage('Build the project') { steps { @@ -157,6 +157,7 @@ pipeline { script { sh ''' sudo ansible-playbook -e 'deployservers="prod-server" lcp="Prod"' dwnldArtifact.yml + sleep 20s ''' } } From 3e6d4b487673a758568927da6ea38747bc4d2dde Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 16:03:31 -0500 Subject: [PATCH 158/190] changed the for condition --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 90599dbe06..ed47bff348 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -119,7 +119,7 @@ pipeline { script { sh ''' sudo ansible-playbook -e 'deployservers="test-server" lcp="QA"' dwnldArtifact.yml - + sleep 20s ''' } } From b8229145ed3262bc414ea4691609926b32eba620 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 19:44:11 -0500 Subject: [PATCH 159/190] DP-2 commit of new code from dev-master --- Jenkinsfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ed47bff348..8448e316d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -139,17 +139,17 @@ pipeline { } post { always { - jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testserver', environmentType: 'testing', issueKeys: ['DP-2'] + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-${env.BUILD_NUMBER}', environmentName: 'testserver', environmentType: 'testing', issueKeys: ['DP-2'] } } } - // stage('Performance test'){ - // steps { - // slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - // } - // } + stage('Performance test'){ + steps { + slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' + } + } stage('Deploy on Prod Server') { steps { @@ -176,12 +176,13 @@ pipeline { } post { always { - jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-1', environmentName: 'testserver', environmentType: 'testing', issueKeys: ['DP-2'] + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'prod-${env.BUILD_NUMBER}', environmentName: 'prodserver', environmentType: 'production', issueKeys: ['DP-2'] } } } } + tools { maven 'Maven3.6.3' jdk 'JDK' From 6fa5e896ca1972f01e438888f7b64e609e4d08f8 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 23:21:46 -0500 Subject: [PATCH 160/190] Updated the docker restart steps --- Jenkinsfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 8448e316d5..07b2101de0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -119,6 +119,18 @@ pipeline { script { sh ''' sudo ansible-playbook -e 'deployservers="test-server" lcp="QA"' dwnldArtifact.yml + testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` + sudo ssh -o StrictHostKeyChecking=no root@${testserver} ' + if [[ `docker ps -q | wc -l` -gt 0 ]] + then + docker container stop $(docker ps -q ) + docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim + chown -R 777 /opt/tomcat /opt/postgresql + else + docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim + chown -R 777 /opt/tomcat /opt/postgresql + fi + ' sleep 20s ''' } From 33027e5f7d01aeb6c4456556b70b1c1f9ddbd75c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Mon, 8 Mar 2021 23:25:59 -0500 Subject: [PATCH 161/190] Updated the docker restart steps --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 07b2101de0..020ef197ff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,12 +45,12 @@ pipeline { if [[ `docker ps -q | wc -l` -gt 0 ]] then docker container stop $(docker ps -q ) - docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 + docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim chown -R 777 /opt/tomcat /opt/postgresql else - docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 + docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim chown -R 777 /opt/tomcat /opt/postgresql fi ' @@ -124,9 +124,11 @@ pipeline { if [[ `docker ps -q | wc -l` -gt 0 ]] then docker container stop $(docker ps -q ) + docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim chown -R 777 /opt/tomcat /opt/postgresql else + docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim chown -R 777 /opt/tomcat /opt/postgresql fi From 739197901732fe5a222e48203205eed679ddb01c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 9 Mar 2021 00:00:16 -0500 Subject: [PATCH 162/190] Updated the docker restart steps --- Jenkinsfile | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 020ef197ff..bed5e45705 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,14 +45,11 @@ pipeline { if [[ `docker ps -q | wc -l` -gt 0 ]] then docker container stop $(docker ps -q ) - docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 - docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim - chown -R 777 /opt/tomcat /opt/postgresql - else - docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 - docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim - chown -R 777 /opt/tomcat /opt/postgresql fi + rm -fr /opt/tomcat/webapps/* + docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim + docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432devopsbcsquad5/postgresdbsquad5 + chown -R 777 /opt/tomcat /opt/postgresql ' done ''' @@ -68,7 +65,7 @@ pipeline { sh ''' testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` prodserver=`grep prod-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - echo $testserver + echo "Testserver: $testserver and Prodcution: $prodserver" sed -i "s/squadtestserver/$testserver/g" $(find . -type f) sed -i "s/squadprodserver/$prodserver/g" $(find . -type f) grep URL functionaltest/src/test/java/functionaltest/ftat.java @@ -119,20 +116,6 @@ pipeline { script { sh ''' sudo ansible-playbook -e 'deployservers="test-server" lcp="QA"' dwnldArtifact.yml - testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` - sudo ssh -o StrictHostKeyChecking=no root@${testserver} ' - if [[ `docker ps -q | wc -l` -gt 0 ]] - then - docker container stop $(docker ps -q ) - docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 - docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim - chown -R 777 /opt/tomcat /opt/postgresql - else - docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432 devopsbcsquad5/postgresdbsquad5 - docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim - chown -R 777 /opt/tomcat /opt/postgresql - fi - ' sleep 20s ''' } @@ -158,12 +141,12 @@ pipeline { } } - stage('Performance test'){ - steps { - slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - } - } + // stage('Performance test'){ + // steps { + // slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' + // } + // } stage('Deploy on Prod Server') { steps { From f24fb78f5b67c896858043a5d7e108b8094ae19a Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 9 Mar 2021 01:24:03 -0500 Subject: [PATCH 163/190] Updated the docker restart steps --- Jenkinsfile | 11 +++++++---- docker-compose.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 docker-compose.yml diff --git a/Jenkinsfile b/Jenkinsfile index bed5e45705..af859e0afc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,12 +44,15 @@ pipeline { sudo ssh -o StrictHostKeyChecking=no root@${server} ' if [[ `docker ps -q | wc -l` -gt 0 ]] then - docker container stop $(docker ps -q ) + docker-compose down fi rm -fr /opt/tomcat/webapps/* - docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim - docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432devopsbcsquad5/postgresdbsquad5 - chown -R 777 /opt/tomcat /opt/postgresql + docker-compose up -d + + #docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim + #docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432devopsbcsquad5/#postgresdbsquad5 + #chown -R 777 /opt/tomcat /opt/postgresql + ' done ''' diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..0d8d77cb98 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,29 @@ +version: "3" + +services: + tomcat: + image: tomcat:8-jdk8-openjdk-slim + ports: + - 8080:8080 + networks: + - webappnet + restart: on-failure + volumes: + - /opt/tomcat/webapps:/usr/local/tomcat/webapps + - /opt/tomcat/logs:/usr/local/tomcat/logs + + db: + image: devopsbcsquad5/postgresdbsquad5 + ports: + - 5432:5432 + networks: + - webappnet + environment: + - POSTGRES_PASSWORD=password + - PGDATA=/var/lib/postgresql/data/pgdata + restart: on-failure + volumes: + - /opt/postgresql:/var/lib/postgresql/data + +networks: + webappnet: \ No newline at end of file From a6a01a3029375420703faade6c2e9f2aa8782ea1 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 9 Mar 2021 01:46:07 -0500 Subject: [PATCH 164/190] Added the docker compose step --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index af859e0afc..83bc4e7daa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,6 +41,7 @@ pipeline { prodserver=`grep prod-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` for server in $testserver $prodserver do + sudo -o StrictHostKeyChecking=no docker-compose.yml root@${server}:/root/docker-compose.yml sudo ssh -o StrictHostKeyChecking=no root@${server} ' if [[ `docker ps -q | wc -l` -gt 0 ]] then From bbb3d96989b67694a418bfbabaee60d1f53eef3d Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 9 Mar 2021 01:47:30 -0500 Subject: [PATCH 165/190] Added the docker compose step --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 83bc4e7daa..02b759802c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,7 +41,7 @@ pipeline { prodserver=`grep prod-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2` for server in $testserver $prodserver do - sudo -o StrictHostKeyChecking=no docker-compose.yml root@${server}:/root/docker-compose.yml + sudo scp -o StrictHostKeyChecking=no docker-compose.yml root@${server}:/root/docker-compose.yml sudo ssh -o StrictHostKeyChecking=no root@${server} ' if [[ `docker ps -q | wc -l` -gt 0 ]] then From 53ed5db848e77bef412639413d8f1d5b16827124 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 9 Mar 2021 01:53:48 -0500 Subject: [PATCH 166/190] Added the docker compose step --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 02b759802c..2ac957a522 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -145,12 +145,12 @@ pipeline { } } - // stage('Performance test'){ - // steps { - // slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - // } - // } + stage('Performance test'){ + steps { + slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' + } + } stage('Deploy on Prod Server') { steps { From ca89556b79d5aeba14119055153929f191e2fe5c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 9 Mar 2021 01:59:07 -0500 Subject: [PATCH 167/190] Added the docker compose step --- Jenkinsfile | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2ac957a522..dc1274a7f1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,8 +17,6 @@ pipeline { mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} ''' } - - } } @@ -32,7 +30,7 @@ pipeline { } } } - stage('Initalize Docker on Test & Prod Servers') { + stage('Initalize Docker-Compose on Test & Prod Servers') { steps { slackSend channel: 'notify', message: "Initialize Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { @@ -49,11 +47,6 @@ pipeline { fi rm -fr /opt/tomcat/webapps/* docker-compose up -d - - #docker run -v /opt/tomcat/webapps:/usr/local/tomcat/webapps -v /opt/tomcat/logs:/usr/local/tomcat/logs -p 8080:8080 -it -d tomcat:8-jdk8-openjdk-slim - #docker run -d -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /opt/postgresql:/var/lib/postgresql/data -p 5432:5432devopsbcsquad5/#postgresdbsquad5 - #chown -R 777 /opt/tomcat /opt/postgresql - ' done ''' @@ -148,7 +141,7 @@ pipeline { stage('Performance test'){ steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' + // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' } } From d90310143b2f1e500af6fd99fb51af48cdda332b Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Tue, 9 Mar 2021 02:04:50 -0500 Subject: [PATCH 168/190] Added the docker compose step --- Jenkinsfile | 2 +- docker-compose.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index dc1274a7f1..578458eaa8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,7 +30,7 @@ pipeline { } } } - stage('Initalize Docker-Compose on Test & Prod Servers') { + stage('Initalize Docker Compose on Test & Prod Servers') { steps { slackSend channel: 'notify', message: "Initialize Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" script { diff --git a/docker-compose.yml b/docker-compose.yml index 0d8d77cb98..ba376e0484 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ version: "3" services: tomcat: image: tomcat:8-jdk8-openjdk-slim + container_name: webserver ports: - 8080:8080 networks: @@ -14,6 +15,7 @@ services: db: image: devopsbcsquad5/postgresdbsquad5 + container_name: postgresdb ports: - 5432:5432 networks: From d3b4e8e3bfcebe5457280fb0ecd6ed07eabd7264 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Mar 2021 17:18:48 -0400 Subject: [PATCH 169/190] Updated the blazemeter step --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 578458eaa8..a3db661d54 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -142,6 +142,7 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' + blazeMeterTest credentialsId: 'Blazemeter', testId: '919745.taurus', workspaceId: '799387' } } From 536169330014a49d5e03e80b6b97b71a4ac4f1d2 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 18 Mar 2021 18:30:17 -0400 Subject: [PATCH 170/190] Updated the taurus testid in blazemeter --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a3db661d54..afc1688c5b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -142,7 +142,7 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - blazeMeterTest credentialsId: 'Blazemeter', testId: '919745.taurus', workspaceId: '799387' + blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '799387' } } From 910c79ef31aac5db413eb0492a6b7db94e16d453 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 18 Mar 2021 19:13:20 -0400 Subject: [PATCH 171/190] Updated the slack success and failure step in all stages updated --- Jenkinsfile | 100 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 92 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index afc1688c5b..7fcb4ea509 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,6 +18,14 @@ pipeline { ''' } } + post { + success { + slackSend channel: 'notify', message: "Static Code Analysis succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Static Code Analysis failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + } } stage('Build the project') { @@ -29,6 +37,14 @@ pipeline { ''' } } + post { + success { + slackSend channel: 'notify', message: "Build the project succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Build the project failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + } } stage('Initalize Docker Compose on Test & Prod Servers') { steps { @@ -52,6 +68,14 @@ pipeline { ''' } } + post { + success { + slackSend channel: 'notify', message: "Initialize Test & Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Initialize Test & Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + } } } } @@ -69,6 +93,14 @@ pipeline { grep URL Acceptancetest/src/test/java/acceptancetest/acat.java ''' } + post { + success { + slackSend channel: 'notify', message: "Configure Test & Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Configure Test & Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + } } } @@ -81,6 +113,14 @@ pipeline { ''' } } + post { + success { + slackSend channel: 'notify', message: "Package the project succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Package the project failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + } } stage('Store Artifacts') { @@ -105,6 +145,14 @@ pipeline { } } + post { + success { + slackSend channel: 'notify', message: "Upload artifacts succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Upload artifacts failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + } } stage('Deploy on Test Server') { @@ -117,6 +165,14 @@ pipeline { ''' } } + post { + success { + slackSend channel: 'notify', message: "Deployment of War on Test Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Deployment of War on Test Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + } } @@ -132,9 +188,15 @@ pipeline { publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) } post { - always { - jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-${env.BUILD_NUMBER}', environmentName: 'testserver', environmentType: 'testing', issueKeys: ['DP-2'] - } + always { + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-${env.BUILD_NUMBER}', environmentName: 'testserver', environmentType: 'testing', issueKeys: ['DP-2'] + } + success { + slackSend channel: 'notify', message: "UI Testing succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "UI Testing failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } } } @@ -142,7 +204,15 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '799387' + // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '799387' + } + post { + success { + slackSend channel: 'notify', message: "Performance Testing succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Performance Testing failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } } } @@ -156,6 +226,14 @@ pipeline { ''' } } + post { + success { + slackSend channel: 'notify', message: "Deployment of War on Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Deployment of War on Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + } } stage('Sanity Tests') { @@ -170,10 +248,16 @@ pipeline { publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\Acceptancetest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) } post { - always { - jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'prod-${env.BUILD_NUMBER}', environmentName: 'prodserver', environmentType: 'production', issueKeys: ['DP-2'] - } - } + always { + jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'prod-${env.BUILD_NUMBER}', environmentName: 'prodserver', environmentType: 'production', issueKeys: ['DP-2'] + } + success { + slackSend channel: 'notify', message: "Sanity Testing on Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Sanity Testing on Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + } } } From 0ff3a673635ecd39978aa735a14e374372ee5b60 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 18 Mar 2021 19:22:49 -0400 Subject: [PATCH 172/190] Updated the slack success and failure step in all stages updated --- Jenkinsfile | 76 ++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7fcb4ea509..3a4a8a0cc8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -93,13 +93,13 @@ pipeline { grep URL Acceptancetest/src/test/java/acceptancetest/acat.java ''' } - post { - success { - slackSend channel: 'notify', message: "Configure Test & Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - } - failure { - slackSend channel: 'notify', message: "Configure Test & Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - } + } + post { + success { + slackSend channel: 'notify', message: "Configure Test & Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + } + failure { + slackSend channel: 'notify', message: "Configure Test & Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" } } } @@ -177,16 +177,16 @@ pipeline { stage('UI Testing on Test Server') { - steps { - slackSend channel: 'notify', message: "UI Testing started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - script { - sh ''' - mvn -B -f functionaltest/pom.xml test - ''' - } - // publish html - publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) - } + steps { + slackSend channel: 'notify', message: "UI Testing started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + mvn -B -f functionaltest/pom.xml test + ''' + } + // publish html + publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) + } post { always { jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-${env.BUILD_NUMBER}', environmentName: 'testserver', environmentType: 'testing', issueKeys: ['DP-2'] @@ -201,19 +201,19 @@ pipeline { } stage('Performance test'){ - steps { - slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '799387' + steps { + slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' + // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '799387' + } + post { + success { + slackSend channel: 'notify', message: "Performance Testing succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" } - post { - success { - slackSend channel: 'notify', message: "Performance Testing succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - } - failure { - slackSend channel: 'notify', message: "Performance Testing failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - } + failure { + slackSend channel: 'notify', message: "Performance Testing failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" } + } } stage('Deploy on Prod Server') { @@ -237,16 +237,16 @@ pipeline { } stage('Sanity Tests') { - steps { - slackSend channel: 'notify', message: "Sanity Testing on Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - script { - sh ''' - mvn -B -f Acceptancetest/pom.xml test - ''' - } - // publish html - publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\Acceptancetest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) - } + steps { + slackSend channel: 'notify', message: "Sanity Testing on Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + mvn -B -f Acceptancetest/pom.xml test + ''' + } + // publish html + publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\Acceptancetest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) + } post { always { jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'prod-${env.BUILD_NUMBER}', environmentName: 'prodserver', environmentType: 'production', issueKeys: ['DP-2'] From 6376eb14eef6e474a8013f90eede9117d6ecab60 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 18 Mar 2021 20:42:20 -0400 Subject: [PATCH 173/190] Updated the blazemeter testID --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3a4a8a0cc8..ce87160a69 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -204,7 +204,7 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '799387' + blazeMeterTest credentialsId: 'Blazemeter', testId: '9204220.taurus', workspaceId: '799387' } post { success { From 11922bc03fedd2cc6db80b72386543641990bae1 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 18 Mar 2021 20:48:48 -0400 Subject: [PATCH 174/190] Updated the blazemeter testID --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ce87160a69..984cf87867 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -204,7 +204,7 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - blazeMeterTest credentialsId: 'Blazemeter', testId: '9204220.taurus', workspaceId: '799387' + blazeMeterTest credentialsId: 'Blazemeter', testId: '9204220', workspaceId: '799387' } post { success { From 0d8397654a8c1b28ea4abc0facee6535ebbe6f5c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 18 Mar 2021 20:54:58 -0400 Subject: [PATCH 175/190] Updated the blazemeter testID --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 984cf87867..c6352c68db 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -204,7 +204,7 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - blazeMeterTest credentialsId: 'Blazemeter', testId: '9204220', workspaceId: '799387' + blazeMeterTest credentialsId: 'Blazemeter-Cred', testId: '9204220', workspaceId: '799387' } post { success { From 2da06c31c52efe6acea10e8c8ec297951de99aa5 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 18 Mar 2021 20:59:29 -0400 Subject: [PATCH 176/190] Updated the blazemeter testID --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c6352c68db..4c3c65cdd0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -204,7 +204,7 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - blazeMeterTest credentialsId: 'Blazemeter-Cred', testId: '9204220', workspaceId: '799387' + blazeMeterTest credentialsId: 'Blazemeter-Cred', testId: '9204220.taurus', workspaceId: '799387' } post { success { From f637ef81ba861ff19d3d4aa2b24578c2be1a1e51 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Thu, 18 Mar 2021 22:34:19 -0400 Subject: [PATCH 177/190] Updated the blazemeter testID --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4c3c65cdd0..24604778ba 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -204,7 +204,7 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - blazeMeterTest credentialsId: 'Blazemeter-Cred', testId: '9204220.taurus', workspaceId: '799387' + blazeMeterTest credentialsId: 'bcb98eda-1130-4c9e-97e3-2262ffd3a6b7', testId: '9204220.taurus', workspaceId: '799387' } post { success { From ea5f02968d150f0d1e1fa3c568237b20b5ed0e19 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 00:06:49 -0400 Subject: [PATCH 178/190] Added Pivotal Tracker Update --- Jenkinsfile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 24604778ba..72da4b2849 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -261,6 +261,47 @@ pipeline { } } + post { + success { + sh """ #!/bin/bash -xe + export LATEST_GIT_SHA=$(curl -H "X-TrackerToken: $TRACKER_API_TOKEN" "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd/9c1a65985558b645d869c2adf0f162fc" | grep -oE "([^"latest_git_sha\":][a-zA-Z0-9]+)") + git config --global core.pager cat + if git log $LATEST_GIT_SHA~..$LATEST_GIT_SHA; then + true # all is well + else + echo "$LATEST_GIT_SHA missing, assuming the worst" + export LATEST_GIT_SHA=null + fi + export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD) + if [ "$LATEST_GIT_SHA" == "null" ]; then + export STORY_IDS=($(git log -10 | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) + else + export STORY_IDS=($(git log $LATEST_GIT_SHA..HEAD | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) + fi + curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['$(IFS=,; echo "${STORY_IDS[*]}")'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" + """ + } + + + failure { + sh """ #!/bin/bash -xe + export LATEST_GIT_SHA=$(curl -H "X-TrackerToken: $TRACKER_API_TOKEN" "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd/9c1a65985558b645d869c2adf0f162fc" | grep -oE "([^"latest_git_sha\":][a-zA-Z0-9]+)") + git config --global core.pager cat + if git log $LATEST_GIT_SHA~..$LATEST_GIT_SHA; then + true # all is well + else + echo "$LATEST_GIT_SHA missing, assuming the worst" + export LATEST_GIT_SHA=null + fi + if [ "$LATEST_GIT_SHA" == "null" ]; then + export STORY_IDS=($(git log -10 | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) + else + export STORY_IDS=($(git log $LATEST_GIT_SHA..HEAD | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) + fi + curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['$(IFS=,; echo "${STORY_IDS[*]}")'], "version":1}' "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" + """ + } + } tools { maven 'Maven3.6.3' @@ -268,5 +309,6 @@ pipeline { } environment { SONAR_AUTH = credentials('sonar-login') + TRACKER_API_TOKEN = credentials('tracker-api-token') } } From 6763868024758dd1c3a1de1454447be0574bce90 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 00:07:05 -0400 Subject: [PATCH 179/190] Added Pivotal Tracker Update --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 72da4b2849..738a87fc2c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -204,7 +204,7 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - blazeMeterTest credentialsId: 'bcb98eda-1130-4c9e-97e3-2262ffd3a6b7', testId: '9204220.taurus', workspaceId: '799387' + // blazeMeterTest credentialsId: 'bcb98eda-1130-4c9e-97e3-2262ffd3a6b7', testId: '9204220.taurus', workspaceId: '799387' } post { success { From 231a34cfbe458732c82b5ecbca9d55e793622751 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 00:10:31 -0400 Subject: [PATCH 180/190] Added Pivotal Tracker Update --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 738a87fc2c..f998e1d77b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -263,7 +263,7 @@ pipeline { } post { success { - sh """ #!/bin/bash -xe + sh ''' #!/bin/bash -xe export LATEST_GIT_SHA=$(curl -H "X-TrackerToken: $TRACKER_API_TOKEN" "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd/9c1a65985558b645d869c2adf0f162fc" | grep -oE "([^"latest_git_sha\":][a-zA-Z0-9]+)") git config --global core.pager cat if git log $LATEST_GIT_SHA~..$LATEST_GIT_SHA; then @@ -279,12 +279,12 @@ pipeline { export STORY_IDS=($(git log $LATEST_GIT_SHA..HEAD | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) fi curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['$(IFS=,; echo "${STORY_IDS[*]}")'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" - """ + ''' } failure { - sh """ #!/bin/bash -xe + sh ''' #!/bin/bash -xe export LATEST_GIT_SHA=$(curl -H "X-TrackerToken: $TRACKER_API_TOKEN" "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd/9c1a65985558b645d869c2adf0f162fc" | grep -oE "([^"latest_git_sha\":][a-zA-Z0-9]+)") git config --global core.pager cat if git log $LATEST_GIT_SHA~..$LATEST_GIT_SHA; then @@ -299,7 +299,7 @@ pipeline { export STORY_IDS=($(git log $LATEST_GIT_SHA..HEAD | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) fi curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['$(IFS=,; echo "${STORY_IDS[*]}")'], "version":1}' "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" - """ + ''' } } From c5392bd7dfdbf32694ffaa73e5f50c5795c94820 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 00:38:40 -0400 Subject: [PATCH 181/190] Added Pivotal Tracker Update --- Jenkinsfile | 83 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 33 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f998e1d77b..f35c9ae612 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -79,6 +79,19 @@ pipeline { } } } + // post { + // success { + // script { + // sh ''' + + // ''' + // } + // curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Pipeline have created a stage tag for the story and published the release in the github.\\n **URL**: '${MY_GITHUB_REALEASE_TAG}'/'${deploy_env}-${myVersion}' \\n \\n Code is merged to master and deployed to '${currentPCFEnv}' PCF Environment.\\n \\n Story status is updated to **ACCEPTED** " }' "${PIVOTAL_STORIES}/${ticket}/comments" + // } + // failure { + + // } + // } stage('Configure Test & Prod Server') { steps { slackSend channel: 'notify', message: "Configure Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" @@ -263,43 +276,47 @@ pipeline { } post { success { - sh ''' #!/bin/bash -xe - export LATEST_GIT_SHA=$(curl -H "X-TrackerToken: $TRACKER_API_TOKEN" "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd/9c1a65985558b645d869c2adf0f162fc" | grep -oE "([^"latest_git_sha\":][a-zA-Z0-9]+)") - git config --global core.pager cat - if git log $LATEST_GIT_SHA~..$LATEST_GIT_SHA; then - true # all is well - else - echo "$LATEST_GIT_SHA missing, assuming the worst" - export LATEST_GIT_SHA=null - fi - export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD) - if [ "$LATEST_GIT_SHA" == "null" ]; then - export STORY_IDS=($(git log -10 | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) - else - export STORY_IDS=($(git log $LATEST_GIT_SHA..HEAD | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) - fi - curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['$(IFS=,; echo "${STORY_IDS[*]}")'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" - ''' + script { + sh ''' #!/bin/bash -xe + export LATEST_GIT_SHA=$(curl -H "X-TrackerToken: $TRACKER_API_TOKEN" "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd/9c1a65985558b645d869c2adf0f162fc" | grep -oE "([^"latest_git_sha\":][a-zA-Z0-9]+)") + git config --global core.pager cat + if git log $LATEST_GIT_SHA~..$LATEST_GIT_SHA; then + true # all is well + else + echo "$LATEST_GIT_SHA missing, assuming the worst" + export LATEST_GIT_SHA=null + fi + export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD) + if [ "$LATEST_GIT_SHA" == "null" ]; then + export STORY_IDS=($(git log -10 | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) + else + export STORY_IDS=($(git log $LATEST_GIT_SHA..HEAD | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) + fi + curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['$(IFS=,; echo "${STORY_IDS[*]}")'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" + ''' + } } failure { - sh ''' #!/bin/bash -xe - export LATEST_GIT_SHA=$(curl -H "X-TrackerToken: $TRACKER_API_TOKEN" "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd/9c1a65985558b645d869c2adf0f162fc" | grep -oE "([^"latest_git_sha\":][a-zA-Z0-9]+)") - git config --global core.pager cat - if git log $LATEST_GIT_SHA~..$LATEST_GIT_SHA; then - true # all is well - else - echo "$LATEST_GIT_SHA missing, assuming the worst" - export LATEST_GIT_SHA=null - fi - if [ "$LATEST_GIT_SHA" == "null" ]; then - export STORY_IDS=($(git log -10 | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) - else - export STORY_IDS=($(git log $LATEST_GIT_SHA..HEAD | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) - fi - curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['$(IFS=,; echo "${STORY_IDS[*]}")'], "version":1}' "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" - ''' + script { + sh ''' #!/bin/bash -xe + export LATEST_GIT_SHA=$(curl -H "X-TrackerToken: $TRACKER_API_TOKEN" "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd/9c1a65985558b645d869c2adf0f162fc" | grep -oE "([^"latest_git_sha\":][a-zA-Z0-9]+)") + git config --global core.pager cat + if git log $LATEST_GIT_SHA~..$LATEST_GIT_SHA; then + true # all is well + else + echo "$LATEST_GIT_SHA missing, assuming the worst" + export LATEST_GIT_SHA=null + fi + if [ "$LATEST_GIT_SHA" == "null" ]; then + export STORY_IDS=($(git log -10 | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) + else + export STORY_IDS=($(git log $LATEST_GIT_SHA..HEAD | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) + fi + curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['$(IFS=,; echo "${STORY_IDS[*]}")'], "version":1}' "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" + ''' + } } } From bfd42ee590f4ede07faac070b371253caee59c93 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 02:28:15 -0400 Subject: [PATCH 182/190] Added code to change the story status and add the comments in the pivotal tracker --- Jenkinsfile | 99 ++++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f35c9ae612..c93b7604b8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -79,19 +79,21 @@ pipeline { } } } - // post { - // success { - // script { - // sh ''' - - // ''' - // } - // curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Pipeline have created a stage tag for the story and published the release in the github.\\n **URL**: '${MY_GITHUB_REALEASE_TAG}'/'${deploy_env}-${myVersion}' \\n \\n Code is merged to master and deployed to '${currentPCFEnv}' PCF Environment.\\n \\n Story status is updated to **ACCEPTED** " }' "${PIVOTAL_STORIES}/${ticket}/comments" - // } - // failure { + post { + success { + script { + sh ''' + ### Code to update the Story state + story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` + my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2` + curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"finished"}' "${MY_PIVOTAL_STORIES}/${story_nbr}" - // } - // } + ### Code to add the comments to the pivotal story + curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipeline started due to new code merge to master from '${story_nbr}' in the github.\\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **FINISHED** " }' "${MY_PIVOTAL_STORIES}/${story_nbr}/comments" + ''' + } + } + } stage('Configure Test & Prod Server') { steps { slackSend channel: 'notify', message: "Configure Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" @@ -222,6 +224,17 @@ pipeline { post { success { slackSend channel: 'notify', message: "Performance Testing succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + ### Code to update the Story state + story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` + my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2` + curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"delivered"}' "${MY_PIVOTAL_STORIES}/${story_nbr}" + + ### Code to add the comments to the pivotal story + curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipeline deployed the new code to AWS Test-Server from artifactory using docker compose and ran the UI and Performance testing. \\n **Story ID**: '${story_nbr}' \\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **DELIVERED** " }' "${MY_PIVOTAL_STORIES}/${story_nbr}/comments" + ''' + } } failure { slackSend channel: 'notify', message: "Performance Testing failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" @@ -266,6 +279,17 @@ pipeline { } success { slackSend channel: 'notify', message: "Sanity Testing on Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" + script { + sh ''' + ### Code to update the Story state + story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` + my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2` + curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"accepted"}' "${MY_PIVOTAL_STORIES}/${story_nbr}" + + ### Code to add the comments to the pivotal story + curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipeline deployed the new code to AWS Prod-Server from artifactory using docker compose and completed the Sanity testing. Code is live to end-user \\n **Story ID**: '${story_nbr}' \\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **ACCEPTED** " }' "${MY_PIVOTAL_STORIES}/${story_nbr}/comments" + ''' + } } failure { slackSend channel: 'notify', message: "Sanity Testing on Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" @@ -277,49 +301,27 @@ pipeline { post { success { script { - sh ''' #!/bin/bash -xe - export LATEST_GIT_SHA=$(curl -H "X-TrackerToken: $TRACKER_API_TOKEN" "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd/9c1a65985558b645d869c2adf0f162fc" | grep -oE "([^"latest_git_sha\":][a-zA-Z0-9]+)") - git config --global core.pager cat - if git log $LATEST_GIT_SHA~..$LATEST_GIT_SHA; then - true # all is well - else - echo "$LATEST_GIT_SHA missing, assuming the worst" - export LATEST_GIT_SHA=null - fi - export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD) - if [ "$LATEST_GIT_SHA" == "null" ]; then - export STORY_IDS=($(git log -10 | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) - else - export STORY_IDS=($(git log $LATEST_GIT_SHA..HEAD | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) - fi - curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['$(IFS=,; echo "${STORY_IDS[*]}")'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" + sh ''' + ### Code to update the Story CICD Pipeline status + export story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` + export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD) + + curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "'${MY_PIVOTAL_CICD}'" ''' } } - - failure { script { - sh ''' #!/bin/bash -xe - export LATEST_GIT_SHA=$(curl -H "X-TrackerToken: $TRACKER_API_TOKEN" "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd/9c1a65985558b645d869c2adf0f162fc" | grep -oE "([^"latest_git_sha\":][a-zA-Z0-9]+)") - git config --global core.pager cat - if git log $LATEST_GIT_SHA~..$LATEST_GIT_SHA; then - true # all is well - else - echo "$LATEST_GIT_SHA missing, assuming the worst" - export LATEST_GIT_SHA=null - fi - if [ "$LATEST_GIT_SHA" == "null" ]; then - export STORY_IDS=($(git log -10 | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) - else - export STORY_IDS=($(git log $LATEST_GIT_SHA..HEAD | grep -E "\\[.*\\]" | grep -oE "\\[.*\\]" | grep -oE "([0-9]+)")) - fi - curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['$(IFS=,; echo "${STORY_IDS[*]}")'], "version":1}' "https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" + sh ''' + ### Code to update the Story CICD Pipeline status + export story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` + export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD) + + curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "'${MY_PIVOTAL_CICD}'" ''' - } + } } } - tools { maven 'Maven3.6.3' jdk 'JDK' @@ -327,5 +329,8 @@ pipeline { environment { SONAR_AUTH = credentials('sonar-login') TRACKER_API_TOKEN = credentials('tracker-api-token') + MY_REPO="https://github.com/devopsbcsquad5/DevOps-Demo-WebApp" + MY_PIVOTAL_CICD="https://www.pivotaltracker.com/services/v5/projects/2490801/cicd" + MY_PIVOTAL_STORIES="https://www.pivotaltracker.com/services/v5/projects/2490801/stories" } } From 7f6951caad6a3d1f0be3451882ab1a8e417fc263 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 02:32:20 -0400 Subject: [PATCH 183/190] Added code to change the story status and add the comments in the pivotal tracker --- Jenkinsfile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c93b7604b8..31450d4db1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -78,22 +78,23 @@ pipeline { } } } - } - post { - success { - script { - sh ''' - ### Code to update the Story state - story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` - my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2` - curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"finished"}' "${MY_PIVOTAL_STORIES}/${story_nbr}" + post { + success { + script { + sh ''' + ### Code to update the Story state + story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` + my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2` + curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"finished"}' "${MY_PIVOTAL_STORIES}/${story_nbr}" - ### Code to add the comments to the pivotal story - curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipeline started due to new code merge to master from '${story_nbr}' in the github.\\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **FINISHED** " }' "${MY_PIVOTAL_STORIES}/${story_nbr}/comments" - ''' + ### Code to add the comments to the pivotal story + curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipeline started due to new code merge to master from '${story_nbr}' in the github.\\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **FINISHED** " }' "${MY_PIVOTAL_STORIES}/${story_nbr}/comments" + ''' + } } } } + stage('Configure Test & Prod Server') { steps { slackSend channel: 'notify', message: "Configure Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" From 37f7336bf67a3a8ce451662aed02a55f32e24201 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 02:54:43 -0400 Subject: [PATCH 184/190] Added code to change the story status and add the comments in the pivotal tracker --- Jenkinsfile | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 31450d4db1..5afff086f8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -280,17 +280,6 @@ pipeline { } success { slackSend channel: 'notify', message: "Sanity Testing on Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" - script { - sh ''' - ### Code to update the Story state - story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` - my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2` - curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"accepted"}' "${MY_PIVOTAL_STORIES}/${story_nbr}" - - ### Code to add the comments to the pivotal story - curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipeline deployed the new code to AWS Prod-Server from artifactory using docker compose and completed the Sanity testing. Code is live to end-user \\n **Story ID**: '${story_nbr}' \\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **ACCEPTED** " }' "${MY_PIVOTAL_STORIES}/${story_nbr}/comments" - ''' - } } failure { slackSend channel: 'notify', message: "Sanity Testing on Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}" @@ -306,8 +295,14 @@ pipeline { ### Code to update the Story CICD Pipeline status export story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD) + my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2` + + curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"accepted"}' "${MY_PIVOTAL_STORIES}/${story_nbr}" + + ### Code to add the comments to the pivotal story + curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipelinedeployed the new code to AWS Prod-Server from artifactory using docker compose and completed the Sanity testing. Code is live to end-user \\n **Story ID**: '{story_nbr}' \\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **ACCEPTED** " }' "${MY_PIVOTAL_STORIES}/{story_nbr}/comments" - curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "'${MY_PIVOTAL_CICD}'" + curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "'${MY_PIVOTAL_CICD}'" ''' } } @@ -318,7 +313,7 @@ pipeline { export story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD) - curl -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "'${MY_PIVOTAL_CICD}'" + curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "'${MY_PIVOTAL_CICD}'" ''' } } From 8a5cbb64404d3bab877f78b55778869b55eab21f Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 03:00:27 -0400 Subject: [PATCH 185/190] Added code to change the story status and add the comments in the pivotal tracker --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5afff086f8..4ea9ac5b8d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -296,13 +296,15 @@ pipeline { export story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD) my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2` + + curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "${MY_PIVOTAL_CICD}" curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"accepted"}' "${MY_PIVOTAL_STORIES}/${story_nbr}" ### Code to add the comments to the pivotal story curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipelinedeployed the new code to AWS Prod-Server from artifactory using docker compose and completed the Sanity testing. Code is live to end-user \\n **Story ID**: '{story_nbr}' \\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **ACCEPTED** " }' "${MY_PIVOTAL_STORIES}/{story_nbr}/comments" - curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "'${MY_PIVOTAL_CICD}'" + ''' } } From d94f15d99189fbe0aa44e56c1d605d41369ef2bf Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 03:00:48 -0400 Subject: [PATCH 186/190] Added code to change the story status and add the comments in the pivotal tracker --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4ea9ac5b8d..f30e21706f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -315,7 +315,7 @@ pipeline { export story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1` export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD) - curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "'${MY_PIVOTAL_CICD}'" + curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "${MY_PIVOTAL_CICD}" ''' } } From 5f3e5c36e9023340f1670ca5f72a069a5fc19de0 Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 03:50:00 -0400 Subject: [PATCH 187/190] Added code to change the story status and add the comments in the pivotal tracker --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f30e21706f..a5cc770e1e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -220,7 +220,7 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - // blazeMeterTest credentialsId: 'bcb98eda-1130-4c9e-97e3-2262ffd3a6b7', testId: '9204220.taurus', workspaceId: '799387' + blazeMeterTest credentialsId: 'bcb98eda-1130-4c9e-97e3-2262ffd3a6b7', testId: '9204220.taurus', workspaceId: '799387' } post { success { From ed06cc8ceda066575c98c58eaf2e89767d0c39bb Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 19 Mar 2021 13:12:57 -0400 Subject: [PATCH 188/190] Update README.md Starting new commit - 177411384 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f2e66473dc..dd4ade0c1e 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,4 @@ NEw commit for Dp-4 NEw commit for Dp-4 second time +Starting new commit - 177411384 From 5b20a5e25bf9f17528dbd618bc7474461b837839 Mon Sep 17 00:00:00 2001 From: DevopsbcSquad5 <79700489+devopsbcsquad5@users.noreply.github.com> Date: Fri, 19 Mar 2021 13:28:06 -0400 Subject: [PATCH 189/190] Update Jenkinsfile comment bm code --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a5cc770e1e..3b7e8fbae2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -220,7 +220,7 @@ pipeline { steps { slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}" // blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624' - blazeMeterTest credentialsId: 'bcb98eda-1130-4c9e-97e3-2262ffd3a6b7', testId: '9204220.taurus', workspaceId: '799387' + //blazeMeterTest credentialsId: 'bcb98eda-1130-4c9e-97e3-2262ffd3a6b7', testId: '9204220.taurus', workspaceId: '799387' } post { success { From 6fbc2593cf9c6aa40005aceea8dd4e8486b4d53c Mon Sep 17 00:00:00 2001 From: ManojKumar Selvaraju Date: Fri, 19 Mar 2021 13:41:04 -0400 Subject: [PATCH 190/190] true commit --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3b7e8fbae2..6bd7dbce8b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -299,10 +299,12 @@ pipeline { curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "${MY_PIVOTAL_CICD}" - curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"accepted"}' "${MY_PIVOTAL_STORIES}/${story_nbr}" + ### Code to add the comments to the pivotal story curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipelinedeployed the new code to AWS Prod-Server from artifactory using docker compose and completed the Sanity testing. Code is live to end-user \\n **Story ID**: '{story_nbr}' \\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **ACCEPTED** " }' "${MY_PIVOTAL_STORIES}/{story_nbr}/comments" + + curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"accepted"}' "${MY_PIVOTAL_STORIES}/${story_nbr}" '''