From 45688030a8665145102e6c6d7dab802ad5aca00d Mon Sep 17 00:00:00 2001 From: vishal-106 <133694629+vishal-106@users.noreply.github.com> Date: Fri, 30 Jun 2023 00:37:31 +0530 Subject: [PATCH 1/4] Add files via upload --- Jenkinsfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..0ed2ba1 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,24 @@ +pipeline{ + agent any + tool { + maven 'maven' + } +stages { + stage ('Build') { + steps{ + sh 'mvn clean package' + } + post{ + success { + ech0 "Archiving the Artifacts" + ArchiveArtifacts Artifacts: '**/target/*.war' + } + } + } +} +stage ('Deploy to tomcat server') { + steps { + deploy adapters: [tomcat9(credentialsId: 'apache-tomcat', path: '', url: 'http://35.154.254.156:8080/')], contextPath: null, war: '**/*.war' + } +} +} \ No newline at end of file From 8fc4b5631e564a484c3eb239e78cc70b675c4b9f Mon Sep 17 00:00:00 2001 From: vishal-106 <133694629+vishal-106@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:58:05 +0530 Subject: [PATCH 2/4] added --- Jenkinsfile | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0ed2ba1..3291c6c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,24 +1,23 @@ pipeline{ - agent any - tool { - maven 'maven' - } + agent any +} stages { - stage ('Build') { - steps{ - sh 'mvn clean package' - } - post{ - success { - ech0 "Archiving the Artifacts" - ArchiveArtifacts Artifacts: '**/target/*.war' - } - } + stage('checkout') { + steps { + git branch: 'main', url: 'https://github.com/Dev-april-2023/java-example.git' } -} -stage ('Deploy to tomcat server') { + } + + stage('build') { + steps { + sh 'mvn clean install' + } + } + + stage('deply') { steps { - deploy adapters: [tomcat9(credentialsId: 'apache-tomcat', path: '', url: 'http://35.154.254.156:8080/')], contextPath: null, war: '**/*.war' + git --version } + } + } -} \ No newline at end of file From 431fee50c63e27621e7df656b526e478f8abc74a Mon Sep 17 00:00:00 2001 From: vishal-106 <133694629+vishal-106@users.noreply.github.com> Date: Sun, 2 Jul 2023 23:55:16 +0530 Subject: [PATCH 3/4] added --- Jenkinsfile | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3291c6c..ae55e46 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,23 +1,24 @@ pipeline{ agent any -} + stages { - stage('checkout') { - steps { - git branch: 'main', url: 'https://github.com/Dev-april-2023/java-example.git' - } - } + stage('checkout') { + steps { + echo " Echo this is checkout stage" + } + } - stage('build') { - steps { - sh 'mvn clean install' - } - } + stage('build') { + steps { + echo " echo this is checkout build stage" + } + } - stage('deply') { - steps { - git --version - } + stage('deploy') { + steps { + echo "echo this is checkout deploy" + } } } +} \ No newline at end of file From 08837f731b191298f050ec9017e1d4689df389c0 Mon Sep 17 00:00:00 2001 From: vishal-106 <133694629+vishal-106@users.noreply.github.com> Date: Mon, 3 Jul 2023 00:33:32 +0530 Subject: [PATCH 4/4] Update Jenkinsfile --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ae55e46..6489f45 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,7 @@ stages { stage('checkout') { steps { echo " Echo this is checkout stage" + git branch: 'main', url: 'https://github.com/Dev-april-2023/java-example.git' } } @@ -21,4 +22,4 @@ stages { } } -} \ No newline at end of file +}