morgan.mcmillian.dev/Jenkinsfile

39 lines
1.6 KiB
Text
Raw Normal View History

2023-02-10 01:36:29 +00:00
pipeline {
2023-02-12 14:17:07 +00:00
agent { label 'fedora' }
2023-02-10 01:36:29 +00:00
stages {
stage('Build site') {
steps {
2023-03-02 14:02:56 +00:00
// mattermostSend "Site build started - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
2023-02-12 14:47:41 +00:00
sh 'git submodule update --init'
2023-02-12 14:17:07 +00:00
sh 'hugo'
2023-02-10 01:36:29 +00:00
}
2023-03-02 14:02:56 +00:00
// post {
// success {
// mattermostSend color: "good", message: "Site build success - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
// }
// failure {
// mattermostSend color: "danger", message: "Site build failure - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
// }
// }
2023-02-10 01:36:29 +00:00
}
stage('Deploy site') {
steps {
2023-03-02 14:02:56 +00:00
// mattermostSend "Site deploy started - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
2023-02-10 01:36:29 +00:00
ansiblePlaybook(
playbook: 'main.yaml',
inventory: 'hosts.ini',
credentialsId: 'onedrop-vetinari'
)
}
2023-03-02 14:02:56 +00:00
// post {
// success {
// mattermostSend color: "good", message: "Site deploy success - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
// }
// failure {
// mattermostSend color: "danger", message: "Site deploy failure - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
// }
// }
2023-02-10 01:36:29 +00:00
}
}
}