From 4af60a6e8485836e531186a4ead80b1e56177118 Mon Sep 17 00:00:00 2001 From: Venkat Nagappan Date: Wed, 8 Apr 2020 13:18:55 +0100 Subject: [PATCH 01/30] Testing pipeline script --- Jenkinsfile | 27 ++------------------------- index.html | 7 ------- myweb.yaml => nginx.yaml | 19 +++++++++---------- 3 files changed, 11 insertions(+), 42 deletions(-) delete mode 100644 index.html rename myweb.yaml => nginx.yaml (62%) diff --git a/Jenkinsfile b/Jenkinsfile index dfa7746..222e125 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,6 @@ pipeline { - environment { - registry = "192.168.1.81:5000/justme/myweb" - dockerImage = "" - } - - agent any + agent { label 'kubepod' } stages { @@ -15,28 +10,10 @@ pipeline { } } - stage('Build image') { - steps{ - script { - dockerImage = docker.build registry + ":$BUILD_NUMBER" - } - } - } - - stage('Push Image') { - steps{ - script { - docker.withRegistry( "" ) { - dockerImage.push() - } - } - } - } - stage('Deploy App') { steps { script { - kubernetesDeploy(configs: "myweb.yaml", kubeconfigId: "mykubeconfig") + kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "mykubeconfig") } } } diff --git a/index.html b/index.html deleted file mode 100644 index 05abbe4..0000000 --- a/index.html +++ /dev/null @@ -1,7 +0,0 @@ -
-

Welcome to Just Me and OpenSource

-

v1.0

-

-

Demo of Jenkins CI/CD Pipeline using BlueOcean and Kubernetes Continuous Deployment plugins

