morgan.mcmillian.dev/Jenkinsfile
Morgan McMillian fc1990e4f3
All checks were successful
thrrgilag/morgan.mcmillian.dev/pipeline/head This commit looks good
fix syntax error
2023-11-10 16:20:31 -08:00

33 lines
1.2 KiB
Groovy

pipeline {
agent { label 'ansible' }
environment {
CHAT = "morgan@mcmillian.dev"
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: "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}"
}
}
}
}
}