Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyrille-leclerc/7f621c341e193622c844 to your computer and use it in GitHub Desktop.
Save cyrille-leclerc/7f621c341e193622c844 to your computer and use it in GitHub Desktop.
Jenkins Workflow with Vagrant and Puppet
stage name: 'BUILD', concurrency: 1
node('local-slave-1') {
ws { // COMPILE AND JUNIT
git url: 'https://github.com/cyrille-leclerc/spring-petclinic.git'
env.PATH = "${tool 'Maven 3.x'}/bin:${env.PATH}"
sh 'mvn -o -Dmaven.test.skip=true package'
archive 'src, target/petclinic.war'
step([$class: 'Fingerprinter', targets: 'target/petclinic.war'])
// step $class: 'hudson.tasks.junit.JUnitResultArchiver', testResults: 'target/surefire-reports/*.xml'
}
ws { // DEPLOY WITH PUPPET
stage 'DEPLOY'
checkpoint 'Deploy'
git url: 'https://github.com/CloudBees-community/vagrant-puppet-petclinic.git'
sh "sed -i .bak 's/default.pp/default-jenkins.pp/g' Vagrantfile"
unarchive mapping: ['target/petclinic.war': 'modules/petclinic/files/petclinic.war']
sh "vagrant up"
sh "vagrant provision"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment