From e38376f0add535513ef9b1eaac11424b5b478003 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Tue, 10 Jan 2023 23:14:50 -0500 Subject: [PATCH 01/21] Update App.java --- src/main/java/com/ibt/app/App.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ibt/app/App.java b/src/main/java/com/ibt/app/App.java index 7909dfc..0f7af48 100644 --- a/src/main/java/com/ibt/app/App.java +++ b/src/main/java/com/ibt/app/App.java @@ -8,6 +8,6 @@ public class App { public static void main( String[] args ) { - System.out.println( "Hello World!" ); + System.out.println( "Hello World!This is an update from Bokovi" ); } } From 833415b59d6afd6bab3298c7efa5bf2be70b56f2 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Tue, 10 Jan 2023 23:18:29 -0500 Subject: [PATCH 02/21] N updates to pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4de0be7..ff98902 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.ibt.app hello-maven - 1.0-SNAPSHOT + 1.7-SNAPSHOT hello-maven From 455e58f783f33c1b533566a8243ead821f7f4892 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Wed, 18 Jan 2023 23:26:32 -0500 Subject: [PATCH 03/21] updated Jenkinsfile from bokovi --- Jenkinsfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..a87ef9f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,33 @@ +pipeline { + agent any + + stages { + stage('Git clone') { + steps { + echo "cloning" + } + } + stage('Verify') { + steps { + echo "bokovi is verifying" + } + } + + stage('Build') { + steps { + echo "bokovi is building" + } + } + + stage('Run Test') { + steps { + echo "bokovi is testing" + } + } + stage('Run mvn commands') { + steps { + echo "running maven commands" + } + } + } + } From 09167417d58e5ea37dc1b1395bbbd6383ad93da4 Mon Sep 17 00:00:00 2001 From: edward Date: Mon, 23 Jan 2023 10:45:15 -0500 Subject: [PATCH 04/21] updated jenkinsfile --- Jenkinsfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index a87ef9f..8420c84 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,6 +28,13 @@ pipeline { steps { echo "running maven commands" } + } + + stage('another test from bokovi') { + steps { + echo "running maven commands" } + } + } } From 86d503d725b8adbcb962eaa376ea84eaf837e203 Mon Sep 17 00:00:00 2001 From: edward Date: Mon, 23 Jan 2023 10:49:49 -0500 Subject: [PATCH 05/21] another update on jenkinsfile --- Jenkinsfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 8420c84..0446e4e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,6 +35,12 @@ pipeline { echo "running maven commands" } } + stage('third test from bokovi') { + steps { + echo "running maven commands" + } + } + } } From 3bb27b37af0e419faccd0e61d524b78136a53b17 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Mon, 23 Jan 2023 15:17:28 -0500 Subject: [PATCH 06/21] Update Jenkinsfile --- Jenkinsfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0446e4e..59cd652 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,7 +40,15 @@ pipeline { echo "running maven commands" } } - + stage('sonarqube scan by bokovi') { + steps { + bat 'echo running maven commands' + withSonarQubeEnv(credentialsId: 'SQ-student') { + bat "${scannerHome}/bin/sonar-scanner" +} } } +stage('Run Test') { + steps { + bat 'mvn test' From ab0ea19ebc5a5bc9b15dec569aef638a337c7bc3 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Mon, 23 Jan 2023 15:36:14 -0500 Subject: [PATCH 07/21] Update Jenkinsfile --- Jenkinsfile | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 59cd652..9b662b6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,32 +15,13 @@ pipeline { stage('Build') { steps { - echo "bokovi is building" - } - } - - stage('Run Test') { - steps { - echo "bokovi is testing" - } - } - stage('Run mvn commands') { - steps { - echo "running maven commands" - } - } - - stage('another test from bokovi') { - steps { - echo "running maven commands" - } - } - stage('third test from bokovi') { - steps { - echo "running maven commands" + bat 'mvn compile' + } } stage('sonarqube scan by bokovi') { + environment { + scannerHome = tool 'ibt-sonarqube'; steps { bat 'echo running maven commands' withSonarQubeEnv(credentialsId: 'SQ-student') { From 5853b1748c58b56a8e8a45772481919dfa7db45a Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Mon, 23 Jan 2023 15:54:25 -0500 Subject: [PATCH 08/21] Create sonar-project.properties --- sonar-project.properties | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..627eace --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=nov15-cohort-project + +sonar.java.binaries= target +sonar.host.url=https://sonarqube.ibtlearning.co/ From 6e28a7df97fecd76e0d657224032aaa9ebd8bad3 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Mon, 23 Jan 2023 16:08:12 -0500 Subject: [PATCH 09/21] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9b662b6..ecbfcc8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ pipeline { environment { scannerHome = tool 'ibt-sonarqube'; steps { - bat 'echo running maven commands' + echo "running maven commands" withSonarQubeEnv(credentialsId: 'SQ-student') { bat "${scannerHome}/bin/sonar-scanner" } From 0061da67cfe9443d90ab105fae6b6a13052af765 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Mon, 23 Jan 2023 23:34:28 -0500 Subject: [PATCH 10/21] Update Jenkinsfile --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ecbfcc8..8f846e5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { stage('Build') { steps { - bat 'mvn compile' + sh 'mvn compile' } } @@ -25,11 +25,11 @@ pipeline { steps { echo "running maven commands" withSonarQubeEnv(credentialsId: 'SQ-student') { - bat "${scannerHome}/bin/sonar-scanner" + sh "${scannerHome}/bin/sonar-scanner" } } } stage('Run Test') { steps { - bat 'mvn test' + sh 'mvn test' From 23674a0da0e6a731e857ce346d797489dc67d236 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Mon, 23 Jan 2023 23:48:53 -0500 Subject: [PATCH 11/21] Update Jenkinsfile --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 8f846e5..65b70f0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,3 +33,6 @@ pipeline { stage('Run Test') { steps { sh 'mvn test' + } +} + } From 16dffccc0c6d1d07259ff8bff90474fae746f515 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Mon, 23 Jan 2023 23:50:17 -0500 Subject: [PATCH 12/21] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 65b70f0..bb99def 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,3 +36,4 @@ stage('Run Test') { } } } + } From 9a1d00be0fc7e11793899c61c77c619c1c308dae Mon Sep 17 00:00:00 2001 From: ooghenekaro <114274865+ooghenekaro@users.noreply.github.com> Date: Fri, 27 Jan 2023 00:47:30 +0100 Subject: [PATCH 13/21] Update Jenkinsfile --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bb99def..d4bac8d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,8 +17,8 @@ pipeline { steps { sh 'mvn compile' - } - } + } + } stage('sonarqube scan by bokovi') { environment { scannerHome = tool 'ibt-sonarqube'; @@ -26,7 +26,7 @@ pipeline { echo "running maven commands" withSonarQubeEnv(credentialsId: 'SQ-student') { sh "${scannerHome}/bin/sonar-scanner" -} + } } } @@ -34,6 +34,6 @@ stage('Run Test') { steps { sh 'mvn test' } -} + } } } From 966305f0499b21dbf922e445a1646ec4f749d23b Mon Sep 17 00:00:00 2001 From: ooghenekaro <114274865+ooghenekaro@users.noreply.github.com> Date: Fri, 27 Jan 2023 00:49:49 +0100 Subject: [PATCH 14/21] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index d4bac8d..e8fd0ea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,6 +33,7 @@ pipeline { stage('Run Test') { steps { sh 'mvn test' + } } } From 84d3b0b9aa0befa4145d8a76072f75a7a7f5033a Mon Sep 17 00:00:00 2001 From: ooghenekaro <114274865+ooghenekaro@users.noreply.github.com> Date: Fri, 27 Jan 2023 00:52:26 +0100 Subject: [PATCH 15/21] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index e8fd0ea..5a21d64 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,3 +38,4 @@ stage('Run Test') { } } } +} From cc5316177c336431f9f296c0550b9e4379fb97ef Mon Sep 17 00:00:00 2001 From: ooghenekaro <114274865+ooghenekaro@users.noreply.github.com> Date: Fri, 27 Jan 2023 00:54:37 +0100 Subject: [PATCH 16/21] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5a21d64..7d0b0ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ pipeline { scannerHome = tool 'ibt-sonarqube'; steps { echo "running maven commands" - withSonarQubeEnv(credentialsId: 'SQ-student') { + withSonarQubeEnv(credentialsId: 'SQ-student', installationName: 'IBT sonarqube') { sh "${scannerHome}/bin/sonar-scanner" } From 2671e7736fc28377bd46ee564b7166413a7f1c69 Mon Sep 17 00:00:00 2001 From: ooghenekaro <114274865+ooghenekaro@users.noreply.github.com> Date: Fri, 27 Jan 2023 00:55:50 +0100 Subject: [PATCH 17/21] Update Jenkinsfile --- Jenkinsfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7d0b0ed..134dfef 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,17 +19,19 @@ pipeline { } } - stage('sonarqube scan by bokovi') { - environment { - scannerHome = tool 'ibt-sonarqube'; + + // Running sonarqube + stage('Sonarqube test') { + environment { + scannerHome = tool 'ibt-sonarqube'; + } steps { - echo "running maven commands" - withSonarQubeEnv(credentialsId: 'SQ-student', installationName: 'IBT sonarqube') { - sh "${scannerHome}/bin/sonar-scanner" - } - + withSonarQubeEnv(credentialsId: 'SQ-student', installationName: 'IBT sonarqube') { + sh "${scannerHome}/bin/sonar-scanner" + } + } } - } + stage('Run Test') { steps { sh 'mvn test' From b2b2f4fc31b237060023f1ee362ecd89e3936e81 Mon Sep 17 00:00:00 2001 From: ooghenekaro <114274865+ooghenekaro@users.noreply.github.com> Date: Fri, 27 Jan 2023 00:56:41 +0100 Subject: [PATCH 18/21] Update Jenkinsfile --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 134dfef..7692299 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,5 +39,4 @@ stage('Run Test') { } } } - } -} + } From 80cbc90cf9958e47545c6355680a299826a8479a Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Thu, 26 Jan 2023 22:19:50 -0500 Subject: [PATCH 19/21] Update Jenkinsfile --- Jenkinsfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 7692299..c789172 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,3 +40,11 @@ stage('Run Test') { } } } +stage('upload to artifactory') { + steps { + //sh 'mvn test' + configFileProvider([configFile(fileId: '5d0920bc-97c5-4877-8aa4-2f61975fa9fc', variable: 'MAVEN_SETTINGS_XML')]) { + sh 'mvn -U --batch-mode -s $MAVEN_SETTINGS_XML clean deploy' + } + } + } From 4130cae2fcd9f87b4a41526e6b49c331d3ebac99 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Sun, 29 Jan 2023 18:44:24 -0500 Subject: [PATCH 20/21] Update Jenkinsfile --- Jenkinsfile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c789172..59c14df 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,13 +38,25 @@ stage('Run Test') { } } - } - } -stage('upload to artifactory') { + stage('upload to artifactory') { steps { //sh 'mvn test' - configFileProvider([configFile(fileId: '5d0920bc-97c5-4877-8aa4-2f61975fa9fc', variable: 'MAVEN_SETTINGS_XML')]) { - sh 'mvn -U --batch-mode -s $MAVEN_SETTINGS_XML clean deploy' + configFileProvider([configFile('5d0920bc-97c5-4877-8aa4-2f61975fa9fc')]) { + sh 'mvn package' } } } + + stage ('OWASP Dependency-Check Vulnerabilities') { + steps { + dependencyCheck additionalArguments: ''' + -o "./" + -s "./" + -f "ALL" + --prettyPrint''', odcInstallation: 'dependency-check' + + dependencyCheckPublisher pattern: 'dependency-check-report.xml' + } + } + } + } From 61aa137c3462766e24de4fac4f6b23fd24123127 Mon Sep 17 00:00:00 2001 From: Bokovi TOBOSSOU Date: Sun, 29 Jan 2023 21:39:25 -0500 Subject: [PATCH 21/21] Update Jenkinsfile --- Jenkinsfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 59c14df..d496c42 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -58,5 +58,17 @@ stage('Run Test') { dependencyCheckPublisher pattern: 'dependency-check-report.xml' } } + + stage ('Deploy code to non-prod') { + steps { + script { + def remote = [name: 'IBT-Unix', host: '159.223.96.221', user: 'root', allowAnyHosts: true] + withCredentials([usernamePassword(credentialsId: " user-bokovi", usernameVariable: 'USERNAME',passwordVariable: 'PASSWORD')]) { + remote.password = PASSWORD + sshPut remote: remote, from: 'target/hello-maven-1.7-SNAPSHOT.jar', into: '/opt/tomcat/webapps/' + } + } + } } - } + } +}