forked from GSA/project-open-data-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
27 lines (27 loc) · 820 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
pipeline {
agent any
environment {
INVENTORY = 'inventories/sandbox'
PLAYBOOK = 'dashboard-web.yml'
}
stages {
stage('deploy') {
when { anyOf { branch 'master' } }
environment {
ANSIBLE_VAULT_FILE = credentials('ansible-vault-secret')
SSH_KEY_FILE = credentials('datagov-sandbox')
}
steps {
ansiColor('xterm') {
echo 'Deploying with Ansible'
sh 'docker run --rm -v $SSH_KEY_FILE:$SSH_KEY_FILE -v $ANSIBLE_VAULT_FILE:$ANSIBLE_VAULT_FILE -u $(id -u) datagov/datagov-deploy:latest pipenv run ansible-playbook --key-file=$SSH_KEY_FILE --vault-password-file=$ANSIBLE_VAULT_FILE --inventory $INVENTORY $PLAYBOOK'
}
}
}
}
post {
always {
step([$class: 'GitHubIssueNotifier', issueAppend: true])
}
}
}