Example declarative pipeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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