From d19c534abd6a3135064420263a1287bf186ffe30 Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Sun, 11 Feb 2024 05:49:41 -0500 Subject: [PATCH 01/11] Create Dockerfile --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d5374bb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:22.04 + +MAINTAINER its an optional instructions + +RUN apt update -y && apt install openjdk-8-jdk wget -y + +RUN wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.98/bin/apache-tomcat-8.5.98.tar.gz + +RUN tar -xzf apache-tomcat-8.5.98.tar.gz + +EXPOSE 8080 + +WORKDIR /apache-tomcat-8.5.98/ + +#COPY vprofile-v1.war /apache-tomcat-8.5.98/webapps/ + +ENTRYPOINT ["/apache-tomcat-8.5.98/bin/catalina.sh", "run"] + From a6965d00ddcc60bfff30737ba351fb7f8bf8eb96 Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Sun, 11 Feb 2024 20:49:14 -0500 Subject: [PATCH 02/11] Update Dockerfile From c3bb4c48b07021cf6f30654b507025b616a5332f Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Mon, 12 Feb 2024 06:15:27 -0500 Subject: [PATCH 03/11] Create Jenkinsfile-2 --- Jenkinsfile-2 | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Jenkinsfile-2 diff --git a/Jenkinsfile-2 b/Jenkinsfile-2 new file mode 100644 index 0000000..f8bf7a9 --- /dev/null +++ b/Jenkinsfile-2 @@ -0,0 +1,60 @@ +pipeline { + environment { + registry = "komal921/docker-test" + reigistryCredential = 'dock-creds' + dockerImage = '' + } + agent any + tools { + jdk "java-8" + maven "maven-3" + } + stages { + stage('Cloning Git') { + steps { + git 'https://github.com/komalkhiratkar/VProfile.git' + } + } + + stage ('Build maven') { + steps { + sh 'mvn package' + } + } + + stage('Building image') { + steps{ + script { + dockerImage = docker.build registry + ":$BUILD_NUMBER" + } + } + } + + stage('Deploy Image') { + steps{ + script { + docker.withRegistry( '', registryCredential ) { + dockerImage.push() + } + } + } + } + stage('Remove Unused docker image') { + steps{ + sh "docker rmi $registry:$BUILD_NUMBER" + } + } + stage ('pull and run docker latest image') { + steps{ + script { + withDockerRegistry(credentialsId: 'dock-creds') { + sh "docker build -t vprofile-image ." + sh "docker run -itd vprofile-image" + } + } + } + } + } + } + + From 3a173241f01cfa44d5ced4b2dde092e51de79130 Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:45:13 -0500 Subject: [PATCH 04/11] Update Jenkinsfile-2 --- Jenkinsfile-2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile-2 b/Jenkinsfile-2 index f8bf7a9..7c02bfd 100644 --- a/Jenkinsfile-2 +++ b/Jenkinsfile-2 @@ -48,8 +48,8 @@ pipeline { steps{ script { withDockerRegistry(credentialsId: 'dock-creds') { - sh "docker build -t vprofile-image ." - sh "docker run -itd vprofile-image" + sh "docker build -t komal921/docker-test ." + sh "docker run -itd komal921/docker-test" } } } From 0f46d5e883c0314ccb3ef0a1ba4af2072e391948 Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Mon, 12 Feb 2024 21:13:16 -0500 Subject: [PATCH 05/11] Update Jenkinsfile-2 --- Jenkinsfile-2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-2 b/Jenkinsfile-2 index 7c02bfd..39e205e 100644 --- a/Jenkinsfile-2 +++ b/Jenkinsfile-2 @@ -47,7 +47,7 @@ pipeline { stage ('pull and run docker latest image') { steps{ script { - withDockerRegistry(credentialsId: 'dock-creds') { + withDockerRegistry(credentialsId: 'docc-credentials') { sh "docker build -t komal921/docker-test ." sh "docker run -itd komal921/docker-test" } From 69805db5105f9e5872ff174a1317da674bc63e99 Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Mon, 12 Feb 2024 21:17:28 -0500 Subject: [PATCH 06/11] Update Jenkinsfile-2 --- Jenkinsfile-2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-2 b/Jenkinsfile-2 index 39e205e..68309d3 100644 --- a/Jenkinsfile-2 +++ b/Jenkinsfile-2 @@ -12,7 +12,7 @@ pipeline { stages { stage('Cloning Git') { steps { - git 'https://github.com/komalkhiratkar/VProfile.git' + git git branch: 'develop', changelog: false, poll: false, url: 'https://github.com/komalkhiratkar/VProfile.git' } } From f44afb67bdd4314ec0178846b3b467019d7138de Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Mon, 12 Feb 2024 21:20:31 -0500 Subject: [PATCH 07/11] Update Jenkinsfile-2 --- Jenkinsfile-2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-2 b/Jenkinsfile-2 index 68309d3..2c35c02 100644 --- a/Jenkinsfile-2 +++ b/Jenkinsfile-2 @@ -12,7 +12,7 @@ pipeline { stages { stage('Cloning Git') { steps { - git git branch: 'develop', changelog: false, poll: false, url: 'https://github.com/komalkhiratkar/VProfile.git' + gitgit branch: 'develop', changelog: false, poll: false, url: 'https://github.com/komalkhiratkar/VProfile.git' } } From 83294bf67cba087d45303eb170f7d7cd1484ac07 Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Mon, 12 Feb 2024 21:21:55 -0500 Subject: [PATCH 08/11] Update Jenkinsfile-2 --- Jenkinsfile-2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-2 b/Jenkinsfile-2 index 2c35c02..412cf40 100644 --- a/Jenkinsfile-2 +++ b/Jenkinsfile-2 @@ -12,7 +12,7 @@ pipeline { stages { stage('Cloning Git') { steps { - gitgit branch: 'develop', changelog: false, poll: false, url: 'https://github.com/komalkhiratkar/VProfile.git' + git branch: 'develop', changelog: false, poll: false, url: 'https://github.com/komalkhiratkar/VProfile.git' } } From d596ffa9aa5d8a398018ad44a3a472be3f0ba523 Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Mon, 12 Feb 2024 23:33:34 -0500 Subject: [PATCH 09/11] Update Jenkinsfile-2 --- Jenkinsfile-2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile-2 b/Jenkinsfile-2 index 412cf40..34fb3bb 100644 --- a/Jenkinsfile-2 +++ b/Jenkinsfile-2 @@ -48,8 +48,8 @@ pipeline { steps{ script { withDockerRegistry(credentialsId: 'docc-credentials') { - sh "docker build -t komal921/docker-test ." - sh "docker run -itd komal921/docker-test" + sh "docker build -t komal921/docker-test ." + sh "docker run -itd komal921/docker-test" } } } From 49da302b45a8f477a37c59f84db6bab659aceda8 Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Mon, 12 Feb 2024 23:42:09 -0500 Subject: [PATCH 10/11] Update Jenkinsfile-2 --- Jenkinsfile-2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-2 b/Jenkinsfile-2 index 34fb3bb..9c24da2 100644 --- a/Jenkinsfile-2 +++ b/Jenkinsfile-2 @@ -1,7 +1,7 @@ pipeline { environment { registry = "komal921/docker-test" - reigistryCredential = 'dock-creds' + reigistryCredential = 'docc-credentials' dockerImage = '' } agent any From 381b70052459978f5c1c2d12747a07719549b156 Mon Sep 17 00:00:00 2001 From: komalkhiratkar <152837472+komalkhiratkar@users.noreply.github.com> Date: Tue, 13 Feb 2024 00:14:43 -0500 Subject: [PATCH 11/11] Update Jenkinsfile-2 --- Jenkinsfile-2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-2 b/Jenkinsfile-2 index 9c24da2..4b661ba 100644 --- a/Jenkinsfile-2 +++ b/Jenkinsfile-2 @@ -1,7 +1,7 @@ pipeline { environment { registry = "komal921/docker-test" - reigistryCredential = 'docc-credentials' + registryCredential = 'docc-credentials' dockerImage = '' } agent any