mcmillian.dev/Jenkinsfile

28 lines
1.1 KiB
Text
Raw Permalink Normal View History

2023-11-10 23:56:57 +00:00
pipeline {
agent none
environment {
2024-09-08 18:56:47 +00:00
CHAT = "spacenerdmo@clacks.network"
2023-11-10 23:56:57 +00:00
MAIL = "morgan@mcmillian.dev"
ANSIBLE_HOST_KEY_CHECKING = "False"
}
stages {
stage('Execute playbook') {
agent { label 'ansible' }
steps {
2024-09-08 18:56:47 +00:00
ansiblePlaybook(playbook: "main.yaml", inventory: "hosts.ini", credentialsId: "website-deploy")
2023-11-10 23:56:57 +00:00
}
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}"
}
}
}
}
}