From 0f35b12c1cb5260610fcf7f9bb1d0830cb396624 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 12:35:08 +0530 Subject: [PATCH 01/28] Update Jenkinsfile --- Jenkinsfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 56745c21a..50ca3337a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,6 +7,14 @@ pipeline { sh "mvn clean package -DskipTests=true" archive 'target/*.jar' //so that they can be downloaded later } + } + + stage('Unit Tests') { + steps { + sh "mvn test" // ok I am fine + } + } } + } \ No newline at end of file From 888421b3e52e706baf215aa43d762e3017503e21 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 19:38:59 +0530 Subject: [PATCH 02/28] Update pom.xml --- pom.xml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8e71c7ac2..c186d9c3c 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,26 @@ org.springframework.boot spring-boot-maven-plugin - + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + + prepare-agent + + + + report + test + + report + + + + From 5b8fc04369272499ac8299fa55c61ab3f2d9e876 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 19:40:43 +0530 Subject: [PATCH 03/28] Updated jenkins for jacoco plugin --- Jenkinsfile | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 50ca3337a..ec1b16e1b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,19 +2,24 @@ pipeline { agent any stages { - stage('Build Artifact') { - steps { - sh "mvn clean package -DskipTests=true" - archive 'target/*.jar' //so that they can be downloaded later - } - - } + stage('Build Artifact - Maven') { + steps { + sh "mvn clean package -DskipTests=true" + archive 'target/*.jar' + } + } - stage('Unit Tests') { - steps { - sh "mvn test" // ok I am fine - } + stage('Unit Tests - JUnit and Jacoco') { + steps { + sh "mvn test" + } + post { + always { + junit 'target/surefire-reports/*.xml' + jacoco execPattern: 'target/jacoco.exec' } + } } - + } +} } \ No newline at end of file From 635099c9ca8dadcfe782427b9eb9d0cef939824a Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 19:53:39 +0530 Subject: [PATCH 04/28] Create settings.json --- .vscode/settings.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..c5f3f6b9c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} \ No newline at end of file From 1195191c49bb2463fa28f4a21047c69f87479286 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 20:07:50 +0530 Subject: [PATCH 05/28] Update Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ec1b16e1b..e5d0d6aea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,5 +21,4 @@ pipeline { } } } -} } \ No newline at end of file From d204650aa9faf438f685688e8ea1002514c9886c Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 20:18:09 +0530 Subject: [PATCH 06/28] Update Jenkinsfile --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index e5d0d6aea..223c2be92 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,7 @@ pipeline { agent any stages { + stage('Build Artifact - Maven') { steps { sh "mvn clean package -DskipTests=true" @@ -20,5 +21,15 @@ pipeline { } } } + + stage('Docker Build and Push') { + steps { + withDockerRegistry([credentialsId: "docker-hub", url: ""]) { + sh 'printenv' + sh 'docker build -t Devsecops9849/kubernetes-devops-security:""$GIT_COMMIT"" .' + sh 'docker push Devsecops9849 /kubernetes-devops-security:""$GIT_COMMIT""' + } + } + } } } \ No newline at end of file From 9f0dc1fab5772a9ca8a41947962b77e6408d4d46 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 20:22:27 +0530 Subject: [PATCH 07/28] Updated Jenkins file --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 223c2be92..926efb5d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,7 +27,7 @@ pipeline { withDockerRegistry([credentialsId: "docker-hub", url: ""]) { sh 'printenv' sh 'docker build -t Devsecops9849/kubernetes-devops-security:""$GIT_COMMIT"" .' - sh 'docker push Devsecops9849 /kubernetes-devops-security:""$GIT_COMMIT""' + sh 'docker push Devsecops9849/kubernetes-devops-security:""$GIT_COMMIT""' } } } From 88024646b609404b7de28297a3f528521c2a1e85 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 20:27:52 +0530 Subject: [PATCH 08/28] Added few files --- .vscode/settings.json | 2 +- pom.xml | 2 +- .../devsecops/NumericApplicationTests.java | 20 +++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index c5f3f6b9c..e0f15db2e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "java.configuration.updateBuildConfiguration": "interactive" + "java.configuration.updateBuildConfiguration": "automatic" } \ No newline at end of file diff --git a/pom.xml b/pom.xml index c186d9c3c..b3bf9eb34 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.1.RELEASE + 2.7.8 diff --git a/src/test/java/com/devsecops/NumericApplicationTests.java b/src/test/java/com/devsecops/NumericApplicationTests.java index 3e0ae20a4..8d6eb9011 100644 --- a/src/test/java/com/devsecops/NumericApplicationTests.java +++ b/src/test/java/com/devsecops/NumericApplicationTests.java @@ -1,7 +1,6 @@ package com.devsecops; -import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; @@ -21,35 +20,36 @@ import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -//import org.junit.Test; + +import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -@RunWith(SpringRunner.class) +/*~~(Unable to find runtime dependencies beginning with: 'junit-jupiter-api')~~>*/@RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureMockMvc -public class NumericApplicationTests { +class NumericApplicationTests { @Autowired private MockMvc mockMvc; @Test - public void smallerThanOrEqualToFiftyMessage() throws Exception { + void smallerThanOrEqualToFiftyMessage() throws Exception { this.mockMvc.perform(get("/compare/49")).andDo(print()).andExpect(status().isOk()) .andExpect(content().string("Smaller than or equal to 50")); } @Test - public void greaterThanFiftyMessage() throws Exception { + void greaterThanFiftyMessage() throws Exception { this.mockMvc.perform(get("/compare/51")).andDo(print()).andExpect(status().isOk()) .andExpect(content().string("Greater than 50")); } - + @Test - public void welcomeMessage() throws Exception { - this.mockMvc.perform(get("/")).andDo(print()).andExpect(status().isOk()); + void welcomeMessage() throws Exception { + this.mockMvc.perform(get("/")).andDo(print()).andExpect(status().isOk()); } - + } \ No newline at end of file From 54d5b8d60cc97baed59f3cdd7949afe03fadd23f Mon Sep 17 00:00:00 2001 From: Devsecops9849 <123365554+Devsecops9849@users.noreply.github.com> Date: Sun, 29 Jan 2023 20:32:17 +0530 Subject: [PATCH 09/28] Create docker-image.yml --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 000000000..d657a63b2 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From b1bed883f18f1465624688890d7010a58a78e9aa Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:06:03 +0530 Subject: [PATCH 10/28] Updating --- Jenkinsfile | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 926efb5d2..5252c06c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,15 +21,5 @@ pipeline { } } } - - stage('Docker Build and Push') { - steps { - withDockerRegistry([credentialsId: "docker-hub", url: ""]) { - sh 'printenv' - sh 'docker build -t Devsecops9849/kubernetes-devops-security:""$GIT_COMMIT"" .' - sh 'docker push Devsecops9849/kubernetes-devops-security:""$GIT_COMMIT""' - } - } - } } -} \ No newline at end of file +} From 2242f9c73c96747ac1389a041d4e004bfdad9219 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:18:57 +0530 Subject: [PATCH 11/28] Changes reverted --- Jenkinsfile | 12 ------------ pom.xml | 21 +-------------------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5252c06c5..4464b28bd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,17 +9,5 @@ pipeline { archive 'target/*.jar' } } - - stage('Unit Tests - JUnit and Jacoco') { - steps { - sh "mvn test" - } - post { - always { - junit 'target/surefire-reports/*.xml' - jacoco execPattern: 'target/jacoco.exec' - } - } - } } } diff --git a/pom.xml b/pom.xml index b3bf9eb34..1fcf142ed 100644 --- a/pom.xml +++ b/pom.xml @@ -45,26 +45,7 @@ org.springframework.boot spring-boot-maven-plugin - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - - - prepare-agent - - - - report - test - - report - - - - + From 66a5493d59fa3743193962b9574f073d3abee50b Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:23:49 +0530 Subject: [PATCH 12/28] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1fcf142ed..026930339 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.8 + 2.7.1 From a09af81b1bb3b22122dd1c23b4abf0c3c93fd5c2 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:25:46 +0530 Subject: [PATCH 13/28] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 026930339..db775f9ce 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.1 + 2.2.1 From 0b74f5f76386a1ff30306766911842b96695101b Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:29:59 +0530 Subject: [PATCH 14/28] Update pom.xml --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index db775f9ce..8e71c7ac2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.1 + 2.2.1.RELEASE @@ -45,7 +45,7 @@ org.springframework.boot spring-boot-maven-plugin - + From 4bd34131571161bda82aaf943a6c908910182a2f Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:32:05 +0530 Subject: [PATCH 15/28] Updated --- Jenkinsfile | 16 ++++++++++++++-- pom.xml | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4464b28bd..d52923be1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,13 +1,25 @@ + pipeline { agent any stages { - stage('Build Artifact - Maven') { steps { sh "mvn clean package -DskipTests=true" archive 'target/*.jar' } } + + stage('Unit Tests - JUnit and Jacoco') { + steps { + sh "mvn test" + } + post { + always { + junit 'target/surefire-reports/*.xml' + jacoco execPattern: 'target/jacoco.exec' + } + } + } } -} +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8e71c7ac2..50682c8fe 100644 --- a/pom.xml +++ b/pom.xml @@ -47,6 +47,26 @@ + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + + prepare-agent + + + + report + test + + report + + + + From 7650c77366635360ef633fc872c7f5b80030a3f3 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:34:09 +0530 Subject: [PATCH 16/28] Updated --- Jenkinsfile | 16 ++-------------- pom.xml | 24 ++---------------------- 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d52923be1..4464b28bd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,25 +1,13 @@ - pipeline { agent any stages { + stage('Build Artifact - Maven') { steps { sh "mvn clean package -DskipTests=true" archive 'target/*.jar' } } - - stage('Unit Tests - JUnit and Jacoco') { - steps { - sh "mvn test" - } - post { - always { - junit 'target/surefire-reports/*.xml' - jacoco execPattern: 'target/jacoco.exec' - } - } - } } -} \ No newline at end of file +} diff --git a/pom.xml b/pom.xml index 50682c8fe..102652128 100644 --- a/pom.xml +++ b/pom.xml @@ -47,26 +47,6 @@ - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - - - prepare-agent - - - - report - test - - report - - - - - - + + \ No newline at end of file From 976467f42d4c56c056532e3ba75ec5c14f5012d2 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:39:23 +0530 Subject: [PATCH 17/28] Updated --- Jenkinsfile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4464b28bd..d52923be1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,13 +1,25 @@ + pipeline { agent any stages { - stage('Build Artifact - Maven') { steps { sh "mvn clean package -DskipTests=true" archive 'target/*.jar' } } + + stage('Unit Tests - JUnit and Jacoco') { + steps { + sh "mvn test" + } + post { + always { + junit 'target/surefire-reports/*.xml' + jacoco execPattern: 'target/jacoco.exec' + } + } + } } -} +} \ No newline at end of file From a83c2919620ab5814931bf11b3c80e16c3219292 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:41:14 +0530 Subject: [PATCH 18/28] Updated --- pom.xml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pom.xml b/pom.xml index 102652128..ddb44759a 100644 --- a/pom.xml +++ b/pom.xml @@ -47,6 +47,27 @@ + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + + prepare-agent + + + + report + test + + report + + + + + \ No newline at end of file From df4a5b42af33c7272d45d704c27f56e15a5e34f5 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:42:49 +0530 Subject: [PATCH 19/28] Update pom.xml --- pom.xml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index ddb44759a..a794b4c66 100644 --- a/pom.xml +++ b/pom.xml @@ -47,26 +47,7 @@ - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - - - prepare-agent - - - - report - test - - report - - - - + From b78eb8c20bbe2ba396ce6700e5a6514b05a4c93b Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:50:23 +0530 Subject: [PATCH 20/28] Updated jenkins --- Jenkinsfile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d52923be1..7f356e0da 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,16 +10,10 @@ pipeline { } } - stage('Unit Tests - JUnit and Jacoco') { + stage('Unit Tests') { steps { sh "mvn test" } - post { - always { - junit 'target/surefire-reports/*.xml' - jacoco execPattern: 'target/jacoco.exec' - } - } + } } } -} \ No newline at end of file From 21e25ea4c3bf1e8a0c12d41caacbe3193c9805c7 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 21:56:45 +0530 Subject: [PATCH 21/28] Updated --- Jenkinsfile | 11 ++++++++--- pom.xml | 22 ++++++++++++++++++++-- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7f356e0da..e5d0d6aea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,3 @@ - pipeline { agent any @@ -10,10 +9,16 @@ pipeline { } } - stage('Unit Tests') { + stage('Unit Tests - JUnit and Jacoco') { steps { sh "mvn test" } - } + post { + always { + junit 'target/surefire-reports/*.xml' + jacoco execPattern: 'target/jacoco.exec' + } + } } } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index a794b4c66..8661ebca0 100644 --- a/pom.xml +++ b/pom.xml @@ -45,9 +45,27 @@ org.springframework.boot spring-boot-maven-plugin - + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + + prepare-agent + + + + report + test + + report + + + + - From 5e161e549ff9f5712e0e7e2c69fd0414c6ca0a7c Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 22:05:54 +0530 Subject: [PATCH 22/28] Building docker image --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index e5d0d6aea..07731cf0c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,7 @@ pipeline { agent any stages { + stage('Build Artifact - Maven') { steps { sh "mvn clean package -DskipTests=true" @@ -20,5 +21,15 @@ pipeline { } } } + + stage('Docker Build and Push') { + steps { + withDockerRegistry([credentialsId: "docker-hub", url: ""]) { + sh 'printenv' + sh 'docker build -t Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT"" .' + sh 'docker push Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT""' + } + } + } } } \ No newline at end of file From b3a443b702c7f56816cc9c4323925419de720408 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 22:17:06 +0530 Subject: [PATCH 23/28] Updated --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 07731cf0c..750db76ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,10 +26,12 @@ pipeline { steps { withDockerRegistry([credentialsId: "docker-hub", url: ""]) { sh 'printenv' + docker.withRegistry(, ){ sh 'docker build -t Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT"" .' sh 'docker push Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT""' } } + } } } } \ No newline at end of file From 4e2dc805d9c8d08090c44b157af3a6458983bacc Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 22:21:15 +0530 Subject: [PATCH 24/28] Updated for docker image --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 750db76ab..25ec6c75b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,13 +25,13 @@ pipeline { stage('Docker Build and Push') { steps { withDockerRegistry([credentialsId: "docker-hub", url: ""]) { - sh 'printenv' docker.withRegistry(, ){ + sh 'printenv' sh 'docker build -t Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT"" .' sh 'docker push Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT""' } } - } } } +} } \ No newline at end of file From a067d33a46a2919042455c170244c56b241d0ac1 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 22:23:02 +0530 Subject: [PATCH 25/28] ok --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 25ec6c75b..95100d15c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ pipeline { stage('Docker Build and Push') { steps { withDockerRegistry([credentialsId: "docker-hub", url: ""]) { - docker.withRegistry(, ){ + docker.withRegistry(, ) { sh 'printenv' sh 'docker build -t Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT"" .' sh 'docker push Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT""' From 370cfd278229a2b0084e0f98e56cd0a9411eaa45 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Sun, 29 Jan 2023 22:24:35 +0530 Subject: [PATCH 26/28] okk --- Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 95100d15c..1aa9d6f6d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,6 @@ pipeline { stage('Docker Build and Push') { steps { withDockerRegistry([credentialsId: "docker-hub", url: ""]) { - docker.withRegistry(, ) { sh 'printenv' sh 'docker build -t Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT"" .' sh 'docker push Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT""' @@ -34,4 +33,3 @@ pipeline { } } } -} \ No newline at end of file From 5ddea2573e9c494ca6959ac191a7c7d28acc2d72 Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Mon, 30 Jan 2023 06:45:36 +0530 Subject: [PATCH 27/28] Updated Jenkins file --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1aa9d6f6d..f258b570b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,8 +26,8 @@ pipeline { steps { withDockerRegistry([credentialsId: "docker-hub", url: ""]) { sh 'printenv' - sh 'docker build -t Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT"" .' - sh 'docker push Devsecops9849/kubernetes-devops-security :""$GIT_COMMIT""' + sh 'docker build -t devsecops9849/devsecopspipeline:""$GIT_COMMIT"" .' + sh 'docker push devsecops9849/devsecopspipeline:""$GIT_COMMIT""' } } } From a33dfb0b349f0d7c23a11f007bbda68cdcb0b35c Mon Sep 17 00:00:00 2001 From: Devsecops9849 Date: Mon, 30 Jan 2023 07:19:29 +0530 Subject: [PATCH 28/28] Updated jenkins file --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f258b570b..67b6dc449 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,7 +26,7 @@ pipeline { steps { withDockerRegistry([credentialsId: "docker-hub", url: ""]) { sh 'printenv' - sh 'docker build -t devsecops9849/devsecopspipeline:""$GIT_COMMIT"" .' + sh 'docker build --tag devsecops9849/devsecopspipeline:""$GIT_COMMIT"" .' sh 'docker push devsecops9849/devsecopspipeline:""$GIT_COMMIT""' } }