From e1e2ed99250e6a48a6e16af9b4e1be8ffc9582c3 Mon Sep 17 00:00:00 2001 From: ametgud4u <64977602+ametgud4u@users.noreply.github.com> Date: Wed, 23 Aug 2023 21:01:35 +0530 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 57 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ee3db3f78..e63379d25 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,22 +1,39 @@ -pipeline { - agent { - kubernetes { - label 'promo-app' // all your pods will be named with this prefix, followed by a unique id - idleMinutes 5 // how long the pod will live after no jobs have run on it - yamlFile 'build-pod.yaml' // path to the pod definition relative to the root of our project - defaultContainer 'maven' // define a default container if more than a few stages use it, will default to jnlp container - } - } - stages { - stage('scm'){ - steps { - git 'https://github.com/spring-projects/spring-petclinic.git' - } - } - stage('Build'){ - steps { - sh 'mvn clean package -DskipTests=true' - } +\pipeline { + agent { label 'kmaster' } + stages { + stage('SCM') { + steps { + // Build the application + sh 'cd /apps/build' + git 'https://github.com/ametgud4u/spring-petclinic.git' + } + } + stage('Build') { + steps { + // Build the application + sh ''' + export JAVA_HOME=/opt/jdk-17 + export PATH=$PATH:$JAVA_HOME/bin + java -version + cd /apps/build/ + ./mvnw package -DskipTests=true + ''' + } + } + stage('Deployment on UT') { + steps { + // Run the tests + sh ''' + echo "deploing to UT" + echo " deploying to REG" + ''' + } + } + stage('Deployment on REG') { + steps { + // Deploy the application + sh 'echo copying to REG' + } + } } } -}