From f8aa179ee1430a884dc2dd0502cf53cdc304e486 Mon Sep 17 00:00:00 2001 From: lhari505 <87441225+lhari505@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:18:45 +0530 Subject: [PATCH 1/6] Create Jenkins --- Jenkins | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Jenkins diff --git a/Jenkins b/Jenkins new file mode 100644 index 00000000..e25224be --- /dev/null +++ b/Jenkins @@ -0,0 +1,29 @@ +pipeline +{ + agent any + stages + { + stage('testing code') + { + steps + { + sh 'echo "testing application"' + } + } + stage('deploying code') + { + steps + { + sh 'echo "deploying application"' + } + } + stage('deliver code') + { + steps + { + sh 'echo "deliver application"' + } + } + } + +} From 5ea508861a959ea2317f95d0ca6b2c2b1cd0e1ca Mon Sep 17 00:00:00 2001 From: lhari505 <87441225+lhari505@users.noreply.github.com> Date: Fri, 25 Feb 2022 10:10:16 +0530 Subject: [PATCH 2/6] Added Jenkinsfile --- Jenkinsfile | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..741b9525 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,51 @@ +pipeline { + agent any + stages { + stage('checkout scm') { + parallel { + stage('checkout scm') { + steps { + echo 'pull from git' + } + } + + stage('chech pom.xml') { + steps { + echo 'pom.xml' + } + } + + } + } + + stage('build') { + parallel { + stage('build') { + steps { + echo 'build from maven' + } + } + + stage('build dev') { + steps { + echo 'building dev' + } + } + + } + } + + stage('test') { + steps { + echo 'junit test' + } + } + + stage('deploy') { + steps { + echo 'using docker' + } + } + + } +} \ No newline at end of file From 76d945daa9d1978246a58d975e6837d52b5e8521 Mon Sep 17 00:00:00 2001 From: lhari505 <87441225+lhari505@users.noreply.github.com> Date: Fri, 25 Feb 2022 15:10:52 +0530 Subject: [PATCH 3/6] Added Jenkinsfile --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 741b9525..f7505512 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,7 +22,7 @@ pipeline { parallel { stage('build') { steps { - echo 'build from maven' + sh 'mvn clean package' } } @@ -37,7 +37,7 @@ pipeline { stage('test') { steps { - echo 'junit test' + sh 'mvn test' } } @@ -48,4 +48,7 @@ pipeline { } } + tools { + maven 'M2_HOME' + } } \ No newline at end of file From 9a6a4fe00c8b72592854acc7695a002e4a2f4eed Mon Sep 17 00:00:00 2001 From: lhari505 <87441225+lhari505@users.noreply.github.com> Date: Fri, 25 Feb 2022 15:51:59 +0530 Subject: [PATCH 4/6] Update Dockerfile --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 31f3ab15..797565a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ # Pull base image -From tomcat:8-jre8 - +FROM tomcat:8 +LABEL app=my-app # Maintainer -MAINTAINER "sai4cs@gmail.com" -COPY ./webapp.war /usr/local/tomcat/webapps -RUN cp -R /usr/local/tomcat/webapps.dist/* /usr/local/tomcat/webapps \ No newline at end of file +MAINTAINER "lharish609@gmail.com" +COPY target/webapp.war /usr/local/tomcat/webapps/myweb.war From 7232a74754e151cad7f31daf0b003a2dd4d2fdb7 Mon Sep 17 00:00:00 2001 From: lhari505 <87441225+lhari505@users.noreply.github.com> Date: Fri, 25 Feb 2022 15:52:40 +0530 Subject: [PATCH 5/6] Added Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f7505512..cbbca3f1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,7 +43,7 @@ pipeline { stage('deploy') { steps { - echo 'using docker' + sh 'docker build -t harishl/my-app:1.0.0 .' } } From 2b55d49612ebe934b2378986e2dd7c0da9bea3f9 Mon Sep 17 00:00:00 2001 From: lhari505 <87441225+lhari505@users.noreply.github.com> Date: Fri, 25 Feb 2022 16:02:51 +0530 Subject: [PATCH 6/6] Added Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cbbca3f1..2ac5bf91 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { parallel { stage('checkout scm') { steps { - echo 'pull from git' + git(url: 'https://github.com/lhari505/SaiJavaCode.git', branch: 'master') } }