switch to jenkins
Some checks failed
thrrgilag/morgan.mcmillian.dev/pipeline/head There was a failure building this commit

This commit is contained in:
Morgan McMillian 2023-11-10 16:14:22 -08:00
parent 57aeab7739
commit 030ff6c64b

33
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,33 @@
pipeline {
agent none
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') {
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}"
}
}
}
}
}