Skip to content

Instantly share code, notes, and snippets.

@apemberton
Created September 28, 2015 14:45
Show Gist options
  • Save apemberton/dbc3c45d9f2a92e08c92 to your computer and use it in GitHub Desktop.
Save apemberton/dbc3c45d9f2a92e08c92 to your computer and use it in GitHub Desktop.
stage 'build'
node {
git 'https://github.com/cloudbees/todo-api.git'
withEnv(["PATH+MAVEN=${tool 'm3'}/bin"]) {
sh "mvn -DskipTests=true clean package"
}
stash excludes: 'target/*', includes: '**', name: 'source'
}
stage 'test'
parallel 'integration': {
node{
unstash 'source'
withEnv(["PATH+MAVEN=${tool 'm3'}/bin"]) {
sh "mvn clean verify"
}
}
}, 'quality': {
node{
unstash 'source'
withEnv(["PATH+MAVEN=${tool 'm3'}/bin"]) {
sh "mvn sonar:sonar"
}
}
}
stage 'approve'
timeout(time: 7, unit: 'DAYS') {
input message: 'Do you want to deploy?', submitter: 'ops'
}
stage name:'deploy', concurrency: 1
node{
withEnv(["PATH+MAVEN=${tool 'm3'}/bin"]) {
sh "mvn cargo:deploy"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment