From 8a2badb8f62c1f71f6f928caa5a2b229547d19dd Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Mon, 27 Jun 2022 16:58:17 +0530 Subject: [PATCH 01/13] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index dfa7746..0589665 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { environment { - registry = "192.168.1.81:5000/justme/myweb" + registry = "localhost:50000/justme/myweb" dockerImage = "" } From a3e1d1731f0595693236d9420901dccae5758708 Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Wed, 29 Jun 2022 16:06:58 +0530 Subject: [PATCH 02/13] Update and rename myweb.yaml to testpod.yaml --- myweb.yaml | 38 -------------------------- testpod.yaml | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 38 deletions(-) delete mode 100644 myweb.yaml create mode 100644 testpod.yaml diff --git a/myweb.yaml b/myweb.yaml deleted file mode 100644 index fba9532..0000000 --- a/myweb.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: myweb - name: myweb -spec: - replicas: 1 - selector: - matchLabels: - app: myweb - template: - metadata: - labels: - app: myweb - spec: - containers: - - image: 192.168.1.81:5000/justme/myweb:1 - imagePullPolicy: Always - name: myweb - ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: myweb - name: myweb -spec: - ports: - - nodePort: 32223 - port: 80 - protocol: TCP - targetPort: 80 - selector: - app: myweb - type: NodePort diff --git a/testpod.yaml b/testpod.yaml new file mode 100644 index 0000000..98c7ed8 --- /dev/null +++ b/testpod.yaml @@ -0,0 +1,77 @@ +--- +kind: Pod +apiVersion: v1 +metadata: + name: testpod +spec: + containers: + - name: c01 + image: httpd + ports: + - containerPort: 80 +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: testpod +spec: + replicas: 1 + selector: # tells the controller which pods to watch/belong to + matchLabels: + name: deployment + template: + metadata: + name: testpod1 + labels: + name: deployment + spec: + containers: + - name: c00 + image: httpd + ports: + - containerPort: 80 +--- +kind: Service # Defines to create Service type Object +apiVersion: v1 +metadata: + name: testpod +spec: + ports: + - port: 80 # Containers port exposed + targetPort: 80 # Pods port + selector: + name: deployment # Apply this service to any pods which has the specific label + type: NodePort + # Specifies the service type i.e ClusterIP or NodePort +--- + +kind: ReplicationController +apiVersion: v1 +metadata: + name: testpod +spec: + replicas: 2 + selector: + myname: deployment + template: + metadata: + name: testpod + labels: + myname: deployment + spec: + containers: + - name: c01 + image: httpd + command: ["/bin/bash", "-c", "while true; do echo Hello-Bhupinder; sleep 5 ; done"] +--- +kind: Service # Defines to create Service type Object +apiVersion: v1 +metadata: + name: testpod +spec: + ports: + - port: 80 # Containers port exposed + targetPort: 80 # Pods port + selector: + name: deployment # Apply this service to any pods which has the specific label + type: LoadBalancer From 26fd4a135369a0e0fcc7c2a3fea1012d79a6a96c Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Wed, 29 Jun 2022 16:22:35 +0530 Subject: [PATCH 03/13] Update Jenkinsfile --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0589665..c4dad68 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { environment { - registry = "localhost:50000/justme/myweb" + registry = "localhost:50000" dockerImage = "" } @@ -11,7 +11,7 @@ pipeline { stage('Checkout Source') { steps { - git 'https://github.com/justmeandopensource/playjenkins.git' + git 'https://github.com/jhasourav141/playjenkins.git' } } @@ -36,7 +36,7 @@ pipeline { stage('Deploy App') { steps { script { - kubernetesDeploy(configs: "myweb.yaml", kubeconfigId: "mykubeconfig") + kubernetesDeploy(configs: "testpod.yaml", kubeconfigId: "mykubeconfig") } } } From 4c4ce6496e099077bf9d12394ff6e0f4ab15c7bd Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Fri, 1 Jul 2022 10:24:33 +0530 Subject: [PATCH 04/13] Update Jenkinsfile --- Jenkinsfile | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c4dad68..0b92e17 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,12 +1,5 @@ pipeline { - - environment { - registry = "localhost:50000" - dockerImage = "" - } - - agent any - +agent any stages { stage('Checkout Source') { @@ -15,23 +8,7 @@ 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 { From 1cd5d46925f11ff291c4f7ed4aeded20bdbe5c37 Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Wed, 6 Jul 2022 10:40:44 +0530 Subject: [PATCH 05/13] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0b92e17..fc720fc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ agent any stage('Deploy App') { steps { script { - kubernetesDeploy(configs: "testpod.yaml", kubeconfigId: "mykubeconfig") + kubernetesDeploy(configs: "testpod.yaml") } } } From eaee49054eb9f5f9d3656f8d537a80a01039e1f1 Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Wed, 6 Jul 2022 10:57:44 +0530 Subject: [PATCH 06/13] Delete 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 048b5aa80e6571a22e15905947b6d8d02f0f6737 Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Wed, 6 Jul 2022 10:57:56 +0530 Subject: [PATCH 07/13] Delete index.html --- index.html | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 index.html 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

- -
From aab5b21e8c2d384f7acdca189ab30f0c66e4fcbe Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Wed, 6 Jul 2022 10:58:12 +0530 Subject: [PATCH 08/13] Delete README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index d480ad6..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# playjenkins -Jenkins Playground From 3e4970a28109b55e67dfdff8271e5fa5d38066e4 Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:59:47 +0530 Subject: [PATCH 09/13] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fc720fc..bc5cbad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ agent any stage('Deploy App') { steps { script { - kubernetesDeploy(configs: "testpod.yaml") + kubernetesDeploy(configs: "testpod.yaml , configid: config ") } } } From 8d32bf8bedfdc75966b9de7e4a9331ccbe1fe27d Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Wed, 6 Jul 2022 15:25:31 +0530 Subject: [PATCH 10/13] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bc5cbad..317bbdb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ agent any stage('Deploy App') { steps { script { - kubernetesDeploy(configs: "testpod.yaml , configid: config ") + kubernetesDeploy(configs: "testpod.yaml" , configId: "kubernetes ") } } } From 265c655b0291942fcf725089db857d008deea9fa Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Thu, 7 Jul 2022 16:58:59 +0530 Subject: [PATCH 11/13] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 317bbdb..676d92c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ agent any stage('Deploy App') { steps { script { - kubernetesDeploy(configs: "testpod.yaml" , configId: "kubernetes ") + kubernetesDeploy(configs: 'testpod.yaml' , configId: 'kubernetes') } } } From fba58bd45075095f18c2b01e1d9c18bdf5559273 Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Thu, 7 Jul 2022 18:03:26 +0530 Subject: [PATCH 12/13] Update Jenkinsfile --- Jenkinsfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 676d92c..83f6624 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,9 +11,11 @@ agent any stage('Deploy App') { - steps { - script { - kubernetesDeploy(configs: 'testpod.yaml' , configId: 'kubernetes') + steps { + echo 'deploying the application' + echo "deploying with ${my-kubeconfig}" + bat '${my-kubeconfig}' + } } } @@ -21,3 +23,6 @@ agent any } } + + + From 42fdc1c6f90791a23d6a7339663031915e80b9bb Mon Sep 17 00:00:00 2001 From: Sourav Kumar Jha <60103363+jhasourav141@users.noreply.github.com> Date: Thu, 7 Jul 2022 18:06:05 +0530 Subject: [PATCH 13/13] Update Jenkinsfile --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 83f6624..a3e0502 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,12 +17,12 @@ agent any bat '${my-kubeconfig}' } - } - } - - } + } + + } } +