© 2017 CloudBees, Inc. All Rights Reserved. 16
node {
try {
stage('Build') {
checkout scm
docker.image('ubuntu').inside {
sh 'mvn clean install'
}
}
}
catch(exc) {
mail to:'
[email protected]', subject:'FAILURE:'
}
finally {
deleteDir()
}
}
pipeline {
agent {
docker 'ubuntu'
}
stages {
stage('Build') {
steps {
sh 'mvn clean install'
}
}
}
post {
always {
deleteDir()
}
failure {
mail to:'
[email protected]', subject:'FAILURE:'
}
}
}
Scripted Pipeline Declarative Pipeline