Update Jenkinsfile

This commit is contained in:
ametgud4u 2023-08-23 21:01:35 +05:30 committed by GitHub
parent 40cca255cc
commit e1e2ed9925
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

57
Jenkinsfile vendored
View file

@ -1,22 +1,39 @@
pipeline { \pipeline {
agent { agent { label 'kmaster' }
kubernetes { stages {
label 'promo-app' // all your pods will be named with this prefix, followed by a unique id stage('SCM') {
idleMinutes 5 // how long the pod will live after no jobs have run on it steps {
yamlFile 'build-pod.yaml' // path to the pod definition relative to the root of our project // Build the application
defaultContainer 'maven' // define a default container if more than a few stages use it, will default to jnlp container sh 'cd /apps/build'
} git 'https://github.com/ametgud4u/spring-petclinic.git'
} }
stages { }
stage('scm'){ stage('Build') {
steps { steps {
git 'https://github.com/spring-projects/spring-petclinic.git' // Build the application
} sh '''
} export JAVA_HOME=/opt/jdk-17
stage('Build'){ export PATH=$PATH:$JAVA_HOME/bin
steps { java -version
sh 'mvn clean package -DskipTests=true' 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'
}
}
} }
} }
}