ci: Begin continuous integration setup
This commit is contained in:
50
ci/dch-gw.jenkinsfile
Normal file
50
ci/dch-gw.jenkinsfile
Normal file
@@ -0,0 +1,50 @@
|
||||
// vim: set ft=groovy sw=4 ts=4 sts=4 et :
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
dockerfile {
|
||||
dir 'ci'
|
||||
}
|
||||
}
|
||||
|
||||
triggers {
|
||||
pollSCM ''
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Prepare') {
|
||||
steps {
|
||||
withCredentials([file(
|
||||
credentialsId: 'vault-jenkins@gw0',
|
||||
variable: 'SUDO_PASS_FILE')]) {
|
||||
sh 'cp -f "${SUDO_PASS_FILE}" host_vars/gw0/sudo-pass'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Services') {
|
||||
steps {
|
||||
withCredentials([file(
|
||||
credentialsId: 'ansible-vault',
|
||||
variable: 'ANSIBLE_VAULT_PASSWORD_FILE')]) {
|
||||
sshagent(['jenkins-ssh']) {
|
||||
sh 'ansible-playbook --diff -b dhcpd.yml radvd.yml'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Firewall') {
|
||||
steps {
|
||||
withCredentials([file(
|
||||
credentialsId: 'ansible-vault',
|
||||
variable: 'ANSIBLE_VAULT_PASSWORD_FILE')]) {
|
||||
sshagent(['jenkins-ssh']) {
|
||||
sh 'ansible-playbook --diff -b dch-gw.yml'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user