Skip to content

Instantly share code, notes, and snippets.

@rsandell
Created October 25, 2016 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rsandell/89195a28ff35bd566f697e24c7968bad to your computer and use it in GitHub Desktop.
Save rsandell/89195a28ff35bd566f697e24c7968bad to your computer and use it in GitHub Desktop.
Example declarative pipeline
pipeline {
agent docker: "maven:3.3.9-jdk-8"
environment {
MAVEN_OPTS = "-Xmx1024m"
}
stages {
stage("Build") {
steps {
sh 'mvn clean install -B -Dmaven.test.failure.ignore=true'
}
post {
success {
archive "**/target/**/*.jar"
junit '**/target/surefire-reports/*.xml'
}
}
}
}
postBuild {
always {
echo "Build done"
}
}
notifications {
success {
mail to: "anyone@example.com", subject: "Build Successful"
}
failure {
mail to: "anyone@example.com", subject: "Build Failed"
}
unstable {
mail to: "anyone@example.com", subject: "Build Unstable"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment