morgan.mcmillian.dev/Jenkinsfile

33 lines
1.2 KiB
Text
Raw Normal View History

2023-11-11 00:14:22 +00:00
pipeline {
2024-08-09 16:24:03 +00:00
agent { label 'hugo' }
2023-11-11 00:14:22 +00:00
environment {
2024-08-09 16:24:03 +00:00
CHAT = "spacenerdmo@clacks.network"
2023-11-11 00:14:22 +00:00
MAIL = "morgan@mcmillian.dev"
ANSIBLE_HOST_KEY_CHECKING = "False"
}
stages {
stage('Build website') {
steps {
sh 'git submodule update --init'
sh 'hugo'
}
}
stage('Execute playbook') {
steps {
2024-09-08 15:53:51 +00:00
ansiblePlaybook(playbook: "main.yaml", inventory: "hosts.ini", credentialsId: "website-deploy")
2023-11-11 00:14:22 +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}"
}
}
}
}
}