setup site deployment via jenkins
Some checks failed
dreamfall/morgan.mcmillian.dev/pipeline/head There was a failure building this commit
Some checks failed
dreamfall/morgan.mcmillian.dev/pipeline/head There was a failure building this commit
This commit is contained in:
parent
048dd52e57
commit
fbee2cfb8c
3 changed files with 55 additions and 0 deletions
42
Jenkinsfile
vendored
Normal file
42
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
pipeline {
|
||||
agent {
|
||||
docker {
|
||||
image 'git.dreamfall.space/thrrgilag/kiln:latest'
|
||||
label 'docker-build'
|
||||
}
|
||||
}
|
||||
stages {
|
||||
stage('Build site') {
|
||||
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') {
|
||||
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>)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
2
hosts.ini
Normal file
2
hosts.ini
Normal file
|
@ -0,0 +1,2 @@
|
|||
[web]
|
||||
vetinari.dreamfall.space
|
11
main.yaml
Normal file
11
main.yaml
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
- name: Deploy morgan.mcmillian.dev site
|
||||
hosts: web
|
||||
vars:
|
||||
html_location: /var/www/html/morgan.mcmillian.dev
|
||||
|
||||
tasks:
|
||||
- name: Sync html directory
|
||||
ansible.posix.synchronize:
|
||||
src: public/html/
|
||||
dest: "{{ html_location }}/"
|
Loading…
Reference in a new issue