switch to jenkins
All checks were successful
thrrgilag/mcmillian.dev/pipeline/head This commit looks good
All checks were successful
thrrgilag/mcmillian.dev/pipeline/head This commit looks good
This commit is contained in:
parent
7a2262efc0
commit
e7164d7cbe
1 changed files with 27 additions and 0 deletions
27
Jenkinsfile
vendored
Normal file
27
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
pipeline {
|
||||
agent none
|
||||
environment {
|
||||
CHAT = "morgan@mcmillian.dev"
|
||||
MAIL = "morgan@mcmillian.dev"
|
||||
ANSIBLE_HOST_KEY_CHECKING = "False"
|
||||
}
|
||||
stages {
|
||||
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}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue