From 7c7e792ae3bc5d7ee004e4032c0221118b1daa62 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:32:56 +0530 Subject: [PATCH 001/116] Create jenkinsfile --- jenkinsfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 jenkinsfile diff --git a/jenkinsfile b/jenkinsfile new file mode 100644 index 000000000..8cdb8bd50 --- /dev/null +++ b/jenkinsfile @@ -0,0 +1,17 @@ +pipeline{ + agent {lable 'java'} + stages{ + stage{'checkout'} { + steps{ + sh 'rm -rf hello-world-war' + sh 'git clone https://github.com/tarundanda147/hello-world-war/' + } +} + stage('build') { + steps { + sh 'mvn --version' + sh 'mvn clean install' + } + } + } +} From b7ba9497f172385fd4ef443a0f209ce486bb7994 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:39:08 +0530 Subject: [PATCH 002/116] Rename jenkinsfile to Jenkinsfile --- jenkinsfile => Jenkinsfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jenkinsfile => Jenkinsfile (100%) diff --git a/jenkinsfile b/Jenkinsfile similarity index 100% rename from jenkinsfile rename to Jenkinsfile From c2b32fcb500d544b5412808e498c6456749b8c36 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:40:47 +0530 Subject: [PATCH 003/116] Update Jenkinsfile --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8cdb8bd50..6c2e5da43 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,8 @@ -pipeline{ +pipeline { agent {lable 'java'} stages{ - stage{'checkout'} { - steps{ + stage('checkout') { + steps { sh 'rm -rf hello-world-war' sh 'git clone https://github.com/tarundanda147/hello-world-war/' } From 1bde0c2fd587b19c1c1119f6ffe833fa353cb4e8 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:41:35 +0530 Subject: [PATCH 004/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6c2e5da43..5c470ae9d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent {lable 'java'} + agent {label 'java'} stages{ stage('checkout') { steps { From ecfe6ee587b07210e9248ad9a8713b5cbe4a9e8c Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:08:05 +0530 Subject: [PATCH 005/116] Update Jenkinsfile --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5c470ae9d..4889aa543 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,6 +11,11 @@ pipeline { steps { sh 'mvn --version' sh 'mvn clean install' + } + } + stage('deploy') { + steps { + cp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war /opt/apache-tomcat-9.0.85/webapps } } } From 87b90c4b6189227731bf9fdeac31d89610e4b83f Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:15:00 +0530 Subject: [PATCH 006/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4889aa543..6bb61e6a8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { } stage('deploy') { steps { - cp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war /opt/apache-tomcat-9.0.85/webapps + sh 'cp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war /opt/apache-tomcat-9.0.85/webapps' } } } From 6f9393f8843915f0938042b98e6993865b1882f4 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:26:35 +0530 Subject: [PATCH 007/116] Update Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6bb61e6a8..e20ced645 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,9 @@ pipeline { } stage('deploy') { steps { - sh 'cp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war /opt/apache-tomcat-9.0.85/webapps' + sh 'cp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war /opt/apache-tomcat-9.0.85/webapps' + sh '/opt/apache-tomcat-9.0.85/bin/shutdown.sh' + sh '/opt/apache-tomcat-9.0.85/bin/startup.sh' } } } From 7d2a53af6e66945aa76f0f6b22431d030dea3584 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:25:31 +0530 Subject: [PATCH 008/116] Update Jenkinsfile --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e20ced645..fb87a9a0e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,8 @@ pipeline { } stage('deploy') { steps { - sh 'cp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war /opt/apache-tomcat-9.0.85/webapps' + sh 'ssh root@172.31.9.118' + sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' sh '/opt/apache-tomcat-9.0.85/bin/shutdown.sh' sh '/opt/apache-tomcat-9.0.85/bin/startup.sh' } From 1e3d9e7616c1ed8220d16e0b75a44b8aab6a6f46 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:29:42 +0530 Subject: [PATCH 009/116] Update Jenkinsfile --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fb87a9a0e..383c0431b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,8 +17,10 @@ pipeline { steps { sh 'ssh root@172.31.9.118' sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' - sh '/opt/apache-tomcat-9.0.85/bin/shutdown.sh' - sh '/opt/apache-tomcat-9.0.85/bin/startup.sh' + sh 'cd /opt/apache-tomcat-9.0.85/bin/' + sh './shutdown.sh' + sh '/opt/apache-tomcat-9.0.85/bin/' + sh './startup.sh' } } } From 1b44c29c1383e90ee55061ec9aa9c8a5d6559ccc Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:31:35 +0530 Subject: [PATCH 010/116] Update Jenkinsfile --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 383c0431b..fb87a9a0e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,10 +17,8 @@ pipeline { steps { sh 'ssh root@172.31.9.118' sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' - sh 'cd /opt/apache-tomcat-9.0.85/bin/' - sh './shutdown.sh' - sh '/opt/apache-tomcat-9.0.85/bin/' - sh './startup.sh' + sh '/opt/apache-tomcat-9.0.85/bin/shutdown.sh' + sh '/opt/apache-tomcat-9.0.85/bin/startup.sh' } } } From 056db2aedd17b1457733502594eaefeac1c04e41 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:37:42 +0530 Subject: [PATCH 011/116] Update Jenkinsfile --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index fb87a9a0e..c02bfe233 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,6 +17,15 @@ pipeline { steps { sh 'ssh root@172.31.9.118' sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' + } + } + stage('restart') { + steps { + script { + sh "ls -l /opt/apache-tomcat-9.0.85/bin/catalina.sh" + sh "ls -l /opt/apache-tomcat-9.0.85/bin/shutdown.sh" + sh "chmod +x /opt/apache-tomcat-9.0.85/bin/*.sh" + sh "/opt/apache-tomcat-9.0.85/bin/shutdown.sh" sh '/opt/apache-tomcat-9.0.85/bin/shutdown.sh' sh '/opt/apache-tomcat-9.0.85/bin/startup.sh' } From 40c2bf1d4f148e741a11c430cf1942c98f91f7bd Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:39:36 +0530 Subject: [PATCH 012/116] Update Jenkinsfile --- Jenkinsfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c02bfe233..da20da756 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,11 +21,10 @@ pipeline { } stage('restart') { steps { - script { - sh "ls -l /opt/apache-tomcat-9.0.85/bin/catalina.sh" - sh "ls -l /opt/apache-tomcat-9.0.85/bin/shutdown.sh" - sh "chmod +x /opt/apache-tomcat-9.0.85/bin/*.sh" - sh "/opt/apache-tomcat-9.0.85/bin/shutdown.sh" + sh 'ls -l /opt/apache-tomcat-9.0.85/bin/catalina.sh' + sh 'ls -l /opt/apache-tomcat-9.0.85/bin/shutdown.sh' + sh 'chmod +x /opt/apache-tomcat-9.0.85/bin/*.sh' + sh '/opt/apache-tomcat-9.0.85/bin/shutdown.sh' sh '/opt/apache-tomcat-9.0.85/bin/shutdown.sh' sh '/opt/apache-tomcat-9.0.85/bin/startup.sh' } From bbbe9df688c05a16c62a017652c7c64485749dff Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:40:55 +0530 Subject: [PATCH 013/116] Update Jenkinsfile --- Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index da20da756..3b670118e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,10 +21,6 @@ pipeline { } stage('restart') { steps { - sh 'ls -l /opt/apache-tomcat-9.0.85/bin/catalina.sh' - sh 'ls -l /opt/apache-tomcat-9.0.85/bin/shutdown.sh' - sh 'chmod +x /opt/apache-tomcat-9.0.85/bin/*.sh' - sh '/opt/apache-tomcat-9.0.85/bin/shutdown.sh' sh '/opt/apache-tomcat-9.0.85/bin/shutdown.sh' sh '/opt/apache-tomcat-9.0.85/bin/startup.sh' } From 19a09bf6ac8a3121b25084a70deb9a0b9571ee60 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:42:37 +0530 Subject: [PATCH 014/116] Update Jenkinsfile --- Jenkinsfile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3b670118e..d620d1bde 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,12 +17,7 @@ pipeline { steps { sh 'ssh root@172.31.9.118' sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' - } - } - stage('restart') { - steps { - sh '/opt/apache-tomcat-9.0.85/bin/shutdown.sh' - sh '/opt/apache-tomcat-9.0.85/bin/startup.sh' + } } } From eb9a68773a449161e1ededb7d8d17a0468c4e54e Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 14:59:53 +0530 Subject: [PATCH 015/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d620d1bde..1790d5ad2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { stage('deploy') { steps { sh 'ssh root@172.31.9.118' - sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' + sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0 root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' } } From 1878379a7e00d706ca3dae4e949753211d0f5833 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 15:07:14 +0530 Subject: [PATCH 016/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1790d5ad2..d620d1bde 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { stage('deploy') { steps { sh 'ssh root@172.31.9.118' - sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0 root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' + sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' } } From 1449ccd78ec88c005248357f9e000341eaca3bab Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 15:10:45 +0530 Subject: [PATCH 017/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d620d1bde..2af972c61 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { stage('deploy') { steps { sh 'ssh root@172.31.9.118' - sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' + sh 'scp /home/slave4/workspace/apachetomcat/target/ root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' } } From 573d94c1ae38e14163eb734b7490592d87423ca3 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 15:36:33 +0530 Subject: [PATCH 018/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2af972c61..d620d1bde 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { stage('deploy') { steps { sh 'ssh root@172.31.9.118' - sh 'scp /home/slave4/workspace/apachetomcat/target/ root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' + sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' } } From 2df276372b49c7c2eeb5bc11a8c31ed6ffa5d09b Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Jan 2024 20:53:31 +0530 Subject: [PATCH 019/116] Update Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d620d1bde..0edd2a287 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,6 @@ pipeline { } stage('deploy') { steps { - sh 'ssh root@172.31.9.118' sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' } From 4d1bcceb9b9b084cf374229094da59968fca19ae Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:04:07 +0530 Subject: [PATCH 020/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0edd2a287..dedacc06b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { } stage('deploy') { steps { - sh 'scp /home/slave4/workspace/apachetomcat/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' + sh 'scp /home/slave4/workspace/hello-world-war/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' } } From bfa18bd5da6575669e708af587bbc2daaa332867 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Fri, 19 Jan 2024 19:40:38 +0530 Subject: [PATCH 021/116] Create artifactory --- artifactory | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 artifactory diff --git a/artifactory b/artifactory new file mode 100644 index 000000000..64c1294cc --- /dev/null +++ b/artifactory @@ -0,0 +1,60 @@ +pipeline { + agent { label 'java' } + stages { + stage('checkout') { + steps { + sh 'rm -rf bus_booking' + sh 'git clone https://github.com/tarundanda147/bus_booking.git' + } + } + + stage('build') { + steps { + script { + sh "mvn clean install" + } + } + } + stage('Deploy to JFrog Artifactory') { + steps { + // Remember this is the step which I followed for free style project. + script { + rtServer( + id: "Artifact", + url: "http://13.238.154.172:8081/artifactory", + username: "jenkins", + password: "1390149a" + ) + } + } + } + + stage('Upload') { + steps { + script { + // For my undertanding rtUpload is a part of jFrog Artifactory plugin to upload artifacts to artifacts repo + rtUpload ( + serverId: 'Artifact', + spec: '''{ + "files": [ + { + "pattern": "target/*.jar", + "target": "libs-release-local/" + } + ] + }''' + ) + } + } + } + + stage('Publish build info') { + steps { + script { + // For my understanding to publish build info + rtPublishBuildInfo serverId: "Artifact" + } + } + } + } +} From 86c67102aa3ccd783b8506da6624cb91b51af9a1 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Fri, 19 Jan 2024 19:51:28 +0530 Subject: [PATCH 022/116] Update artifactory --- artifactory | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifactory b/artifactory index 64c1294cc..9024f0ad4 100644 --- a/artifactory +++ b/artifactory @@ -23,7 +23,7 @@ pipeline { id: "Artifact", url: "http://13.238.154.172:8081/artifactory", username: "jenkins", - password: "1390149a" + password: "passwd" ) } } From 3a8dfdaaf24f23451c6c2af0341da990139b830b Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Fri, 15 Mar 2024 07:03:26 +0530 Subject: [PATCH 023/116] Update Jenkinsfile --- Jenkinsfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dedacc06b..20fce4eed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,14 +9,15 @@ pipeline { } stage('build') { steps { - sh 'mvn --version' - sh 'mvn clean install' - } + dir(hello-world-war) + { + sh 'docker build -t tomcat-war:1.0 .' + } } stage('deploy') { steps { - sh 'scp /home/slave4/workspace/hello-world-war/target/hello-world-war-1.0.0.war root@172.31.9.118:/opt/apache-tomcat-9.0.85/webapps' - + sh 'docker rm -f tomcat-war' + sh 'docekr run -d -p 5555:8080 --name tomcat-war tomcat-war:1.0' } } } From a24853136f15508a181945cdf09b08ab56ead1fd Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Fri, 15 Mar 2024 07:13:45 +0530 Subject: [PATCH 024/116] Create Dockerfile --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..ec3d4c45c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM maven:3.3-jdk-8 as mavenbuilder +ARG DIR=/home/devops +WORKDIR $DIR +COPY . . +RUN /usr/bin/mvn clean install +RUN ls target/ +RUN which mvn +FROM tomcat:9.0 +ARG DIR=/home/devops/target +COPY --from=mavenbuilder ${DIR}/hello-world-war-1.0.0.war /usr/local/tomcat/webapps/ From d910ea90deb1d4e6ead4a577619753a813077370 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Fri, 15 Mar 2024 07:14:19 +0530 Subject: [PATCH 025/116] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 20fce4eed..fc0bbac0c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,7 @@ pipeline { { sh 'docker build -t tomcat-war:1.0 .' } + } } stage('deploy') { steps { From 1575f67607748792320e26354e85631587fcbd3f Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Fri, 15 Mar 2024 07:19:42 +0530 Subject: [PATCH 026/116] Update Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fc0bbac0c..53ecd9c47 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,9 @@ pipeline { } stage('build') { steps { - dir(hello-world-war) + sh 'echo "inside build" + dir("hello-world-war") + sh 'echo "inside dir"' { sh 'docker build -t tomcat-war:1.0 .' } From e653914229124b0d41a4113f40fe6baf4bf2f4a6 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Fri, 15 Mar 2024 07:24:20 +0530 Subject: [PATCH 027/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 53ecd9c47..951af3d22 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent {label 'java'} + agent any stages{ stage('checkout') { steps { From a377b63599ee631dd34becc75f0d440edd26d5fe Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Fri, 15 Mar 2024 07:26:20 +0530 Subject: [PATCH 028/116] Update Jenkinsfile --- Jenkinsfile | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 951af3d22..2b39958b9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,27 +1,26 @@ pipeline { - agent any - stages{ - stage('checkout') { - steps { - sh 'rm -rf hello-world-war' - sh 'git clone https://github.com/tarundanda147/hello-world-war/' - } -} - stage('build') { + agent any + stages { + stage('checkout') { steps { - sh 'echo "inside build" - dir("hello-world-war") - sh 'echo "inside dir"' - { - sh 'docker build -t tomcat-war:1.0 .' - } + sh 'rm -rf hello-world-war' + sh 'git clone https://github.com/tarundanda147/hello-world-war/' } - } - stage('deploy') { + } + stage('build') { + steps { + dir("hello-world-war") { + sh 'echo "inside build"' + sh 'docker build -t tomcat-war:1.0 .' + } + } + } + stage('deploy') { steps { - sh 'docker rm -f tomcat-war' - sh 'docekr run -d -p 5555:8080 --name tomcat-war tomcat-war:1.0' + sh 'docker rm -f tomcat-war' + sh 'docker run -d -p 5555:8080 --name tomcat-war tomcat-war:1.0' } } } } + From c8022658c732f6f2c8304a93e6e93971341dcaf9 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 18 Mar 2024 20:07:37 +0530 Subject: [PATCH 029/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2b39958b9..b49dd3c61 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent any + agent { label 'docker' } stages { stage('checkout') { steps { From 4c3d58e916b40d8a4cec768a7f6722d648105f45 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 20 Mar 2024 07:31:10 +0530 Subject: [PATCH 030/116] Update Jenkinsfile --- Jenkinsfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b49dd3c61..a52a515d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,14 +11,20 @@ pipeline { steps { dir("hello-world-war") { sh 'echo "inside build"' - sh 'docker build -t tomcat-war:1.0 .' + sh 'docker build -t tomcat-war:$(BUILD_NUMBER) .' } } } + stage('push') { + steps { + sh 'docker login -u -p -h' + sh 'docker tag' + } + } stage('deploy') { steps { sh 'docker rm -f tomcat-war' - sh 'docker run -d -p 5555:8080 --name tomcat-war tomcat-war:1.0' + sh 'docker run -d -p 5555:8080 --name tomcat-war tomcat-war:$(BUILD_NUMBER)' } } } From 2e375007c97e01200ad514f6845a56a24b07e019 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:42:47 +0530 Subject: [PATCH 031/116] Update Jenkinsfile --- Jenkinsfile | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a52a515d2..9ebb25ee5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,16 +17,38 @@ pipeline { } stage('push') { steps { - sh 'docker login -u -p -h' - sh 'docker tag' + withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh 'docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}' + sh 'docker push tarundevops147/tomcat:${BUILD_NUMBER}' + } } stage('deploy') { + parallel { + stage('deployQA') { + agent { label 'qa' } steps { - sh 'docker rm -f tomcat-war' - sh 'docker run -d -p 5555:8080 --name tomcat-war tomcat-war:$(BUILD_NUMBER)' + withCredentials([usernamePassword(credentialsId: 'your-docker-credentials-id', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh 'docker pull tarundevops147/tomcat:${BUILD_NUMBER}' + sh 'docker rm -f tomcat-qa || true' + sh 'docker run -d -p 5555:8080 --name tomcat-qa tarundevops147/tomcat:${BUILD_NUMBER}' + } + } + } + stage('deployProd') { + agent { label 'prod' } + steps { + withCredentials([usernamePassword(credentialsId: 'your-docker-credentials-id', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh 'docker pull tarundevops147/tomcat:${BUILD_NUMBER}' + sh 'docker rm -f tomcat-prod || true' + sh 'docker run -d -p 5555:8080 --name tomcat-prod tarundevops147/tomcat:${BUILD_NUMBER}' + } } } } } + From 053ecf3108f681c5fc2544b112375f7af1266781 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:44:42 +0530 Subject: [PATCH 032/116] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9ebb25ee5..a444432b7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ pipeline { stage('deployQA') { agent { label 'qa' } steps { - withCredentials([usernamePassword(credentialsId: 'your-docker-credentials-id', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" sh 'docker pull tarundevops147/tomcat:${BUILD_NUMBER}' sh 'docker rm -f tomcat-qa || true' @@ -40,7 +40,7 @@ pipeline { stage('deployProd') { agent { label 'prod' } steps { - withCredentials([usernamePassword(credentialsId: 'your-docker-credentials-id', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" sh 'docker pull tarundevops147/tomcat:${BUILD_NUMBER}' sh 'docker rm -f tomcat-prod || true' From 48b1de646000d28127b44b2707631bbc269e9e5d Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:54:53 +0530 Subject: [PATCH 033/116] Update Jenkinsfile --- Jenkinsfile | 41 +++++------------------------------------ 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a444432b7..98ca02609 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,6 @@ pipeline { - agent { label 'docker' } + agent { label 'slave101' } + stages { stage('checkout') { steps { @@ -7,6 +8,7 @@ pipeline { sh 'git clone https://github.com/tarundanda147/hello-world-war/' } } + stage('build') { steps { dir("hello-world-war") { @@ -15,40 +17,7 @@ pipeline { } } } + stage('push') { steps { - withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh 'docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}' - sh 'docker push tarundevops147/tomcat:${BUILD_NUMBER}' - - } - } - stage('deploy') { - parallel { - stage('deployQA') { - agent { label 'qa' } - steps { - withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh 'docker pull tarundevops147/tomcat:${BUILD_NUMBER}' - sh 'docker rm -f tomcat-qa || true' - sh 'docker run -d -p 5555:8080 --name tomcat-qa tarundevops147/tomcat:${BUILD_NUMBER}' - } - } - } - stage('deployProd') { - agent { label 'prod' } - steps { - withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh 'docker pull tarundevops147/tomcat:${BUILD_NUMBER}' - sh 'docker rm -f tomcat-prod || true' - sh 'docker run -d -p 5555:8080 --name tomcat-prod tarundevops147/tomcat:${BUILD_NUMBER}' - } - } - } - } -} - - + withCredentials([us From 167fa5b12fff0bce2c7b9cb76442fad0def40251 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:56:19 +0530 Subject: [PATCH 034/116] Update Jenkinsfile --- Jenkinsfile | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 98ca02609..88222f93e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,4 +20,35 @@ pipeline { stage('push') { steps { - withCredentials([us + withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh 'docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}' + sh 'docker push tarundevops147/tomcat:${BUILD_NUMBER}' + } + } + } + + stage('deploy') { + parallel { + stage('deployQA') { + agent { label 'slave102' } + steps { + sh 'docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}' + sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" + sh 'docker rm -f tomcat-qa || true' + sh 'docker run -d -p 5555:8080 --name tomcat-qa tarundevops147/tomcat:${BUILD_NUMBER}' + } + } + stage('deployProd') { + agent { label 'slave33' } + steps { + sh 'docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}' + sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" + sh 'docker rm -f tomcat-prod || true' + sh 'docker run -d -p 5555:8080 --name tomcat-prod tarundevops147/tomcat:${BUILD_NUMBER}' + } + } + } + } + } +} From 4b4c247cbf6527c27b8fd744ba9febe9dce89e71 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:02:25 +0530 Subject: [PATCH 035/116] Update Jenkinsfile --- Jenkinsfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 88222f93e..d1b4f5593 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { steps { dir("hello-world-war") { sh 'echo "inside build"' - sh 'docker build -t tomcat-war:$(BUILD_NUMBER) .' + sh "docker build -t tomcat-war:${BUILD_NUMBER} ." // Corrected Docker tag format } } } @@ -22,8 +22,8 @@ pipeline { steps { withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh 'docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}' - sh 'docker push tarundevops147/tomcat:${BUILD_NUMBER}' + sh "docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}" // Corrected Docker tag format + sh "docker push tarundevops147/tomcat:${BUILD_NUMBER}" } } } @@ -33,19 +33,19 @@ pipeline { stage('deployQA') { agent { label 'slave102' } steps { - sh 'docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}' + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" sh 'docker rm -f tomcat-qa || true' - sh 'docker run -d -p 5555:8080 --name tomcat-qa tarundevops147/tomcat:${BUILD_NUMBER}' + sh "docker run -d -p 5555:8080 --name tomcat-qa tarundevops147/tomcat:${BUILD_NUMBER}" } } stage('deployProd') { agent { label 'slave33' } steps { - sh 'docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}' + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" sh 'docker rm -f tomcat-prod || true' - sh 'docker run -d -p 5555:8080 --name tomcat-prod tarundevops147/tomcat:${BUILD_NUMBER}' + sh "docker run -d -p 5555:8080 --name tomcat-prod tarundevops147/tomcat:${BUILD_NUMBER}" } } } From fd0e578cfe11fb0c096e9fa13f51172187bbda02 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:03:10 +0530 Subject: [PATCH 036/116] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d1b4f5593..d3fb3c280 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { steps { dir("hello-world-war") { sh 'echo "inside build"' - sh "docker build -t tomcat-war:${BUILD_NUMBER} ." // Corrected Docker tag format + sh "docker build -t tomcat-war:${BUILD_NUMBER} ." } } } @@ -22,7 +22,7 @@ pipeline { steps { withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}" // Corrected Docker tag format + sh "docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}" sh "docker push tarundevops147/tomcat:${BUILD_NUMBER}" } } From c94f9a9ec6e9698081216e5c98b91d56866dce18 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:06:50 +0530 Subject: [PATCH 037/116] Update Jenkinsfile --- Jenkinsfile | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d3fb3c280..593f54cc5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,17 +13,17 @@ pipeline { steps { dir("hello-world-war") { sh 'echo "inside build"' - sh "docker build -t tomcat-war:${BUILD_NUMBER} ." + sh 'docker build -t tomcat-war:$(BUILD_NUMBER) .' } } } stage('push') { steps { - withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + withCredentials([usernamePassword(credentialsId: 'your-docker-credentials-id', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}" - sh "docker push tarundevops147/tomcat:${BUILD_NUMBER}" + sh 'docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}' + sh 'docker push tarundevops147/tomcat:${BUILD_NUMBER}' } } } @@ -33,19 +33,27 @@ pipeline { stage('deployQA') { agent { label 'slave102' } steps { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" - sh 'docker rm -f tomcat-qa || true' - sh "docker run -d -p 5555:8080 --name tomcat-qa tarundevops147/tomcat:${BUILD_NUMBER}" + script { + withCredentials([usernamePassword(credentialsId: 'your-docker-credentials-id', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" + sh 'docker rm -f tomcat-qa || true' + sh 'docker run -d -p 5555:8080 --name tomcat-qa tarundevops147/tomcat:${BUILD_NUMBER}' + } + } } } stage('deployProd') { agent { label 'slave33' } steps { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" - sh 'docker rm -f tomcat-prod || true' - sh "docker run -d -p 5555:8080 --name tomcat-prod tarundevops147/tomcat:${BUILD_NUMBER}" + script { + withCredentials([usernamePassword(credentialsId: 'your-docker-credentials-id', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" + sh 'docker rm -f tomcat-prod || true' + sh 'docker run -d -p 5555:8080 --name tomcat-prod tarundevops147/tomcat:${BUILD_NUMBER}' + } + } } } } From 0038553efd66a559947eba225e2af7aedd5767a9 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:13:46 +0530 Subject: [PATCH 038/116] Update Jenkinsfile --- Jenkinsfile | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 593f54cc5..a10e69907 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,14 +13,14 @@ pipeline { steps { dir("hello-world-war") { sh 'echo "inside build"' - sh 'docker build -t tomcat-war:$(BUILD_NUMBER) .' + sh 'docker build -t tomcat-war:${BUILD_NUMBER} .' } } } stage('push') { steps { - withCredentials([usernamePassword(credentialsId: 'your-docker-credentials-id', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" sh 'docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}' sh 'docker push tarundevops147/tomcat:${BUILD_NUMBER}' @@ -31,32 +31,4 @@ pipeline { stage('deploy') { parallel { stage('deployQA') { - agent { label 'slave102' } - steps { - script { - withCredentials([usernamePassword(credentialsId: 'your-docker-credentials-id', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" - sh 'docker rm -f tomcat-qa || true' - sh 'docker run -d -p 5555:8080 --name tomcat-qa tarundevops147/tomcat:${BUILD_NUMBER}' - } - } - } - } - stage('deployProd') { - agent { label 'slave33' } - steps { - script { - withCredentials([usernamePassword(credentialsId: 'your-docker-credentials-id', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" - sh 'docker rm -f tomcat-prod || true' - sh 'docker run -d -p 5555:8080 --name tomcat-prod tarundevops147/tomcat:${BUILD_NUMBER}' - } - } - } - } - } - } - } -} + From 4e965beca828d865acbcdb9b8b6f5ac0c810af22 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:17:02 +0530 Subject: [PATCH 039/116] Update Jenkinsfile --- Jenkinsfile | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a10e69907..c9bf61fca 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { steps { dir("hello-world-war") { sh 'echo "inside build"' - sh 'docker build -t tomcat-war:${BUILD_NUMBER} .' + sh "docker build -t tomcat-war:${BUILD_NUMBER} ." } } } @@ -22,8 +22,8 @@ pipeline { steps { withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh 'docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}' - sh 'docker push tarundevops147/tomcat:${BUILD_NUMBER}' + sh "docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}" + sh "docker push tarundevops147/tomcat:${BUILD_NUMBER}" } } } @@ -31,4 +31,32 @@ pipeline { stage('deploy') { parallel { stage('deployQA') { - + agent { label 'slave102' } + steps { + script { + withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" + sh 'docker rm -f tomcat-qa || true' + sh 'docker run -d -p 5555:8080 --name tomcat-qa tarundevops147/tomcat:${BUILD_NUMBER}' + } + } + } + } + stage('deployProd') { + agent { label 'slave33' } + steps { + script { + withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" + sh 'docker rm -f tomcat-prod || true' + sh 'docker run -d -p 5555:8080 --name tomcat-prod tarundevops147/tomcat:${BUILD_NUMBER}' + } + } + } + } + } + } + } +} From 704dc3e3e4f9f2bed244aaef77d076c9e38e6a62 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:15:28 +0530 Subject: [PATCH 040/116] Create deployment.yml --- template/deployment.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 template/deployment.yml diff --git a/template/deployment.yml b/template/deployment.yml new file mode 100644 index 000000000..0b0b8a733 --- /dev/null +++ b/template/deployment.yml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.deploymentName }} + labels: + app: {{ .Values.deploymentLabel }} + namespace: jenkins +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + app: {{ .Values.deploymentLabel }} + template: + metadata: + labels: + app: {{ .Values.deploymentLabel }} + spec: + securityContext: + fsGroup: 1000 + runAsUser: 0 + containers: + - name: jenkins + image: jenkins/jenkins:lts + volumeMounts: + - name: {{ .Values.volumeName }} + mountPath: /var/jenkins_home + env: + - name: JENKINS_OPTS + value: --prefix=/jenkins + volumes: + - name: {{ .Values.volumeName }} + persistentVolumeClaim: + claimName: {{ .Values.claimName }} From e8719db8a73ac41736f28c304a16051c0865e3fd Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:16:12 +0530 Subject: [PATCH 041/116] Create storageclass.yml --- template/storageclass.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 template/storageclass.yml diff --git a/template/storageclass.yml b/template/storageclass.yml new file mode 100644 index 000000000..d3f0bb846 --- /dev/null +++ b/template/storageclass.yml @@ -0,0 +1,6 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: {{ .Values.storageClass }} +provisioner: ebs.csi.aws.com +volumeBindingMode: WaitForFirstConsumer From 66dd6e92000ad4ecdb2057740147a2abc9f7a1cb Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:26:56 +0530 Subject: [PATCH 042/116] Create pvc.yml --- template/pvc.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 template/pvc.yml diff --git a/template/pvc.yml b/template/pvc.yml new file mode 100644 index 000000000..ba2af8054 --- /dev/null +++ b/template/pvc.yml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Values.claimName }} +spec: + accessModes: + - ReadWriteOnce + storageClassName: {{ .Values.storageClass }} + resources: + requests: + storage: {{ .Values.requestStorage }} From bf58aca5d8bbf5ccf11195cbdae7a2787a39adf3 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:28:53 +0530 Subject: [PATCH 043/116] Update deployment.yml --- template/deployment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/template/deployment.yml b/template/deployment.yml index 0b0b8a733..88524aa8c 100644 --- a/template/deployment.yml +++ b/template/deployment.yml @@ -4,7 +4,6 @@ metadata: name: {{ .Values.deploymentName }} labels: app: {{ .Values.deploymentLabel }} - namespace: jenkins spec: replicas: {{ .Values.replicas }} selector: From 71afe054f7db022f792b9f7df1a312806433ae72 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:38:15 +0530 Subject: [PATCH 044/116] Create service.yml --- template/service.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 template/service.yml diff --git a/template/service.yml b/template/service.yml new file mode 100644 index 000000000..dfbf0293c --- /dev/null +++ b/template/service.yml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.serviceName }} + namespace: jenkins +spec: + type: ClusterIP + selector: + app: {{ .Values.deploymentLabel }} + ports: + - name: podport + protocol: TCP + port: 8080 + targetPort: 8080 From 050e8279c8ea2d8755c6c5b1d52d45f0c576bf36 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:38:50 +0530 Subject: [PATCH 045/116] Create ingress-route.yml --- template/ingress-route.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 template/ingress-route.yml diff --git a/template/ingress-route.yml b/template/ingress-route.yml new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/template/ingress-route.yml @@ -0,0 +1 @@ + From faa903b494c64e82d2ce80fe8bdd90eaa9da1633 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:39:52 +0530 Subject: [PATCH 046/116] Create values.yml --- values.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 values.yml diff --git a/values.yml b/values.yml new file mode 100644 index 000000000..f7099866a --- /dev/null +++ b/values.yml @@ -0,0 +1,9 @@ +deploymentName: "my-jenkins" +deploymentLabel: "jenkins" +replicas: 4 +volumeName: "volume-jenkins" +claimName: "claim-jenkins" +storageClass: "sc-jenkins" +requestStorage: "5Gi" +serviceName: "svc-jenkins" +ingressName: "jenkins-ingress" From 0708fc3bd532bdbbaa42b3225d6f9f4f7ba29ba3 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:47:01 +0530 Subject: [PATCH 047/116] Update deployment.yml --- template/deployment.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/template/deployment.yml b/template/deployment.yml index 88524aa8c..62ab07350 100644 --- a/template/deployment.yml +++ b/template/deployment.yml @@ -11,6 +11,7 @@ spec: app: {{ .Values.deploymentLabel }} template: metadata: + name: {{ .Values.deploymentLabel }} labels: app: {{ .Values.deploymentLabel }} spec: @@ -18,14 +19,14 @@ spec: fsGroup: 1000 runAsUser: 0 containers: - - name: jenkins - image: jenkins/jenkins:lts + - name: {{ .Values.deploymentLabel }} + image: {{ .values.image }}:{{ .values.tag }} volumeMounts: - name: {{ .Values.volumeName }} - mountPath: /var/jenkins_home + mountPath: /usr/local/tomcat/ env: - - name: JENKINS_OPTS - value: --prefix=/jenkins + - name: TOMCAT_OPTS + value: --prefix=/tomcat volumes: - name: {{ .Values.volumeName }} persistentVolumeClaim: From 5ce841fb515ba79a775c8d5f97650dee7cb348f8 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:48:46 +0530 Subject: [PATCH 048/116] Update ingress-route.yml --- template/ingress-route.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/template/ingress-route.yml b/template/ingress-route.yml index 8b1378917..d3a90d6b4 100644 --- a/template/ingress-route.yml +++ b/template/ingress-route.yml @@ -1 +1,17 @@ - +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Values.ingressName }} + namespace: jenkins +spec: + ingressClassName: nginx + rules: + - http: + paths: + - path: /jenkins + pathType: Prefix + backend: + service: + name: {{ .Values.serviceName }} + port: + number: 8080 From 650e3ff04e8c981c52b8643d7446a238015dc0af Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:51:11 +0530 Subject: [PATCH 049/116] Update ingress-route.yml --- template/ingress-route.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/template/ingress-route.yml b/template/ingress-route.yml index d3a90d6b4..4d05f4a19 100644 --- a/template/ingress-route.yml +++ b/template/ingress-route.yml @@ -2,13 +2,12 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ .Values.ingressName }} - namespace: jenkins spec: ingressClassName: nginx rules: - http: paths: - - path: /jenkins + - path: /hello-world-war-1.0.0 pathType: Prefix backend: service: From d83521be577b650d0f1b3d150bc0c9e54349df98 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:52:28 +0530 Subject: [PATCH 050/116] Update values.yml --- values.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/values.yml b/values.yml index f7099866a..b9342b787 100644 --- a/values.yml +++ b/values.yml @@ -7,3 +7,5 @@ storageClass: "sc-jenkins" requestStorage: "5Gi" serviceName: "svc-jenkins" ingressName: "jenkins-ingress" +image: "tomcat" +tag: "lts" From 5c918d60f7dcda39dfee85941db387f57ad139b0 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:58:00 +0530 Subject: [PATCH 051/116] Update service.yml --- template/service.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/service.yml b/template/service.yml index dfbf0293c..1e4505d60 100644 --- a/template/service.yml +++ b/template/service.yml @@ -10,5 +10,5 @@ spec: ports: - name: podport protocol: TCP - port: 8080 + port: 8090 targetPort: 8080 From 7ab748c2dbd080c1ea33e00f46e22e89efe7b7b0 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:58:15 +0530 Subject: [PATCH 052/116] Update ingress-route.yml --- template/ingress-route.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/ingress-route.yml b/template/ingress-route.yml index 4d05f4a19..322f229b2 100644 --- a/template/ingress-route.yml +++ b/template/ingress-route.yml @@ -13,4 +13,4 @@ spec: service: name: {{ .Values.serviceName }} port: - number: 8080 + number: 8090 From 0f8d5d8bcb84c5e60ef54ddfea754f68e08fac10 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:16:41 +0530 Subject: [PATCH 053/116] Update values.yml --- values.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/values.yml b/values.yml index b9342b787..69905d3b2 100644 --- a/values.yml +++ b/values.yml @@ -1,11 +1,11 @@ -deploymentName: "my-jenkins" -deploymentLabel: "jenkins" +deploymentName: "my-tomcat" +deploymentLabel: "tomcat" replicas: 4 -volumeName: "volume-jenkins" -claimName: "claim-jenkins" -storageClass: "sc-jenkins" +volumeName: "volume-tomcat" +claimName: "claim-tomcat" +storageClass: "sc-tomcat" requestStorage: "5Gi" -serviceName: "svc-jenkins" -ingressName: "jenkins-ingress" +serviceName: "svc-tomcat" +ingressName: "tomcat-ingress" image: "tomcat" tag: "lts" From 5f16903ae00727b322b54a7ccda8e7e3678ed21f Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 17:57:22 +0530 Subject: [PATCH 054/116] Update Jenkinsfile --- Jenkinsfile | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c9bf61fca..b82a297c0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,36 +27,5 @@ pipeline { } } } - - stage('deploy') { - parallel { - stage('deployQA') { - agent { label 'slave102' } - steps { - script { - withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" - sh 'docker rm -f tomcat-qa || true' - sh 'docker run -d -p 5555:8080 --name tomcat-qa tarundevops147/tomcat:${BUILD_NUMBER}' - } - } - } - } - stage('deployProd') { - agent { label 'slave33' } - steps { - script { - withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker pull tarundevops147/tomcat:${BUILD_NUMBER}" - sh 'docker rm -f tomcat-prod || true' - sh 'docker run -d -p 5555:8080 --name tomcat-prod tarundevops147/tomcat:${BUILD_NUMBER}' - } - } - } - } - } - } } } From 0d5aaaa0dc7d1bfd97c449fdbd9ba12bcdd54e65 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:04:42 +0530 Subject: [PATCH 055/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b82a297c0..1b1d6e0e2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { stage('push') { steps { - withCredentials([usernamePassword(credentialsId: '9edb749c-52c9-40d2-9266-024789f72979', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + withCredentials([usernamePassword(credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" sh "docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}" sh "docker push tarundevops147/tomcat:${BUILD_NUMBER}" From 1fbf2779c3428de856cd19327de1093152890658 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:05:25 +0530 Subject: [PATCH 056/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1b1d6e0e2..282e60261 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent { label 'slave101' } + agent any stages { stage('checkout') { From 0675b4988e898c2f37a2a7ebccf7c89c589fa47a Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:10:00 +0530 Subject: [PATCH 057/116] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 282e60261..5f68c0df1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,8 +22,8 @@ pipeline { steps { withCredentials([usernamePassword(credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker tag tomcat-war:${BUILD_NUMBER} tarundevops147/tomcat:${BUILD_NUMBER}" - sh "docker push tarundevops147/tomcat:${BUILD_NUMBER}" + sh "docker tag tomcat-war:${BUILD_NUMBER} tarundanda147/tomcat:${BUILD_NUMBER}" + sh "docker push tarundanda147/tomcat:${BUILD_NUMBER}" } } } From 9fc54711ecffed70264f15348e8a3abc753efad7 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:17:41 +0530 Subject: [PATCH 058/116] Update Jenkinsfile --- Jenkinsfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5f68c0df1..bd2ded402 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,5 +27,12 @@ pipeline { } } } + stage ('Helm Deploy') { + steps { + echo 'Deploying to Kubernetes using Helm' + sh "helm upgrade first --install mychart --namespace helm-deployment --set image.tag=$BUILD_NUMBER" + } + } } + } } From 673d89144d16d4ef754a48acdc7bdb57f97b905d Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:21:25 +0530 Subject: [PATCH 059/116] Rename values.yml to values.yaml --- values.yml => values.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename values.yml => values.yaml (100%) diff --git a/values.yml b/values.yaml similarity index 100% rename from values.yml rename to values.yaml From 5c1fab00401767f65e0bb5661bff9e98539f14e8 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:22:05 +0530 Subject: [PATCH 060/116] Update values.yaml --- values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/values.yaml b/values.yaml index 69905d3b2..4bc8ab787 100644 --- a/values.yaml +++ b/values.yaml @@ -1,11 +1,11 @@ deploymentName: "my-tomcat" deploymentLabel: "tomcat" -replicas: 4 +replicas: 2 volumeName: "volume-tomcat" claimName: "claim-tomcat" storageClass: "sc-tomcat" requestStorage: "5Gi" serviceName: "svc-tomcat" ingressName: "tomcat-ingress" -image: "tomcat" +image: "tarundanda147/tomcat" tag: "lts" From f0cb18f58da02b6da040346a32db6fb1f482361c Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:24:37 +0530 Subject: [PATCH 061/116] Update service.yml --- template/service.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/template/service.yml b/template/service.yml index 1e4505d60..e12f33402 100644 --- a/template/service.yml +++ b/template/service.yml @@ -2,7 +2,6 @@ apiVersion: v1 kind: Service metadata: name: {{ .Values.serviceName }} - namespace: jenkins spec: type: ClusterIP selector: From f45009949bbb7994aff62f2bb3f8459ffc339dd6 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:26:06 +0530 Subject: [PATCH 062/116] Update deployment.yml --- template/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/deployment.yml b/template/deployment.yml index 62ab07350..8162ef3e6 100644 --- a/template/deployment.yml +++ b/template/deployment.yml @@ -20,7 +20,7 @@ spec: runAsUser: 0 containers: - name: {{ .Values.deploymentLabel }} - image: {{ .values.image }}:{{ .values.tag }} + image: {{ .values.image }}:{{ .values.image.tag }} volumeMounts: - name: {{ .Values.volumeName }} mountPath: /usr/local/tomcat/ From fb2e0b465d0a46b184d0a6c040873d5e5d886519 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:26:26 +0530 Subject: [PATCH 063/116] Update values.yaml --- values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index 4bc8ab787..3fceb0362 100644 --- a/values.yaml +++ b/values.yaml @@ -8,4 +8,4 @@ requestStorage: "5Gi" serviceName: "svc-tomcat" ingressName: "tomcat-ingress" image: "tarundanda147/tomcat" -tag: "lts" +image.tag: "lts" From c176e13133244e3536587b8839fd226f163a6d74 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:28:31 +0530 Subject: [PATCH 064/116] Update Jenkinsfile --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bd2ded402..c69eb3549 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,9 +30,8 @@ pipeline { stage ('Helm Deploy') { steps { echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install mychart --namespace helm-deployment --set image.tag=$BUILD_NUMBER" + sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } - } } From b650b62f5c6b6494740b8838d4383daa3c925799 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:43:27 +0530 Subject: [PATCH 065/116] Create Chart.yaml --- Chart.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Chart.yaml diff --git a/Chart.yaml b/Chart.yaml new file mode 100644 index 000000000..93778c104 --- /dev/null +++ b/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: hello-world-war +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" From 454bb1918e41ff59d1fb05ea9656e5a9c5020a10 Mon Sep 17 00:00:00 2001 From: tarundanda147 Date: Tue, 16 Apr 2024 22:26:00 +0530 Subject: [PATCH 066/116] done --- .helmignore | 23 ++++++++++++++++++++ {template => templates}/deployment.yml | 26 ++++++++++++----------- {template => templates}/ingress-route.yml | 4 ++-- {template => templates}/pvc.yml | 2 +- {template => templates}/service.yml | 2 +- {template => templates}/storageclass.yml | 2 +- values.yaml | 9 ++++---- 7 files changed, 46 insertions(+), 22 deletions(-) create mode 100644 .helmignore rename {template => templates}/deployment.yml (62%) rename {template => templates}/ingress-route.yml (81%) rename {template => templates}/pvc.yml (81%) rename {template => templates}/service.yml (90%) rename {template => templates}/storageclass.yml (75%) diff --git a/.helmignore b/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/template/deployment.yml b/templates/deployment.yml similarity index 62% rename from template/deployment.yml rename to templates/deployment.yml index 8162ef3e6..2d822630a 100644 --- a/template/deployment.yml +++ b/templates/deployment.yml @@ -1,12 +1,17 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ .Values.deploymentName }} + name: myreplica labels: app: {{ .Values.deploymentLabel }} spec: replicas: {{ .Values.replicas }} - selector: + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + selector: matchLabels: app: {{ .Values.deploymentLabel }} template: @@ -15,19 +20,16 @@ spec: labels: app: {{ .Values.deploymentLabel }} spec: - securityContext: - fsGroup: 1000 - runAsUser: 0 - containers: + containers: - name: {{ .Values.deploymentLabel }} - image: {{ .values.image }}:{{ .values.image.tag }} + image: tomcat:8.0 + env: + - name: TOMCAT_OPTS + value: --prefix=/tomcat volumeMounts: - name: {{ .Values.volumeName }} - mountPath: /usr/local/tomcat/ - env: - - name: TOMCAT_OPTS - value: --prefix=/tomcat + mountPath: /usr/local/tomcat/webapps volumes: - name: {{ .Values.volumeName }} persistentVolumeClaim: - claimName: {{ .Values.claimName }} + claimName: {{ .Values.claimName }} \ No newline at end of file diff --git a/template/ingress-route.yml b/templates/ingress-route.yml similarity index 81% rename from template/ingress-route.yml rename to templates/ingress-route.yml index 322f229b2..a53e7a772 100644 --- a/template/ingress-route.yml +++ b/templates/ingress-route.yml @@ -7,10 +7,10 @@ spec: rules: - http: paths: - - path: /hello-world-war-1.0.0 + - path: /sample pathType: Prefix backend: service: name: {{ .Values.serviceName }} port: - number: 8090 + number: 8090 \ No newline at end of file diff --git a/template/pvc.yml b/templates/pvc.yml similarity index 81% rename from template/pvc.yml rename to templates/pvc.yml index ba2af8054..bd311b320 100644 --- a/template/pvc.yml +++ b/templates/pvc.yml @@ -8,4 +8,4 @@ spec: storageClassName: {{ .Values.storageClass }} resources: requests: - storage: {{ .Values.requestStorage }} + storage: {{ .Values.requestStorage }} \ No newline at end of file diff --git a/template/service.yml b/templates/service.yml similarity index 90% rename from template/service.yml rename to templates/service.yml index e12f33402..1b9ba0478 100644 --- a/template/service.yml +++ b/templates/service.yml @@ -10,4 +10,4 @@ spec: - name: podport protocol: TCP port: 8090 - targetPort: 8080 + targetPort: 8080 \ No newline at end of file diff --git a/template/storageclass.yml b/templates/storageclass.yml similarity index 75% rename from template/storageclass.yml rename to templates/storageclass.yml index d3f0bb846..bbecc5dc1 100644 --- a/template/storageclass.yml +++ b/templates/storageclass.yml @@ -3,4 +3,4 @@ kind: StorageClass metadata: name: {{ .Values.storageClass }} provisioner: ebs.csi.aws.com -volumeBindingMode: WaitForFirstConsumer +volumeBindingMode: WaitForFirstConsumer \ No newline at end of file diff --git a/values.yaml b/values.yaml index 3fceb0362..64da328cb 100644 --- a/values.yaml +++ b/values.yaml @@ -1,11 +1,10 @@ deploymentName: "my-tomcat" deploymentLabel: "tomcat" -replicas: 2 +replicas: 1 volumeName: "volume-tomcat" claimName: "claim-tomcat" -storageClass: "sc-tomcat" +storageClass: "tomcat-ebs" requestStorage: "5Gi" -serviceName: "svc-tomcat" +serviceName: "tomcat" ingressName: "tomcat-ingress" -image: "tarundanda147/tomcat" -image.tag: "lts" +imageName: "tomcat:8.0" \ No newline at end of file From ba371bde1bd72c17e41d2b8a347cad237e8cb634 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 22:43:34 +0530 Subject: [PATCH 067/116] Update values.yaml --- values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index 64da328cb..277980ed4 100644 --- a/values.yaml +++ b/values.yaml @@ -7,4 +7,5 @@ storageClass: "tomcat-ebs" requestStorage: "5Gi" serviceName: "tomcat" ingressName: "tomcat-ingress" -imageName: "tomcat:8.0" \ No newline at end of file +imageName: "tomcat" +imageTag: "lts" From ebe5d71405222c754a2d7ec047b1d23b98058084 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 22:44:47 +0530 Subject: [PATCH 068/116] Update deployment.yml --- templates/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/deployment.yml b/templates/deployment.yml index 2d822630a..d5a1b72a9 100644 --- a/templates/deployment.yml +++ b/templates/deployment.yml @@ -22,7 +22,7 @@ spec: spec: containers: - name: {{ .Values.deploymentLabel }} - image: tomcat:8.0 + image: {{ .Values.imageName }}:{{ .Values.imageTag }} env: - name: TOMCAT_OPTS value: --prefix=/tomcat @@ -32,4 +32,4 @@ spec: volumes: - name: {{ .Values.volumeName }} persistentVolumeClaim: - claimName: {{ .Values.claimName }} \ No newline at end of file + claimName: {{ .Values.claimName }} From dda3a6ad13e85ca9963d94ea92c72174b5f80744 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 22:54:04 +0530 Subject: [PATCH 069/116] Update values.yaml --- values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index 277980ed4..9014fe830 100644 --- a/values.yaml +++ b/values.yaml @@ -7,5 +7,5 @@ storageClass: "tomcat-ebs" requestStorage: "5Gi" serviceName: "tomcat" ingressName: "tomcat-ingress" -imageName: "tomcat" +imageName: "tarundanda147/tomcat" imageTag: "lts" From 91369d6280cb7bc0da6c985adfb8965e033e70c3 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 23:07:38 +0530 Subject: [PATCH 070/116] Update Jenkinsfile --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index c69eb3549..0c5e97059 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,6 +29,8 @@ pipeline { } stage ('Helm Deploy') { steps { + withCredentials([kubernetesServiceAccount(credentialsId: 'eks-cluster', namespace: 'hello-world-war')]) { + // Perform Helm deployment echo 'Deploying to Kubernetes using Helm' sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } From 69a43b4d09522b40cee6a33b11894911f8f8428b Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 23:09:28 +0530 Subject: [PATCH 071/116] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 0c5e97059..07a70774d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,3 +37,4 @@ pipeline { } } } +} From eb114a6224ce562d2589310597aab96b1b3ccf32 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Tue, 16 Apr 2024 23:12:48 +0530 Subject: [PATCH 072/116] Update Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 07a70774d..45a77e5bf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,7 +30,6 @@ pipeline { stage ('Helm Deploy') { steps { withCredentials([kubernetesServiceAccount(credentialsId: 'eks-cluster', namespace: 'hello-world-war')]) { - // Perform Helm deployment echo 'Deploying to Kubernetes using Helm' sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } From 9bd83ab9f2641c9786bbe2041eeb6842bae45fab Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:01:54 +0530 Subject: [PATCH 073/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 45a77e5bf..7a8f72f8f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ pipeline { } stage ('Helm Deploy') { steps { - withCredentials([kubernetesServiceAccount(credentialsId: 'eks-cluster', namespace: 'hello-world-war')]) { + kubernetesDeploy configs: '', dockerCredentials: [[credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', url: 'https://hub.docker.com/repository/docker/tarundanda147/tomcat']], kubeConfig: [path: ''], kubeconfigId: 'eks-cluster', secretName: '', secretNamespace: 'hello-world-war', ssh: [sshCredentialsId: '*', sshServer: ''], textCredentials: [certificateAuthorityData: '', clientCertificateData: '', clientKeyData: '', serverUrl: 'https://'] { echo 'Deploying to Kubernetes using Helm' sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } From 69db2e582a7dfaae2b8b54806cc1545e4af3661d Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:03:48 +0530 Subject: [PATCH 074/116] Update Jenkinsfile --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7a8f72f8f..e4d38b232 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,11 +29,11 @@ pipeline { } stage ('Helm Deploy') { steps { - kubernetesDeploy configs: '', dockerCredentials: [[credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', url: 'https://hub.docker.com/repository/docker/tarundanda147/tomcat']], kubeConfig: [path: ''], kubeconfigId: 'eks-cluster', secretName: '', secretNamespace: 'hello-world-war', ssh: [sshCredentialsId: '*', sshServer: ''], textCredentials: [certificateAuthorityData: '', clientCertificateData: '', clientKeyData: '', serverUrl: 'https://'] { - echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + kubernetesDeploy configs: '', dockerCredentials: [[credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', url: 'https://hub.docker.com/repository/docker/tarundanda147/tomcat']], kubeConfig: [path: ''], kubeconfigId: 'eks-cluster', secretName: '', secretNamespace: 'hello-world-war', ssh: [sshCredentialsId: '*', sshServer: ''], textCredentials: [certificateAuthorityData: '', clientCertificateData: '', clientKeyData: '', serverUrl: 'https://']] { + echo 'Deploying to Kubernetes using Helm' + sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + } } } } } -} From 9066d3e6d45991f697d1f45a5f031a40d98bd6a9 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:04:46 +0530 Subject: [PATCH 075/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e4d38b232..b1e4a9518 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,4 +36,4 @@ pipeline { } } } -} + From 96de145cf3702c8249f71f5e5e0b2a65f9106dc6 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:06:00 +0530 Subject: [PATCH 076/116] Update Jenkinsfile --- Jenkinsfile | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b1e4a9518..e1c6a7e37 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,12 +28,29 @@ pipeline { } } stage ('Helm Deploy') { - steps { - kubernetesDeploy configs: '', dockerCredentials: [[credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', url: 'https://hub.docker.com/repository/docker/tarundanda147/tomcat']], kubeConfig: [path: ''], kubeconfigId: 'eks-cluster', secretName: '', secretNamespace: 'hello-world-war', ssh: [sshCredentialsId: '*', sshServer: ''], textCredentials: [certificateAuthorityData: '', clientCertificateData: '', clientKeyData: '', serverUrl: 'https://']] { - echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" - } - } + steps { + kubernetesDeploy( + configs: '', + dockerCredentials: [ + [credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', url: 'https://hub.docker.com/repository/docker/tarundanda147/tomcat'] + ], + kubeConfig: [path: ''], + kubeconfigId: 'eks-cluster', + secretName: '', + secretNamespace: 'hello-world-war', + ssh: [sshCredentialsId: '*', sshServer: ''], + textCredentials: [ + certificateAuthorityData: '', + clientCertificateData: '', + clientKeyData: '', + serverUrl: 'https://' + ]) { + echo 'Deploying to Kubernetes using Helm' + sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + } + } +} + } } From 3614eb056740ee34e84e7b0a28d1ec1e34c27387 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:07:21 +0530 Subject: [PATCH 077/116] Update Jenkinsfile --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e1c6a7e37..fc2af5961 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,7 +27,7 @@ pipeline { } } } - stage ('Helm Deploy') { + stage('Helm Deploy') { steps { kubernetesDeploy( configs: '', @@ -44,13 +44,15 @@ pipeline { clientCertificateData: '', clientKeyData: '', serverUrl: 'https://' - ]) { + ] + ) { echo 'Deploying to Kubernetes using Helm' sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } + } } From 458be9e265626f42549396e712b4ca6bd954f774 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:09:07 +0530 Subject: [PATCH 078/116] Update Jenkinsfile --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fc2af5961..bb1615983 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,12 +28,10 @@ pipeline { } } stage('Helm Deploy') { + stage('Helm Deploy') { steps { kubernetesDeploy( configs: '', - dockerCredentials: [ - [credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', url: 'https://hub.docker.com/repository/docker/tarundanda147/tomcat'] - ], kubeConfig: [path: ''], kubeconfigId: 'eks-cluster', secretName: '', From 81f847c3118d4eba1a536eae808692457d3f0a0b Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:09:57 +0530 Subject: [PATCH 079/116] Update Jenkinsfile --- Jenkinsfile | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bb1615983..b55994880 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,30 +27,14 @@ pipeline { } } } + stage('Helm Deploy') { - stage('Helm Deploy') { - steps { - kubernetesDeploy( - configs: '', - kubeConfig: [path: ''], - kubeconfigId: 'eks-cluster', - secretName: '', - secretNamespace: 'hello-world-war', - ssh: [sshCredentialsId: '*', sshServer: ''], - textCredentials: [ - certificateAuthorityData: '', - clientCertificateData: '', - clientKeyData: '', - serverUrl: 'https://' - ] - ) { - echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" - } - } -} - - - } - } - + steps { + kubernetesDeploy( + configs: '', + kubeConfig: [path: ''], + kubeconfigId: 'eks-cluster', + secretName: '', + secretNamespace: 'hello-world-war', + ssh: [sshCredentialsId: '*', sshServer: ''], + From a6ad39d047bab6f54213cf5454059c9d98d62be5 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:10:33 +0530 Subject: [PATCH 080/116] Update Jenkinsfile --- Jenkinsfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b55994880..1e3ecb358 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,4 +37,17 @@ pipeline { secretName: '', secretNamespace: 'hello-world-war', ssh: [sshCredentialsId: '*', sshServer: ''], - + textCredentials: [ + certificateAuthorityData: '', + clientCertificateData: '', + clientKeyData: '', + serverUrl: 'https://' + ] + ) { + echo 'Deploying to Kubernetes using Helm' + sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + } + } + } + } +} From 90f2467013e181031b86e5db73265c42aa2312ca Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:11:42 +0530 Subject: [PATCH 081/116] Update Jenkinsfile --- Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1e3ecb358..8834ccfe1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,10 +31,8 @@ pipeline { stage('Helm Deploy') { steps { kubernetesDeploy( - configs: '', kubeConfig: [path: ''], kubeconfigId: 'eks-cluster', - secretName: '', secretNamespace: 'hello-world-war', ssh: [sshCredentialsId: '*', sshServer: ''], textCredentials: [ From be507a66e80c6f22bb52e758a17d1ebece98fbc1 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:13:42 +0530 Subject: [PATCH 082/116] Update Jenkinsfile --- Jenkinsfile | 65 ++++++++++++++--------------------------------------- 1 file changed, 17 insertions(+), 48 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8834ccfe1..7c24713da 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,51 +1,20 @@ -pipeline { - agent any - - stages { - stage('checkout') { - steps { - sh 'rm -rf hello-world-war' - sh 'git clone https://github.com/tarundanda147/hello-world-war/' - } - } - - stage('build') { - steps { - dir("hello-world-war") { - sh 'echo "inside build"' - sh "docker build -t tomcat-war:${BUILD_NUMBER} ." - } - } - } - - stage('push') { - steps { - withCredentials([usernamePassword(credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker tag tomcat-war:${BUILD_NUMBER} tarundanda147/tomcat:${BUILD_NUMBER}" - sh "docker push tarundanda147/tomcat:${BUILD_NUMBER}" - } - } - } - - stage('Helm Deploy') { - steps { - kubernetesDeploy( - kubeConfig: [path: ''], - kubeconfigId: 'eks-cluster', - secretNamespace: 'hello-world-war', - ssh: [sshCredentialsId: '*', sshServer: ''], - textCredentials: [ - certificateAuthorityData: '', - clientCertificateData: '', - clientKeyData: '', - serverUrl: 'https://' - ] - ) { - echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" - } - } +stage('Helm Deploy') { + steps { + kubernetesDeploy( + configs: '', + kubeConfig: [path: ''], + kubeconfigId: 'eks-cluster', + secretNamespace: 'hello-world-war', + ssh: [sshCredentialsId: '*', sshServer: ''], + textCredentials: [ + certificateAuthorityData: '', + clientCertificateData: '', + clientKeyData: '', + serverUrl: 'https://' + ] + ) { + echo 'Deploying to Kubernetes using Helm' + sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } From 0b9c95126c59afd6f6219d35595555c13c27a3f8 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:15:09 +0530 Subject: [PATCH 083/116] Update Jenkinsfile --- Jenkinsfile | 62 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7c24713da..e72a22c0c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,20 +1,48 @@ -stage('Helm Deploy') { - steps { - kubernetesDeploy( - configs: '', - kubeConfig: [path: ''], - kubeconfigId: 'eks-cluster', - secretNamespace: 'hello-world-war', - ssh: [sshCredentialsId: '*', sshServer: ''], - textCredentials: [ - certificateAuthorityData: '', - clientCertificateData: '', - clientKeyData: '', - serverUrl: 'https://' - ] - ) { - echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" +pipeline { + agent any + + stages { + stage('checkout') { + steps { + sh 'rm -rf hello-world-war' + sh 'git clone https://github.com/tarundanda147/hello-world-war/' + } + } + + stage('build') { + steps { + dir("hello-world-war") { + sh 'echo "inside build"' + // Removed Docker build step + } + } + } + + stage('push') { + steps { + // Removed Docker push step + } + } + + stage('Helm Deploy') { + steps { + kubernetesDeploy( + configs: '', + kubeConfig: [path: ''], + kubeconfigId: 'eks-cluster', + secretNamespace: 'hello-world-war', + ssh: [sshCredentialsId: '*', sshServer: ''], + textCredentials: [ + certificateAuthorityData: '', + clientCertificateData: '', + clientKeyData: '', + serverUrl: 'https://' + ] + ) { + echo 'Deploying to Kubernetes using Helm' + sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + } + } } } } From 9be06cac9b984a08db0f63a302c1306710516ffc Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:15:50 +0530 Subject: [PATCH 084/116] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e72a22c0c..500a6bda2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,14 +13,14 @@ pipeline { steps { dir("hello-world-war") { sh 'echo "inside build"' - // Removed Docker build step + // Add any build steps here if needed } } } stage('push') { steps { - // Removed Docker push step + // Add any Docker push steps here if needed } } From a0649c29409145f94cbdad2d478f795b152f4bca Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:16:46 +0530 Subject: [PATCH 085/116] Update Jenkinsfile From 2ae072caa81d6053c46240ebc8cb0235d8adc0f0 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:19:09 +0530 Subject: [PATCH 086/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 500a6bda2..3dfbea667 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,7 +30,7 @@ pipeline { configs: '', kubeConfig: [path: ''], kubeconfigId: 'eks-cluster', - secretNamespace: 'hello-world-war', + secretName: '', ssh: [sshCredentialsId: '*', sshServer: ''], textCredentials: [ certificateAuthorityData: '', From 1434f7ec19dbae83b5999f83070d5b65091865e4 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:21:32 +0530 Subject: [PATCH 087/116] Update Jenkinsfile --- Jenkinsfile | 52 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3dfbea667..fc2af5961 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,36 +13,46 @@ pipeline { steps { dir("hello-world-war") { sh 'echo "inside build"' - // Add any build steps here if needed + sh "docker build -t tomcat-war:${BUILD_NUMBER} ." } } } stage('push') { steps { - // Add any Docker push steps here if needed + withCredentials([usernamePassword(credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh "docker tag tomcat-war:${BUILD_NUMBER} tarundanda147/tomcat:${BUILD_NUMBER}" + sh "docker push tarundanda147/tomcat:${BUILD_NUMBER}" + } } } - stage('Helm Deploy') { - steps { - kubernetesDeploy( - configs: '', - kubeConfig: [path: ''], - kubeconfigId: 'eks-cluster', - secretName: '', - ssh: [sshCredentialsId: '*', sshServer: ''], - textCredentials: [ - certificateAuthorityData: '', - clientCertificateData: '', - clientKeyData: '', - serverUrl: 'https://' - ] - ) { - echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" - } - } + steps { + kubernetesDeploy( + configs: '', + dockerCredentials: [ + [credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', url: 'https://hub.docker.com/repository/docker/tarundanda147/tomcat'] + ], + kubeConfig: [path: ''], + kubeconfigId: 'eks-cluster', + secretName: '', + secretNamespace: 'hello-world-war', + ssh: [sshCredentialsId: '*', sshServer: ''], + textCredentials: [ + certificateAuthorityData: '', + clientCertificateData: '', + clientKeyData: '', + serverUrl: 'https://' + ] + ) { + echo 'Deploying to Kubernetes using Helm' + sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } + + + } + } + From 9398862286fd1b2d4b6bcd2e812abe30918a17b9 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:23:17 +0530 Subject: [PATCH 088/116] Update Jenkinsfile --- Jenkinsfile | 55 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fc2af5961..4aa7bad8f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,30 +29,45 @@ pipeline { } stage('Helm Deploy') { steps { - kubernetesDeploy( - configs: '', - dockerCredentials: [ - [credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', url: 'https://hub.docker.com/repository/docker/tarundanda147/tomcat'] - ], - kubeConfig: [path: ''], - kubeconfigId: 'eks-cluster', - secretName: '', - secretNamespace: 'hello-world-war', - ssh: [sshCredentialsId: '*', sshServer: ''], - textCredentials: [ - certificateAuthorityData: '', - clientCertificateData: '', - clientKeyData: '', - serverUrl: 'https://' - ] - ) { + pipeline { + agent any + + stages { + stage('checkout') { + steps { + sh 'rm -rf hello-world-war' + sh 'git clone https://github.com/tarundanda147/hello-world-war/' + } + } + + stage('build') { + steps { + dir("hello-world-war") { + sh 'echo "inside build"' + sh "docker build -t tomcat-war:${BUILD_NUMBER} ." + } + } + } + + stage('push') { + steps { + withCredentials([usernamePassword(credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" + sh "docker tag tomcat-war:${BUILD_NUMBER} tarundanda147/tomcat:${BUILD_NUMBER}" + sh "docker push tarundanda147/tomcat:${BUILD_NUMBER}" + } + } + } + stage('Helm Deploy') { + steps { + kubernetesDeploy configs: '', kubeConfig: [path: ''], kubeconfigId: 'eks-cluster', secretName: '', ssh: [sshCredentialsId: '*', sshServer: ''], textCredentials: [certificateAuthorityData: '', clientCertificateData: '', clientKeyData: '', serverUrl: 'https://'] + { echo 'Deploying to Kubernetes using Helm' sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } - - - } } + } + From 79282d3f0238c4047829bc841a1f7a12955fc16e Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:24:31 +0530 Subject: [PATCH 089/116] Update Jenkinsfile --- Jenkinsfile | 53 ++++++++++++++++------------------------------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4aa7bad8f..4a10cb32d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,47 +27,26 @@ pipeline { } } } - stage('Helm Deploy') { - steps { - pipeline { - agent any - - stages { - stage('checkout') { - steps { - sh 'rm -rf hello-world-war' - sh 'git clone https://github.com/tarundanda147/hello-world-war/' - } - } - stage('build') { - steps { - dir("hello-world-war") { - sh 'echo "inside build"' - sh "docker build -t tomcat-war:${BUILD_NUMBER} ." - } - } - } - - stage('push') { + stage('Helm Deploy') { steps { - withCredentials([usernamePassword(credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { - sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" - sh "docker tag tomcat-war:${BUILD_NUMBER} tarundanda147/tomcat:${BUILD_NUMBER}" - sh "docker push tarundanda147/tomcat:${BUILD_NUMBER}" + kubernetesDeploy( + configs: '', + kubeConfig: [path: ''], + kubeconfigId: 'eks-cluster', + secretName: '', + ssh: [sshCredentialsId: '*', sshServer: ''], + textCredentials: [ + certificateAuthorityData: '', + clientCertificateData: '', + clientKeyData: '', + serverUrl: 'https://' + ] + ) { + echo 'Deploying to Kubernetes using Helm' + sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } - stage('Helm Deploy') { - steps { - kubernetesDeploy configs: '', kubeConfig: [path: ''], kubeconfigId: 'eks-cluster', secretName: '', ssh: [sshCredentialsId: '*', sshServer: ''], textCredentials: [certificateAuthorityData: '', clientCertificateData: '', clientKeyData: '', serverUrl: 'https://'] - { - echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" - } } } - } - } - - From 539c06f04afe4af8ef6d5d06740d071fb78516ae Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:26:44 +0530 Subject: [PATCH 090/116] Update Jenkinsfile --- Jenkinsfile | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4a10cb32d..086e8734b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,24 +29,25 @@ pipeline { } stage('Helm Deploy') { - steps { - kubernetesDeploy( - configs: '', - kubeConfig: [path: ''], - kubeconfigId: 'eks-cluster', - secretName: '', - ssh: [sshCredentialsId: '*', sshServer: ''], - textCredentials: [ - certificateAuthorityData: '', - clientCertificateData: '', - clientKeyData: '', - serverUrl: 'https://' - ] - ) { - echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" - } - } + steps { + kubernetesDeploy( + configs: '', + kubeConfig: [path: ''], + kubeconfigId: 'eks-cluster', + secretName: '', + ssh: [sshCredentialsId: '*', sshServer: ''], + textCredentials: [ + certificateAuthorityData: '', + clientCertificateData: '', + clientKeyData: '', + serverUrl: 'https://' + ] + ) { + echo 'Deploying to Kubernetes using Helm' + sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } + + } +} From a568e39ccd60ecc46dff1d07256be736b6f8bdc8 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:28:21 +0530 Subject: [PATCH 091/116] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 086e8734b..62fa72761 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,5 +49,6 @@ pipeline { } } + } } From f0a4a67a8676e1410a2a61754de55ff67f6c44fe Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:29:45 +0530 Subject: [PATCH 092/116] Update Jenkinsfile --- Jenkinsfile | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 62fa72761..2741bac95 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,28 +27,26 @@ pipeline { } } } - + stage('Helm Deploy') { - steps { - kubernetesDeploy( - configs: '', - kubeConfig: [path: ''], - kubeconfigId: 'eks-cluster', - secretName: '', - ssh: [sshCredentialsId: '*', sshServer: ''], - textCredentials: [ - certificateAuthorityData: '', - clientCertificateData: '', - clientKeyData: '', - serverUrl: 'https://' - ] - ) { - echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + steps { + kubernetesDeploy( + configs: '', + kubeConfig: [path: ''], + kubeconfigId: 'eks-cluster', + secretName: '', + ssh: [sshCredentialsId: '*', sshServer: ''], + textCredentials: [ + certificateAuthorityData: '', + clientCertificateData: '', + clientKeyData: '', + serverUrl: 'https://' + ] + ) { + echo 'Deploying to Kubernetes using Helm' + sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + } + } } } } - - - } -} From e7e27249966e2f0dceed1b16835ff54af9142f06 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 05:57:30 +0530 Subject: [PATCH 093/116] Update Jenkinsfile --- Jenkinsfile | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2741bac95..b726655d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,19 +30,7 @@ pipeline { stage('Helm Deploy') { steps { - kubernetesDeploy( - configs: '', - kubeConfig: [path: ''], - kubeconfigId: 'eks-cluster', - secretName: '', - ssh: [sshCredentialsId: '*', sshServer: ''], - textCredentials: [ - certificateAuthorityData: '', - clientCertificateData: '', - clientKeyData: '', - serverUrl: 'https://' - ] - ) { + withAWS(credentials: 'AKIA47CR2UOAWINFN6MR') { echo 'Deploying to Kubernetes using Helm' sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } From 9c0e3f1266212bf9d6cfb86ee3bf4e11569615cb Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 05:58:56 +0530 Subject: [PATCH 094/116] Update Jenkinsfile --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b726655d0..8af4e92b6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,9 +30,11 @@ pipeline { stage('Helm Deploy') { steps { - withAWS(credentials: 'AKIA47CR2UOAWINFN6MR') { + // Authenticate with AWS using IAM credentials stored in Jenkins + withAWS(credentials: 'aws-credentials-id') { echo 'Deploying to Kubernetes using Helm' - sh "helm upgrade first --install hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + // Deploy Helm chart to Kubernetes cluster + sh "helm install first hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } From 1a045528eb8a24fbb2ba4ab13f32d23f76d63d9c Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 05:59:40 +0530 Subject: [PATCH 095/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8af4e92b6..f5651efaa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,7 @@ pipeline { stage('Helm Deploy') { steps { // Authenticate with AWS using IAM credentials stored in Jenkins - withAWS(credentials: 'aws-credentials-id') { + withAWS(credentials: 'AKIA47CR2UOAWINFN6MR') { echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster sh "helm install first hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" From b81176033e122d05558550e793eae32f24087c38 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 06:03:33 +0530 Subject: [PATCH 096/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f5651efaa..4c54135a0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,7 @@ pipeline { stage('Helm Deploy') { steps { // Authenticate with AWS using IAM credentials stored in Jenkins - withAWS(credentials: 'AKIA47CR2UOAWINFN6MR') { + withCredentials([awsCredentials(credentialsId: 'AKIA47CR2UOAWINFN6MR', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) { echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster sh "helm install first hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" From 6d322e0987270102456094d2dcaf98b0b1c867b6 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 06:05:55 +0530 Subject: [PATCH 097/116] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 4c54135a0..125efb715 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,6 +32,7 @@ pipeline { steps { // Authenticate with AWS using IAM credentials stored in Jenkins withCredentials([awsCredentials(credentialsId: 'AKIA47CR2UOAWINFN6MR', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) { + sh "aws eks --region us-east-1 update-kubeconfig --name eks-cluster" echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster sh "helm install first hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" From 66225aaa9bc9effc0e6cf07e4f85aefa3c5fd90f Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 06:09:38 +0530 Subject: [PATCH 098/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 125efb715..339b45cc3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,7 @@ pipeline { stage('Helm Deploy') { steps { // Authenticate with AWS using IAM credentials stored in Jenkins - withCredentials([awsCredentials(credentialsId: 'AKIA47CR2UOAWINFN6MR', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) { + withCredentials([aws(credentials: 'AKIA47CR2UOAWINFN6MR', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) { sh "aws eks --region us-east-1 update-kubeconfig --name eks-cluster" echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster From f150041d3dc455357520c513177776d80342426b Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 06:11:48 +0530 Subject: [PATCH 099/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 339b45cc3..ff736de3b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,7 @@ pipeline { stage('Helm Deploy') { steps { // Authenticate with AWS using IAM credentials stored in Jenkins - withCredentials([aws(credentials: 'AKIA47CR2UOAWINFN6MR', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) { + withCredentials([aws(credentials: 'e4934178-c7e5-4e2b-a02d-1c35b36b42b3', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) { sh "aws eks --region us-east-1 update-kubeconfig --name eks-cluster" echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster From c6ac2952f22191a25cdf65794f881f5f6eced307 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 06:19:39 +0530 Subject: [PATCH 100/116] Update Jenkinsfile --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ff736de3b..780db675d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,12 @@ pipeline { stage('Helm Deploy') { steps { // Authenticate with AWS using IAM credentials stored in Jenkins - withCredentials([aws(credentials: 'e4934178-c7e5-4e2b-a02d-1c35b36b42b3', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) { + withCredentials([[ + $class: 'AmazonWebServicesCredentialsBinding', + credentialsId: 'e4934178-c7e5-4e2b-a02d-1c35b36b42b3', + accessKeyVariable: 'AWS_ACCESS_KEY_ID', + secretKeyVariable: 'AWS_SECRET_ACCESS_KEY' + ]]) { sh "aws eks --region us-east-1 update-kubeconfig --name eks-cluster" echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster From a0ab736844dabdf038a025a69aeca533314fead7 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:14:00 +0530 Subject: [PATCH 101/116] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 780db675d..57821057b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { stage('push') { steps { - withCredentials([usernamePassword(credentialsId: 'aed771cc-a7bd-45dc-b4ab-c30d8db5faac', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { + withCredentials([usernamePassword(credentialsId: '773e6289-72b6-476b-9e54-19702f9fb5d3', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh "docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}" sh "docker tag tomcat-war:${BUILD_NUMBER} tarundanda147/tomcat:${BUILD_NUMBER}" sh "docker push tarundanda147/tomcat:${BUILD_NUMBER}" @@ -33,7 +33,7 @@ pipeline { // Authenticate with AWS using IAM credentials stored in Jenkins withCredentials([[ $class: 'AmazonWebServicesCredentialsBinding', - credentialsId: 'e4934178-c7e5-4e2b-a02d-1c35b36b42b3', + credentialsId: '03bb86f5-d824-42dd-b9c7-da3dc566f56c', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY' ]]) { From 855da0f48345db68ba44e1f65a35194caf1fbfdf Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:19:34 +0530 Subject: [PATCH 102/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 57821057b..52024112f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,7 +40,7 @@ pipeline { sh "aws eks --region us-east-1 update-kubeconfig --name eks-cluster" echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster - sh "helm install first hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + sh "helm install first --create-namespace hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } From 1442e653547fc76fb43c3741770d6e76575c59c8 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:21:05 +0530 Subject: [PATCH 103/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 52024112f..7b22e265e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,7 +40,7 @@ pipeline { sh "aws eks --region us-east-1 update-kubeconfig --name eks-cluster" echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster - sh "helm install first --create-namespace hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + sh "helm install first --create-namespace ./hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } From cf50a3057dcb02269995397cb8a3fd667c69bd46 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:22:05 +0530 Subject: [PATCH 104/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7b22e265e..f1ecf5d90 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,7 +40,7 @@ pipeline { sh "aws eks --region us-east-1 update-kubeconfig --name eks-cluster" echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster - sh "helm install first --create-namespace ./hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + sh "helm upgrade first ./hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } From 589dd8dd5ebdc770dc364d0ad5f80ced78f116df Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:28:10 +0530 Subject: [PATCH 105/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f1ecf5d90..6aaf848a9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,7 +40,7 @@ pipeline { sh "aws eks --region us-east-1 update-kubeconfig --name eks-cluster" echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster - sh "helm upgrade first ./hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" + sh "helm upgrade first /var/lib/jenkins/workspace/eks-docker/hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } } From 9c882d006fdd64d177f8e2335f266e815b4baf81 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:29:15 +0530 Subject: [PATCH 106/116] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 6aaf848a9..1078d3f94 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,6 +40,7 @@ pipeline { sh "aws eks --region us-east-1 update-kubeconfig --name eks-cluster" echo 'Deploying to Kubernetes using Helm' // Deploy Helm chart to Kubernetes cluster + sh "helm upgrade first /var/lib/jenkins/workspace/eks-docker/hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER --dry-run" sh "helm upgrade first /var/lib/jenkins/workspace/eks-docker/hello-world-war --namespace hello-world-war --set image.tag=$BUILD_NUMBER" } } From b039de42b535b0516ce621ef605a81bace3573ce Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:33:10 +0530 Subject: [PATCH 107/116] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1078d3f94..d3b147a06 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { stage('checkout') { steps { sh 'rm -rf hello-world-war' - sh 'git clone https://github.com/tarundanda147/hello-world-war/' + sh 'git clone -b k8s https://github.com/tarundanda147/hello-world-war.git' } } From cd94e90d0c36dc2245dde7021b653606a0ee89ca Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:43:12 +0530 Subject: [PATCH 108/116] Update ingress-route.yml --- templates/ingress-route.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/ingress-route.yml b/templates/ingress-route.yml index a53e7a772..322f229b2 100644 --- a/templates/ingress-route.yml +++ b/templates/ingress-route.yml @@ -7,10 +7,10 @@ spec: rules: - http: paths: - - path: /sample + - path: /hello-world-war-1.0.0 pathType: Prefix backend: service: name: {{ .Values.serviceName }} port: - number: 8090 \ No newline at end of file + number: 8090 From 09c1c2e57d8bed9c660c54c5978eb676e2399a4c Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:49:18 +0530 Subject: [PATCH 109/116] Update deployment.yml --- templates/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/deployment.yml b/templates/deployment.yml index d5a1b72a9..db9879dbe 100644 --- a/templates/deployment.yml +++ b/templates/deployment.yml @@ -22,7 +22,7 @@ spec: spec: containers: - name: {{ .Values.deploymentLabel }} - image: {{ .Values.imageName }}:{{ .Values.imageTag }} + image: {{ .Values.imageName }}:{{ .Values.image.tag }} env: - name: TOMCAT_OPTS value: --prefix=/tomcat From f63aae2ca5d30044641d4dfbd8d5931dc9d618fa Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:17:48 +0530 Subject: [PATCH 110/116] Update deployment.yml --- templates/deployment.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/deployment.yml b/templates/deployment.yml index db9879dbe..c7b229c8a 100644 --- a/templates/deployment.yml +++ b/templates/deployment.yml @@ -33,3 +33,5 @@ spec: - name: {{ .Values.volumeName }} persistentVolumeClaim: claimName: {{ .Values.claimName }} + imagePullSecrets: + - name: my-reg-secret From 72bcd51e11f47dd420f771ffbead78d524be6d36 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:22:29 +0530 Subject: [PATCH 111/116] Create secrets.yml --- templates/secrets.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 templates/secrets.yml diff --git a/templates/secrets.yml b/templates/secrets.yml new file mode 100644 index 000000000..75535d834 --- /dev/null +++ b/templates/secrets.yml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: my-reg-secret + namespace: hello-world-war +type: kubernetes.io/dockerconfigjson +data: + .dockerconfigjson: From 230ecd04a77239b69964a1c9c75d55bb98736a9a Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:23:57 +0530 Subject: [PATCH 112/116] Update deployment.yml --- templates/deployment.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/deployment.yml b/templates/deployment.yml index c7b229c8a..a27eacdce 100644 --- a/templates/deployment.yml +++ b/templates/deployment.yml @@ -8,10 +8,10 @@ spec: replicas: {{ .Values.replicas }} strategy: type: RollingUpdate - rollingUpdate: + rollingUpdate: maxSurge: 1 maxUnavailable: 0 - selector: + selector: matchLabels: app: {{ .Values.deploymentLabel }} template: @@ -20,18 +20,18 @@ spec: labels: app: {{ .Values.deploymentLabel }} spec: - containers: + containers: - name: {{ .Values.deploymentLabel }} image: {{ .Values.imageName }}:{{ .Values.image.tag }} env: - name: TOMCAT_OPTS - value: --prefix=/tomcat - volumeMounts: + value: --prefix=/tomcat + volumeMounts: - name: {{ .Values.volumeName }} - mountPath: /usr/local/tomcat/webapps + mountPath: /usr/local/tomcat/webapps volumes: - name: {{ .Values.volumeName }} persistentVolumeClaim: claimName: {{ .Values.claimName }} - imagePullSecrets: - - name: my-reg-secret + imagePullSecrets: + - name: my-reg-secret From a45da0695f8baf915000069ac66f63411099dbef Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:32:30 +0530 Subject: [PATCH 113/116] Delete templates/secrets.yml --- templates/secrets.yml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 templates/secrets.yml diff --git a/templates/secrets.yml b/templates/secrets.yml deleted file mode 100644 index 75535d834..000000000 --- a/templates/secrets.yml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: my-reg-secret - namespace: hello-world-war -type: kubernetes.io/dockerconfigjson -data: - .dockerconfigjson: From caef11dc94ae73acb4801d31f25430b73768aa13 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:58:14 +0530 Subject: [PATCH 114/116] Update deployment.yml --- templates/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/deployment.yml b/templates/deployment.yml index a27eacdce..199bb437a 100644 --- a/templates/deployment.yml +++ b/templates/deployment.yml @@ -34,4 +34,4 @@ spec: persistentVolumeClaim: claimName: {{ .Values.claimName }} imagePullSecrets: - - name: my-reg-secret + - name: regcred From 0eea5493c9589d1f09113b477bd66bdef3481754 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:07:49 +0530 Subject: [PATCH 115/116] Update deployment.yml --- templates/deployment.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/deployment.yml b/templates/deployment.yml index 199bb437a..1feefacf4 100644 --- a/templates/deployment.yml +++ b/templates/deployment.yml @@ -23,6 +23,8 @@ spec: containers: - name: {{ .Values.deploymentLabel }} image: {{ .Values.imageName }}:{{ .Values.image.tag }} + imagePullSecrets: + - name: regcred env: - name: TOMCAT_OPTS value: --prefix=/tomcat @@ -33,5 +35,4 @@ spec: - name: {{ .Values.volumeName }} persistentVolumeClaim: claimName: {{ .Values.claimName }} - imagePullSecrets: - - name: regcred + From 039e1ebbd2af1097cfa162f14fa23b0173cf6be3 Mon Sep 17 00:00:00 2001 From: tarundanda147 <154943106+tarundanda147@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:22:22 +0530 Subject: [PATCH 116/116] Create secrets.yml --- templates/secrets.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 templates/secrets.yml diff --git a/templates/secrets.yml b/templates/secrets.yml new file mode 100644 index 000000000..1ef0c16cb --- /dev/null +++ b/templates/secrets.yml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: regcred +type: kubernetes.io/dockerconfigjson +data: + .dockerconfigjson: |- + ewogICAgImF1dGhzIjogewogICAgICAgICJodHRwczovL2luZGV4LmRvY2tlci5pby92MS8iOiB7CiAgICAgICAgICAgICJ1c2VybmFtZSI6ICJ0YXJ1bmRhbmRhMTQ3IiwKICAgICAgICAgICAgInBhc3N3b3JkIjogImRja3JfcGF0XzEtMk9nVFczNFlIMnFDb00zWnFvSTBKU2lJRSIsCiAgICAgICAgICAgICJlbWFpbCI6ICJob25leWNvY28xNDdAZ21haWwuY29tIgogICAgICAgIH0KICAgIH0KfQoK