From ee2012210978b36b5f2fbd5babb35c18457740d2 Mon Sep 17 00:00:00 2001 From: nebstephy <124457916+nebstephy@users.noreply.github.com> Date: Tue, 15 Aug 2023 00:01:43 -0400 Subject: [PATCH 01/25] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 40afaa4..b350152 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +Sample # S4-projects ![del](https://user-images.githubusercontent.com/96950933/216551396-58ffa498-0148-4a61-97ac-74aaeb0bd115.png) From cc1d3bf2225ed50ae8e6743dedcf7bbee3be7334 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 00:27:48 -0400 Subject: [PATCH 02/25] added Jenkinsfile --- weather-app/Jenkinsfile | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 weather-app/Jenkinsfile diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile new file mode 100644 index 0000000..8271ffb --- /dev/null +++ b/weather-app/Jenkinsfile @@ -0,0 +1,43 @@ +pipeline { + agent any + + stages { + stage('Checkout') { + steps { + // Checkout your source code repository (e.g., Git) + checkout scm + } + } + + stage('Build') { + steps { + // Compile your Java application + sh 'javac -version' + sh 'javac src/*.java -d build' + } + } + + stage('Test') { + steps { + // Run your tests (assuming JUnit tests) + sh 'java -cp build org.junit.runner.JUnitCore YourTestClass' + } + } + + stage('Deploy') { + steps { + // Deploy your application (e.g., to a server) + sh 'scp -r build user@server:/path/to/deploy' + } + } + } + + post { + success { + echo 'Pipeline succeeded! Application deployed.' + } + failure { + echo 'Pipeline failed. Please check.' + } + } +} From f33f679d73b2286c7e24c9352dc3a454d464ea8a Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 21:36:02 -0400 Subject: [PATCH 03/25] added Jenkinsfile --- weather-app/Jenkinsfile | 20 ++++++++++++++++++++ weather-app/sonar-project.properties | 6 ++++++ 2 files changed, 26 insertions(+) create mode 100644 weather-app/sonar-project.properties diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 8271ffb..fbedd9b 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -30,6 +30,26 @@ pipeline { sh 'scp -r build user@server:/path/to/deploy' } } + + stages { + stage('SonarQube analysis') { + agent { + docker { + image 'sonarsource/sonar-scanner-cli:4.7.0' + } + } + environment { + CI = 'true' + // scannerHome = tool 'Sonar' + scannerHome='/opt/sonar-scanner' + } + steps{ + withSonarQubeEnv('Sonar') { + sh "${scannerHome}/bin/sonar-scanner" + } + } + } + } post { diff --git a/weather-app/sonar-project.properties b/weather-app/sonar-project.properties new file mode 100644 index 0000000..4b096f4 --- /dev/null +++ b/weather-app/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.host.url=https://sonarqube.ektechsoftwaresolution.com/ +sonar.projectKey=s4stephane-weatherapp +sonar.projectName=4stephane-weatherapp +sonar.projectVersion=1.0.0 +sonar.sources=. +qualitygate.wait=true \ No newline at end of file From 8be9e6d57636ffa5ee64bbaebf5f82f7278cc79b Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 21:40:52 -0400 Subject: [PATCH 04/25] added Jenkinsfile --- weather-app/Jenkinsfile | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index fbedd9b..6d40404 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -30,26 +30,25 @@ pipeline { sh 'scp -r build user@server:/path/to/deploy' } } - - stages { - stage('SonarQube analysis') { + + stage('SonarQube analysis') { agent { docker { - image 'sonarsource/sonar-scanner-cli:4.7.0' + image 'sonarsource/sonar-scanner-cli:latest' } - } - environment { - CI = 'true' - // scannerHome = tool 'Sonar' - scannerHome='/opt/sonar-scanner' - } - steps{ - withSonarQubeEnv('Sonar') { - sh "${scannerHome}/bin/sonar-scanner" + } + environment { + CI = 'true' + } + steps { + script { + def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + withSonarQubeEnv('Sonar') { + sh "${scannerHome}/bin/sonar-scanner" + } } } } - } post { From 2a7719f44df7de24fff7763564218c75d2a2ece4 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 21:47:40 -0400 Subject: [PATCH 05/25] added Jenkinsfile --- weather-app/Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 6d40404..dcf4037 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -4,14 +4,12 @@ pipeline { stages { stage('Checkout') { steps { - // Checkout your source code repository (e.g., Git) checkout scm } } stage('Build') { steps { - // Compile your Java application sh 'javac -version' sh 'javac src/*.java -d build' } @@ -19,14 +17,12 @@ pipeline { stage('Test') { steps { - // Run your tests (assuming JUnit tests) sh 'java -cp build org.junit.runner.JUnitCore YourTestClass' } } stage('Deploy') { steps { - // Deploy your application (e.g., to a server) sh 'scp -r build user@server:/path/to/deploy' } } From 17d26370bf6b1f3a845ffbbb97f382d64f31cf3b Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 22:01:31 -0400 Subject: [PATCH 06/25] added Jenkinsfile --- weather-app/Jenkinsfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index dcf4037..fc94f84 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -13,6 +13,11 @@ pipeline { sh 'javac -version' sh 'javac src/*.java -d build' } + post { + success { + archiveArtifacts artifacts: 'build/**/*.class', allowEmptyArchive: true + } + } } stage('Test') { @@ -56,3 +61,4 @@ pipeline { } } } + From 12c055c137f89f1010200472e123586e7ec00e5d Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 22:05:45 -0400 Subject: [PATCH 07/25] added Jenkinsfile --- weather-app/Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index fc94f84..4116418 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -26,12 +26,14 @@ pipeline { } } + stage('Deploy') { steps { sh 'scp -r build user@server:/path/to/deploy' } } + stage('SonarQube analysis') { agent { docker { From c5f0e4315158d5858dbdbfa1137c51a6cf2f4d26 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 22:08:18 -0400 Subject: [PATCH 08/25] added Jenkinsfile --- weather-app/Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 4116418..3578443 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -15,7 +15,8 @@ pipeline { } post { success { - archiveArtifacts artifacts: 'build/**/*.class', allowEmptyArchive: true + archiveArtifacts artifacts: '**/target/*.jar', allowEmptyArchive: true + } } } @@ -33,7 +34,7 @@ pipeline { } } - + stage('SonarQube analysis') { agent { docker { From e0dc6be8101282ed1468c85ee2a4b9f702bb90c6 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 22:16:41 -0400 Subject: [PATCH 09/25] added Jenkinsfile --- weather-app/Jenkinsfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 3578443..e6a6f0a 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -16,25 +16,22 @@ pipeline { post { success { archiveArtifacts artifacts: '**/target/*.jar', allowEmptyArchive: true - } } } stage('Test') { steps { - sh 'java -cp build org.junit.runner.JUnitCore YourTestClass' + sh 'java -cp build org.junit.runner.JUnitCore 4stephane-weatherapp' } } - stage('Deploy') { steps { sh 'scp -r build user@server:/path/to/deploy' } } - stage('SonarQube analysis') { agent { docker { @@ -64,4 +61,3 @@ pipeline { } } } - From 50792811abd03a3334b6de7e9e58e91929ac77ff Mon Sep 17 00:00:00 2001 From: nebstephy <124457916+nebstephy@users.noreply.github.com> Date: Tue, 15 Aug 2023 22:23:58 -0400 Subject: [PATCH 10/25] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 35274ca..f7c9052 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ pipeline { stage('Archive') { steps { // Archive the build artifacts - arctifacts: '**/target/*.jar', allowEmptyArchive: true + artifacts: '**/target/*.jar', allowEmptyArchive: true } } From 13112566de1f2d44e7ad69198511e7e9e131b6d5 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 22:25:51 -0400 Subject: [PATCH 11/25] added Jenkinsfile --- weather-app/Jenkinsfile | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index e6a6f0a..5d5bc4d 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -8,17 +8,6 @@ pipeline { } } - stage('Build') { - steps { - sh 'javac -version' - sh 'javac src/*.java -d build' - } - post { - success { - archiveArtifacts artifacts: '**/target/*.jar', allowEmptyArchive: true - } - } - } stage('Test') { steps { From 27ba7b597b5ae08809268a582bbf42d0855fc8a2 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 23:33:35 -0400 Subject: [PATCH 12/25] added Jenkinsfile --- weather-app/Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 5d5bc4d..d1f1ed2 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -6,8 +6,7 @@ pipeline { steps { checkout scm } - } - + } stage('Test') { steps { From 073f92233979bbf385359d05ed9c5675725b7027 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Tue, 15 Aug 2023 23:46:47 -0400 Subject: [PATCH 13/25] added Jenkinsfile --- weather-app/Jenkinsfile | 59 +++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index d1f1ed2..6a47a75 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -1,51 +1,52 @@ pipeline { - agent any - + agent any + + tools { + // Define tool name and version + maven 'Maven3' + jdk 'JDK8' + } + stages { stage('Checkout') { steps { + // Checkout the code from the SCM checkout scm } - } - - stage('Test') { + } + + stage('Build') { steps { - sh 'java -cp build org.junit.runner.JUnitCore 4stephane-weatherapp' + // Build the code using Maven + sh 'mvn clean install -DskipTests' } } - - stage('Deploy') { + + stage('Archive') { steps { - sh 'scp -r build user@server:/path/to/deploy' + // Archive the build artifacts + arctifacts: '**/target/*.jar', allowEmptyArchive: true } } - - stage('SonarQube analysis') { - agent { - docker { - image 'sonarsource/sonar-scanner-cli:latest' - } - } - environment { - CI = 'true' - } + + stage('Test') { steps { - script { - def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' - withSonarQubeEnv('Sonar') { - sh "${scannerHome}/bin/sonar-scanner" - } - } + // Run the unit tests + sh 'mvn test' } } } - + post { + always { + // Cleanup after the build + deleteDir() + } success { - echo 'Pipeline succeeded! Application deployed.' + echo 'Build was successful!' } failure { - echo 'Pipeline failed. Please check.' + echo 'Blded!' } } -} +} \ No newline at end of file From 439e6e1dc75be8a30367da0f31fc042220b771a3 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Wed, 16 Aug 2023 00:03:32 -0400 Subject: [PATCH 14/25] added Jenkinsfile --- weather-app/Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 6a47a75..9a68dd2 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -25,7 +25,7 @@ pipeline { stage('Archive') { steps { // Archive the build artifacts - arctifacts: '**/target/*.jar', allowEmptyArchive: true + archiveArtifacts artifacts: '**/target/*.jar', allowEmptyArchive: true } } @@ -46,7 +46,7 @@ pipeline { echo 'Build was successful!' } failure { - echo 'Blded!' + echo 'Build failed!' } } -} \ No newline at end of file +} From cb7b433cd42339c270d0a69145e301032313d09e Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 00:37:09 -0400 Subject: [PATCH 15/25] added Jenkinsfile --- weather-app/Jenkinsfile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 9a68dd2..b29c90c 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent any + agent any tools { // Define tool name and version @@ -15,6 +15,24 @@ pipeline { } } + stage('SonarQube analysis') { + agent { + docker { + image 'sonarsource/sonar-scanner-cli:latest' // Use latest version + } + } + environment { + CI = 'true' + scannerHome = '/opt/sonar-scanner' + } + steps { + script { + def scannerCmd = "${scannerHome}/bin/sonar-scanner" + sh "${scannerCmd}" + } + } + } + stage('Build') { steps { // Build the code using Maven @@ -50,3 +68,4 @@ pipeline { } } } + From 49150bed661eb499680419afa9f74b3c83b7b53d Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 00:51:35 -0400 Subject: [PATCH 16/25] added Jenkinsfile --- Jenkinsfile | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index f7c9052..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,52 +0,0 @@ -pipeline { - agent any - - tools { - // Define tool name and version - maven 'Maven3' - jdk 'JDK8' - } - - stages { - stage('Checkout') { - steps { - // Checkout the code from the SCM - checkout scm - } - } - - stage('Build') { - steps { - // Build the code using Maven - sh 'mvn clean install -DskipTests' - } - } - - stage('Archive') { - steps { - // Archive the build artifacts - artifacts: '**/target/*.jar', allowEmptyArchive: true - } - } - - stage('Test') { - steps { - // Run the unit tests - sh 'mvn test' - } - } - } - - post { - always { - // Cleanup after the build - deleteDir() - } - success { - echo 'Build was successful!' - } - failure { - echo 'Blded!' - } - } -} From 671a9f4317f5c0140f2966ab096af3791cad60cf Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 01:12:41 -0400 Subject: [PATCH 17/25] added Jenkinsfile --- weather-app/Jenkinsfile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index b29c90c..490aa67 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -2,7 +2,6 @@ pipeline { agent any tools { - // Define tool name and version maven 'Maven3' jdk 'JDK8' } @@ -10,7 +9,6 @@ pipeline { stages { stage('Checkout') { steps { - // Checkout the code from the SCM checkout scm } } @@ -18,7 +16,7 @@ pipeline { stage('SonarQube analysis') { agent { docker { - image 'sonarsource/sonar-scanner-cli:latest' // Use latest version + image 'sonarsource/sonar-scanner-cli:latest' } } environment { @@ -35,21 +33,18 @@ pipeline { stage('Build') { steps { - // Build the code using Maven sh 'mvn clean install -DskipTests' } } stage('Archive') { steps { - // Archive the build artifacts archiveArtifacts artifacts: '**/target/*.jar', allowEmptyArchive: true } } stage('Test') { steps { - // Run the unit tests sh 'mvn test' } } @@ -57,7 +52,6 @@ pipeline { post { always { - // Cleanup after the build deleteDir() } success { @@ -68,4 +62,3 @@ pipeline { } } } - From c56ffc9cc7de9be605e5ff1013bc1ca4feada55d Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 01:15:35 -0400 Subject: [PATCH 18/25] added Jenkinsfile --- weather-app/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 490aa67..29285eb 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -2,8 +2,8 @@ pipeline { agent any tools { - maven 'Maven3' - jdk 'JDK8' + maven 'null' + jdk 'null' } stages { From dd47adeef536149ad7c533469ce227adac5ab8f5 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 01:19:54 -0400 Subject: [PATCH 19/25] added Jenkinsfile --- weather-app/Jenkinsfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 29285eb..01301ed 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -1,11 +1,6 @@ pipeline { agent any - tools { - maven 'null' - jdk 'null' - } - stages { stage('Checkout') { steps { From daf7c6794e17e976801aab2bacd01c0787a2bcee Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 01:27:34 -0400 Subject: [PATCH 20/25] added Jenkinsfile --- weather-app/Jenkinsfile | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 01301ed..903eabc 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -9,22 +9,23 @@ pipeline { } stage('SonarQube analysis') { - agent { - docker { - image 'sonarsource/sonar-scanner-cli:latest' - } - } - environment { - CI = 'true' - scannerHome = '/opt/sonar-scanner' - } - steps { - script { - def scannerCmd = "${scannerHome}/bin/sonar-scanner" - sh "${scannerCmd}" - } - } + agent { + docker { + image 'sonarsource/sonar-scanner-cli:latest' + } + } + environment { + CI = 'true' + scannerHome = '/opt/sonar-scanner' + } + steps { + script { + def scannerCmd = "${scannerHome}/bin/sonar-scanner" + sh "${scannerCmd} -Dsonar.host.url=" } + } +} + stage('Build') { steps { From 44c10972b648591bc772f9121507d89712733a72 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 01:34:57 -0400 Subject: [PATCH 21/25] added Jenkinsfile --- weather-app/Jenkinsfile | 61 ++++++++++++----------------------------- 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 903eabc..31e08e4 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -1,60 +1,35 @@ pipeline { agent any - + stages { - stage('Checkout') { + stage('Checkout SCM') { steps { checkout scm } } - + stage('SonarQube analysis') { - agent { - docker { - image 'sonarsource/sonar-scanner-cli:latest' - } - } - environment { - CI = 'true' - scannerHome = '/opt/sonar-scanner' - } - steps { - script { - def scannerCmd = "${scannerHome}/bin/sonar-scanner" - sh "${scannerCmd} -Dsonar.host.url=" - } - } -} - - - stage('Build') { - steps { - sh 'mvn clean install -DskipTests' - } - } - - stage('Archive') { steps { - archiveArtifacts artifacts: '**/target/*.jar', allowEmptyArchive: true - } - } - - stage('Test') { - steps { - sh 'mvn test' + script { + def scannerHome = tool name: 'SonarQube Scanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + def scannerCmd = "${scannerHome}/bin/sonar-scanner" + + sh """ + ${scannerCmd} -Dsonar.projectKey=my_project_key \ + -Dsonar.sources=./src \ + -Dsonar.host.url=http://your-sonarqube-server:9000 \ + -Dsonar.login=my_auth_token + """ + } } } + + // Add more stages as needed } - + post { always { - deleteDir() - } - success { - echo 'Build was successful!' - } - failure { - echo 'Build failed!' + cleanWs() } } } From 9380a0aae3092eb7f6e9808fc381cd0cde9ba871 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 01:42:37 -0400 Subject: [PATCH 22/25] added Jenkinsfile --- weather-app/Jenkinsfile | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 31e08e4..bb5babd 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -1,35 +1,25 @@ pipeline { agent any - + stages { stage('Checkout SCM') { steps { - checkout scm + // Your checkout steps here } } - stage('SonarQube analysis') { steps { script { def scannerHome = tool name: 'SonarQube Scanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' - def scannerCmd = "${scannerHome}/bin/sonar-scanner" - - sh """ - ${scannerCmd} -Dsonar.projectKey=my_project_key \ - -Dsonar.sources=./src \ - -Dsonar.host.url=http://your-sonarqube-server:9000 \ - -Dsonar.login=my_auth_token - """ + // Use the scannerHome in the subsequent steps + withSonarQubeEnv('https://sonarqube.ektechsoftwaresolution.com/') { + sh "${scannerHome}/bin/sonar-scanner" + } } } } - // Add more stages as needed } - - post { - always { - cleanWs() - } - } + + // Post-build actions and other pipeline settings } From aa44e7ed61ed934d334d4db0e22ce09ce588d8a6 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 01:47:03 -0400 Subject: [PATCH 23/25] added Jenkinsfile --- weather-app/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index bb5babd..9934e10 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { script { def scannerHome = tool name: 'SonarQube Scanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' // Use the scannerHome in the subsequent steps - withSonarQubeEnv('https://sonarqube.ektechsoftwaresolution.com/') { + withSonarQubeEnv('http://localhost:9000/') { sh "${scannerHome}/bin/sonar-scanner" } } From 741ff0f8e18928d1ee8adebceae46696cf69dab1 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 01:50:53 -0400 Subject: [PATCH 24/25] added Jenkinsfile --- weather-app/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index 9934e10..bb5babd 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { script { def scannerHome = tool name: 'SonarQube Scanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' // Use the scannerHome in the subsequent steps - withSonarQubeEnv('http://localhost:9000/') { + withSonarQubeEnv('https://sonarqube.ektechsoftwaresolution.com/') { sh "${scannerHome}/bin/sonar-scanner" } } From ef0a289993767c463c622597994f6125e2f9bb64 Mon Sep 17 00:00:00 2001 From: devopseasylearning Date: Thu, 17 Aug 2023 01:54:26 -0400 Subject: [PATCH 25/25] added Jenkinsfile --- weather-app/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile index bb5babd..9934e10 100644 --- a/weather-app/Jenkinsfile +++ b/weather-app/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { script { def scannerHome = tool name: 'SonarQube Scanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' // Use the scannerHome in the subsequent steps - withSonarQubeEnv('https://sonarqube.ektechsoftwaresolution.com/') { + withSonarQubeEnv('http://localhost:9000/') { sh "${scannerHome}/bin/sonar-scanner" } }