Morgan McMillian
03bb29194f
All checks were successful
thrrgilag/mcmillian.us/pipeline/head This commit looks good
26 lines
1 KiB
Groovy
26 lines
1 KiB
Groovy
pipeline {
|
|
agent none
|
|
environment {
|
|
CHAT = "morgan@mcmillian.dev"
|
|
MAIL = "morgan@mcmillian.dev"
|
|
}
|
|
stages {
|
|
stage('Execute playbook') {
|
|
agent { label 'ansible' }
|
|
steps {
|
|
ansiblePlaybook(playbook: "main.yaml", inventory: "hosts.ini", credentialsId: "igor")
|
|
}
|
|
post {
|
|
success {
|
|
jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Deploy Succeeded', notifySuspects: true, targets: "${CHAT}"
|
|
}
|
|
failure {
|
|
jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Deploy Failed', notifySuspects: true, targets: "${CHAT}"
|
|
mail to: "${MAIL}",
|
|
subject: "Deploy Failed: ${currentBuild.fullDisplayName}",
|
|
body: "Something is wrong with ${env.BUILD_URL}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|