- -
diff --git a/myweb.yaml b/nginx.yaml similarity index 62% rename from myweb.yaml rename to nginx.yaml index fba9532..4a4d855 100644 --- a/myweb.yaml +++ b/nginx.yaml @@ -3,30 +3,29 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app: myweb - name: myweb + app: web + name: mynginx spec: replicas: 1 selector: matchLabels: - app: myweb + app: web template: metadata: labels: - app: myweb + app: web spec: containers: - - image: 192.168.1.81:5000/justme/myweb:1 - imagePullPolicy: Always - name: myweb + - image: nginx + name: mynginx --- apiVersion: v1 kind: Service metadata: labels: - app: myweb - name: myweb + app: web + name: mynginx spec: ports: - nodePort: 32223 @@ -34,5 +33,5 @@ spec: protocol: TCP targetPort: 80 selector: - app: myweb + app: web type: NodePort From 3d59eaf65d84cbb5572b2d91806275db4f24ba9b Mon Sep 17 00:00:00 2001 From: Venkat Nagappan Date: Wed, 8 Apr 2020 13:20:23 +0100 Subject: [PATCH 02/30] Removed Dockerfile --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 56c3134..0000000 --- a/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM httpd:2.4 -COPY ./index.html /usr/local/apache2/htdocs/ From 7f65dea89808e93ac59da230db14c3a584f3a8d4 Mon Sep 17 00:00:00 2001 From: Venkat Nagappan <45001120+justmeandopensource@users.noreply.github.com> Date: Wed, 8 Apr 2020 15:12:55 +0100 Subject: [PATCH 03/30] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 222e125..a28c52e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { stage('Checkout Source') { steps { - git 'https://github.com/justmeandopensource/playjenkins.git' + git url:'https://github.com/justmeandopensource/playjenkins.git' branch:'test-deploy-stage' } } From 4f2b16fcd01a65d525dbea975187824a013d1699 Mon Sep 17 00:00:00 2001 From: Venkat Nagappan <45001120+justmeandopensource@users.noreply.github.com> Date: Wed, 8 Apr 2020 15:14:10 +0100 Subject: [PATCH 04/30] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a28c52e..9c50be3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { stage('Checkout Source') { steps { - git url:'https://github.com/justmeandopensource/playjenkins.git' branch:'test-deploy-stage' + git url:'https://github.com/justmeandopensource/playjenkins.git', branch:'test-deploy-stage' } } From 9ac224103211c745ef85a41c6b067ae90d0b1e43 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Tue, 26 Oct 2021 08:52:21 +0700 Subject: [PATCH 05/30] update cicd dev --- Jenkinsfile | 6 +++--- nginx.yaml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9c50be3..16907b6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,19 +1,19 @@ pipeline { - agent { label 'kubepod' } + agent { label 'jenkins-agent' } stages { stage('Checkout Source') { steps { - git url:'https://github.com/justmeandopensource/playjenkins.git', branch:'test-deploy-stage' + git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-stage' } } stage('Deploy App') { steps { script { - kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "mykubeconfig") + kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "kubeconfigdev") } } } diff --git a/nginx.yaml b/nginx.yaml index 4a4d855..59642a7 100644 --- a/nginx.yaml +++ b/nginx.yaml @@ -5,6 +5,7 @@ metadata: labels: app: web name: mynginx + namespace: dungla spec: replicas: 1 selector: @@ -26,6 +27,7 @@ metadata: labels: app: web name: mynginx + namespace: dungla spec: ports: - nodePort: 32223 From 0ad7ba5bb90c2885795a8beee1a670d65bfca3c0 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Tue, 26 Oct 2021 13:58:53 +0700 Subject: [PATCH 06/30] update cicd dev --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 16907b6..f24c85a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,7 @@ pipeline { stage('Deploy App') { steps { script { + sh 'ls -la' kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "kubeconfigdev") } } From 92b681e8427021389ebf54dd25f1dda609f36bf1 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Tue, 26 Oct 2021 14:03:41 +0700 Subject: [PATCH 07/30] update cicd dev --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f24c85a..72183a1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,8 +12,8 @@ pipeline { stage('Deploy App') { steps { + sh 'ls -la' script { - sh 'ls -la' kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "kubeconfigdev") } } From 74ab22aa5705058f9532115f5f24d18cacb64a17 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Tue, 26 Oct 2021 16:37:50 +0700 Subject: [PATCH 08/30] update cicd dev docker --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 72183a1..9dc39c1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,7 @@ pipeline { stage('Deploy App') { steps { sh 'ls -la' + sh 'docker info' script { kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "kubeconfigdev") } From 781cfd5478827283f764dcb1370b3c25695394b5 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Wed, 27 Oct 2021 09:02:53 +0700 Subject: [PATCH 09/30] update cicd dev --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9dc39c1..72183a1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,6 @@ pipeline { stage('Deploy App') { steps { sh 'ls -la' - sh 'docker info' script { kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "kubeconfigdev") } From 387a4977f7d8869a813a2fed105e84e9a4d72ab1 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Thu, 28 Oct 2021 10:03:57 +0700 Subject: [PATCH 10/30] update cicd --- Jenkinsfile | 34 ++++++++++++---------------------- Jenkinsfile.bak | 27 +++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 Jenkinsfile.bak diff --git a/Jenkinsfile b/Jenkinsfile index 72183a1..c038b67 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,24 +1,14 @@ -pipeline { - - agent { label 'jenkins-agent' } - - stages { - - stage('Checkout Source') { - steps { - git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-stage' - } - } - - stage('Deploy App') { - steps { - sh 'ls -la' - script { - kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "kubeconfigdev") +podTemplate(containers: [ + containerTemplate(name: 'maven', image: 'maven:3.8.1-jdk-8', command: 'sleep', args: '99d'), + containerTemplate(name: 'golang', image: 'golang:1.16.5', command: 'sleep', args: '99d') +]) + node(POD_LABEL) { + stage('Get a Maven project') { + git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-stage' + container('maven') { + stage('Build a Maven project') { + sh 'echo "helloooooooooooooooooooooooooooooooooooooo!!!!!!"' + } + } } - } - } - - } -} diff --git a/Jenkinsfile.bak b/Jenkinsfile.bak new file mode 100644 index 0000000..6f96c68 --- /dev/null +++ b/Jenkinsfile.bak @@ -0,0 +1,27 @@ +podTemplate(containers: [ + containerTemplate(name: 'maven', image: 'maven:3.8.1-jdk-8', command: 'sleep', args: '99d') +]) +pipeline { + + agent { label 'jenkins-agent' } + + stages { + + stage('Checkout Source') { + steps { + git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-stage' + } + } + + stage('Deploy App') { + steps { + sh 'ls -la' + script { + kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "kubeconfigdev") + } + } + } + + } + +} From 83535aef711c9de583e4efd79aefb01c56ea833c Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Thu, 28 Oct 2021 10:10:57 +0700 Subject: [PATCH 11/30] update cicd --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c038b67..e830e63 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,4 +11,10 @@ podTemplate(containers: [ } } } - +} + post { + always { + cleanWs() + } + } +} From e7412bb8b1c64af62ea58e57525225ed09614f3d Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Thu, 28 Oct 2021 10:13:31 +0700 Subject: [PATCH 12/30] update cicd --- Jenkinsfile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e830e63..7686c61 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,9 +12,4 @@ podTemplate(containers: [ } } } - post { - always { - cleanWs() - } - } -} + From 8033778ca0888004fcf6286f99cddb37d1a6ea71 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Thu, 28 Oct 2021 10:17:50 +0700 Subject: [PATCH 13/30] update cicd --- Jenkinsfile | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7686c61..1b88bfb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,15 +1,20 @@ -podTemplate(containers: [ - containerTemplate(name: 'maven', image: 'maven:3.8.1-jdk-8', command: 'sleep', args: '99d'), - containerTemplate(name: 'golang', image: 'golang:1.16.5', command: 'sleep', args: '99d') -]) - node(POD_LABEL) { - stage('Get a Maven project') { - git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-stage' - container('maven') { - stage('Build a Maven project') { - sh 'echo "helloooooooooooooooooooooooooooooooooooooo!!!!!!"' - } - } - } +pipeline { + agent { + kubernetes { + //cloud 'kubernetes' + containerTemplate { + name 'maven' + image 'maven:3.8.1-jdk-8' + command 'sleep' + args '99d' + } + } + } + stages { + stage('Run maven') { + steps { + sh 'mvn -version' + } + } +} } - From c4dfc20924ebe9565ab72a7abd03c843f63431a5 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Thu, 28 Oct 2021 17:31:39 +0700 Subject: [PATCH 14/30] update cicd --- Jenkinsfile | 31 ++++++++++++++++++------------- Jenkinsfile.bak2 | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 Jenkinsfile.bak2 diff --git a/Jenkinsfile b/Jenkinsfile index 1b88bfb..da29a43 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,20 +1,25 @@ pipeline { - agent { - kubernetes { - //cloud 'kubernetes' - containerTemplate { - name 'maven' - image 'maven:3.8.1-jdk-8' - command 'sleep' - args '99d' + + agent { label 'jenkins-agent' } + + stages { + + stage('Checkout Source') { + steps { + git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-stage' } } - } - stages { - stage('Run maven') { + + stage('Deploy App') { steps { - sh 'mvn -version' + sh 'ls -la' + sh 'java --version' + script { + kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "kubeconfigdev") + } } + } + } -} + } diff --git a/Jenkinsfile.bak2 b/Jenkinsfile.bak2 new file mode 100644 index 0000000..1b88bfb --- /dev/null +++ b/Jenkinsfile.bak2 @@ -0,0 +1,20 @@ +pipeline { + agent { + kubernetes { + //cloud 'kubernetes' + containerTemplate { + name 'maven' + image 'maven:3.8.1-jdk-8' + command 'sleep' + args '99d' + } + } + } + stages { + stage('Run maven') { + steps { + sh 'mvn -version' + } + } +} +} From 3c4c552bed1a39dac853f8e02014dfb35468627c Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Thu, 28 Oct 2021 21:40:26 +0700 Subject: [PATCH 15/30] update cicd --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index da29a43..ada8e4d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { stage('Deploy App') { steps { sh 'ls -la' - sh 'java --version' + sh 'java -version' script { kubernetesDeploy(configs: "nginx.yaml", kubeconfigId: "kubeconfigdev") } From 46b821c6320ce10d9ab0829faa8736903dbc4bda Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Thu, 28 Oct 2021 21:47:42 +0700 Subject: [PATCH 16/30] update cicd --- nginx.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.yaml b/nginx.yaml index 59642a7..f9fb053 100644 --- a/nginx.yaml +++ b/nginx.yaml @@ -4,7 +4,7 @@ kind: Deployment metadata: labels: app: web - name: mynginx + name: mynginx111 namespace: dungla spec: replicas: 1 From e6e90784d4519283a68ac483c5a5779c288bbbcd Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Fri, 29 Oct 2021 08:38:45 +0700 Subject: [PATCH 17/30] update test --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ada8e4d..20ed84b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { stage('Checkout Source') { steps { - git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-stage' + git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-dungla' } } From 6602a8de8d20a09c91c593c251c717ecc99855f1 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Sun, 7 Nov 2021 10:34:50 +0700 Subject: [PATCH 18/30] update --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 20ed84b..89544c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ pipeline { - agent { label 'jenkins-agent' } + agent { label 'jenkins-docker-agent' } stages { @@ -12,6 +12,7 @@ pipeline { stage('Deploy App') { steps { + docker info sh 'ls -la' sh 'java -version' script { From 0b5adfeecc5c818411207769188e2208d5630de4 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Sun, 7 Nov 2021 11:42:15 +0700 Subject: [PATCH 19/30] update --- Dockerfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8bd0a7f --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ +FROM nginx From b9863c11b13f722ea90c24f7352179a678a57353 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Sun, 7 Nov 2021 15:00:32 +0700 Subject: [PATCH 20/30] update --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 89544c6..f5bd228 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { stage('Deploy App') { steps { - docker info + sh 'docker build -t a:b -f Dockerfile .' sh 'ls -la' sh 'java -version' script { From 16b0b775d95da2127bd0726028f7aea4bd79e794 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Sun, 7 Nov 2021 16:06:36 +0700 Subject: [PATCH 21/30] update --- Jenkinsfile | 1 + pod2.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 pod2.yml diff --git a/Jenkinsfile b/Jenkinsfile index f5bd228..d5a09a7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,6 +11,7 @@ pipeline { } stage('Deploy App') { + container('jenkins-docker-agent') steps { sh 'docker build -t a:b -f Dockerfile .' sh 'ls -la' diff --git a/pod2.yml b/pod2.yml new file mode 100644 index 0000000..ee237b8 --- /dev/null +++ b/pod2.yml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Pod +metadata: + name: dood +spec: + containers: + - name: docker-cmds + image: docker:1.12.6 + command: ['docker', 'run', '-p', '80:80', 'httpd:latest'] + resources: + requests: + cpu: 10m + memory: 256Mi + volumeMounts: + - mountPath: /var/run + name: docker-sock + volumes: + - name: docker-sock + hostPath: + path: /var/run From f4fc3bcb13ac3e9a2df9b87272f9400707774ca1 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Sun, 7 Nov 2021 16:07:39 +0700 Subject: [PATCH 22/30] update --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d5a09a7..afc46e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { agent { label 'jenkins-docker-agent' } stages { - + container('jenkins-docker-agent') stage('Checkout Source') { steps { git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-dungla' @@ -11,7 +11,6 @@ pipeline { } stage('Deploy App') { - container('jenkins-docker-agent') steps { sh 'docker build -t a:b -f Dockerfile .' sh 'ls -la' From ffaf71319dd3bb511e3c132013fc3920097215fb Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Sun, 7 Nov 2021 16:34:49 +0700 Subject: [PATCH 23/30] update --- Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index afc46e1..7224b50 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,12 +3,21 @@ pipeline { agent { label 'jenkins-docker-agent' } stages { - container('jenkins-docker-agent') stage('Checkout Source') { steps { git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-dungla' } } + stage('Pushing Image') { + environment { + registryCredential = 'dockerloginnexus' + } + steps{ + script { + docker.withRegistry( 'https://nexus.api-connect.io', registryCredential ) + } + } + } stage('Deploy App') { steps { From a01866982f055eeb3e37e9ad51f79e2a9bdb4e3a Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Sun, 7 Nov 2021 16:44:06 +0700 Subject: [PATCH 24/30] update --- Jenkinsfile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7224b50..3ec5a7b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,20 +8,13 @@ pipeline { git url:'https://github.com/ladung/playjenkins.git', branch:'test-deploy-dungla' } } - stage('Pushing Image') { - environment { - registryCredential = 'dockerloginnexus' - } - steps{ - script { - docker.withRegistry( 'https://nexus.api-connect.io', registryCredential ) - } + stage('Docker build') { + steps { + sh 'docker build -t a:b -f Dockerfile .' } } - stage('Deploy App') { steps { - sh 'docker build -t a:b -f Dockerfile .' sh 'ls -la' sh 'java -version' script { From 4d3b5e90a0e7f23fad87a189f64e9de3a0526076 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Sun, 7 Nov 2021 17:38:33 +0700 Subject: [PATCH 25/30] update --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3ec5a7b..4ba0ad7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,8 @@ pipeline { } } stage('Docker build') { - steps { + container('jenkins-docker-agent') { + sh 'docker version' sh 'docker build -t a:b -f Dockerfile .' } } From a16c06e0b46467874088f04d80d65a1b3b2e9d24 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Sun, 7 Nov 2021 17:45:54 +0700 Subject: [PATCH 26/30] update --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 4ba0ad7..d2b3302 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,11 +9,13 @@ pipeline { } } stage('Docker build') { + steps { container('jenkins-docker-agent') { sh 'docker version' sh 'docker build -t a:b -f Dockerfile .' } } +} stage('Deploy App') { steps { sh 'ls -la' From a720f8eb46e8c12996f385cd83f237fcdcad8b51 Mon Sep 17 00:00:00 2001 From: ladung <43999277+ladung@users.noreply.github.com> Date: Wed, 10 Nov 2021 17:39:09 +0700 Subject: [PATCH 27/30] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d2b3302..0cbcce6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { } stage('Docker build') { steps { - container('jenkins-docker-agent') { + container('docker-dind') { sh 'docker version' sh 'docker build -t a:b -f Dockerfile .' } From e878405fb3c9127f1dd50cb3086d7f77168cf3a6 Mon Sep 17 00:00:00 2001 From: ladung <43999277+ladung@users.noreply.github.com> Date: Wed, 10 Nov 2021 17:43:10 +0700 Subject: [PATCH 28/30] Update nginx.yaml --- nginx.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.yaml b/nginx.yaml index f9fb053..eb12519 100644 --- a/nginx.yaml +++ b/nginx.yaml @@ -30,7 +30,7 @@ metadata: namespace: dungla spec: ports: - - nodePort: 32223 + - nodePort: 32224 port: 80 protocol: TCP targetPort: 80 From 698a3665e0687fcd1cbb7b1cc11dd0cf11adff18 Mon Sep 17 00:00:00 2001 From: ladung <43999277+ladung@users.noreply.github.com> Date: Wed, 10 Nov 2021 17:43:54 +0700 Subject: [PATCH 29/30] Update nginx.yaml --- nginx.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.yaml b/nginx.yaml index eb12519..5a180e2 100644 --- a/nginx.yaml +++ b/nginx.yaml @@ -17,7 +17,7 @@ spec: app: web spec: containers: - - image: nginx + - image: nginx:alpine name: mynginx --- From 54ac155be1cbac7db19531252dfbf9c571004129 Mon Sep 17 00:00:00 2001 From: Dung Le Anh Date: Fri, 12 Nov 2021 10:05:49 +0700 Subject: [PATCH 30/30] update build --- Jenkinsfile | 2 +- nginx.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d2b3302..0cbcce6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { } stage('Docker build') { steps { - container('jenkins-docker-agent') { + container('docker-dind') { sh 'docker version' sh 'docker build -t a:b -f Dockerfile .' } diff --git a/nginx.yaml b/nginx.yaml index f9fb053..14820d9 100644 --- a/nginx.yaml +++ b/nginx.yaml @@ -17,7 +17,7 @@ spec: app: web spec: containers: - - image: nginx + - image: nginx:$BUILD_NUMBER name: mynginx ---