morgan.mcmillian.dev/Jenkinsfile

45 lines
1.7 KiB
Text
Raw Permalink Normal View History

2023-02-10 01:36:29 +00:00
pipeline {
2023-02-10 01:47:50 +00:00
agent none
2023-02-10 01:36:29 +00:00
stages {
stage('Build site') {
2023-02-10 01:47:50 +00:00
agent {
docker {
image 'git.dreamfall.space/thrrgilag/kiln:latest'
label 'docker-build'
}
}
2023-02-10 01:36:29 +00:00
steps {
mattermostSend "Site build started - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
sh 'kiln build'
}
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>)"
}
}
}
stage('Deploy site') {
2023-02-10 01:47:50 +00:00
agent { label 'docker-build' }
2023-02-10 01:36:29 +00:00
steps {
mattermostSend "Site deploy started - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
ansiblePlaybook(
playbook: 'main.yaml',
inventory: 'hosts.ini',
credentialsId: 'onedrop-vetinari'
)
}
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>)"
}
}
}
}
}