ci: Add smtp pipeline

jenkins-master
Dustin 2018-04-15 11:40:39 -05:00
parent 2d58fdcebf
commit 933d318cbe
1 changed files with 43 additions and 0 deletions

43
ci/smtp.jenkinsfile Normal file
View File

@ -0,0 +1,43 @@
// vim: set ft=groovy sw=4 ts=4 sts=4 et :
pipeline {
agent {
label 'ansible'
}
triggers {
cron 'H H * * *'
}
stages {
stage('kinit') {
steps {
withCredentials([file(
credentialsId: 'keytab-jenkins@pyrocufflink.blue',
variable: 'KEYTAB')]) {
sh 'kinit -kt "${KEYTAB}" jenkins@PYROCUFFLINK.BLUE'
}
}
}
stage('SMTP') {
steps {
withCredentials([file(
credentialsId: 'vault-jenkins@pyrocufflink.blue',
variable: 'SUDO_PASS_FILE')]) {
ansiblePlaybook \
playbook: 'smtp-relay.yml',
become: true,
vaultCredentialsId: 'ansible-vault',
extras: '-e@"${SUDO_PASS_FILE}" --diff'
}
}
}
}
post {
always {
sh 'kdestroy'
}
}
}