Morgan McMillian
798f5c3f8d
Some checks failed
git.dreamfall.space/morgan.mcmillian.dev/pipeline/head There was a failure building this commit
32 lines
1.2 KiB
Groovy
32 lines
1.2 KiB
Groovy
pipeline {
|
|
agent { label 'hugo' }
|
|
environment {
|
|
CHAT = "spacenerdmo@clacks.network"
|
|
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 {
|
|
ansiblePlaybook(playbook: "main.yaml", inventory: "hosts.ini", credentialsId: "website-deply")
|
|
}
|
|
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}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|