adding pipeline for deploying to pivotal

This commit is contained in:
Benjamin Stein 2017-08-02 11:54:12 -07:00
parent 7fc4541bb2
commit 7cc050a902

32
jenkinsfiles/pivotal Normal file
View 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'
}
}
}
}
}