-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile
60 lines (50 loc) · 1.46 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
pipeline {
agent {
label 'vetsgov-general-purpose'
}
environment {
DOCKER_IMAGE = env.BUILD_TAG.replaceAll(/[%\/]/, '')
}
stages {
stage('Checkout Code') {
steps {
checkout scm
}
}
stage('Run tests') {
steps {
sh 'make ci'
}
}
stage('Deploy dev and staging') {
when { branch 'master' }
steps {
// hack to get the commit hash, some plugin is swallowing git variables and I can't figure out which one
script {
commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
}
build job: 'builds/gibct-data-service', parameters: [
booleanParam(name: 'notify_slack', value: false),
stringParam(name: 'ref', value: commit),
booleanParam(name: 'release', value: false),
], wait: true
build job: 'deploys/gibct-data-service-vagov-dev', parameters: [
booleanParam(name: 'notify_slack', value: true),
booleanParam(name: 'migration_status', value: true),
stringParam(name: 'ref', value: commit),
], wait: false
build job: 'deploys/gibct-data-service-vagov-staging', parameters: [
booleanParam(name: 'notify_slack', value: true),
booleanParam(name: 'migration_status', value: true),
stringParam(name: 'ref', value: commit),
], wait: false
}
}
}
post {
always {
sh 'make clean'
deleteDir()
}
}
}