mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-18 13:35:50 +00:00
adding pipeline for deploying to pivotal
This commit is contained in:
parent
7fc4541bb2
commit
7cc050a902
1 changed files with 32 additions and 0 deletions
32
jenkinsfiles/pivotal
Normal file
32
jenkinsfiles/pivotal
Normal file
|
@ -0,0 +1,32 @@
|
|||
pipeline {
|
||||
agent none
|
||||
stages {
|
||||
stage('Build') {
|
||||
agent {
|
||||
docker {
|
||||
image 'maven:3.5.0'
|
||||
args '-e INITIAL_ADMIN_USER -e INITIAL_ADMIN_PASSWORD --network=${LDOP_NETWORK_NAME}'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
configFileProvider(
|
||||
[configFile(fileId: 'nexus', variable: 'MAVEN_SETTINGS')]) {
|
||||
sh 'mvn -s $MAVEN_SETTINGS clean deploy -DskipTests=true -B'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Deploy to Pivotal') {
|
||||
agent {
|
||||
docker {
|
||||
image 'liatrio/cf-cli'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'pivotal', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME')]){
|
||||
sh "cf api https://api.run.pivotal.io && cf login -u ${env.USERNAME} -p ${env.PASSWORD}"
|
||||
sh 'cf push'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue