-
Notifications
You must be signed in to change notification settings - Fork 63
/
Jenkinsfile
49 lines (42 loc) · 1.3 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
staging_branch = 'master'
main_branch = 'master'
pipeline {
environment {
DOCKER_IMAGE = env.BUILD_TAG.replaceAll(/[%\/]/, '')
// for PRs, BRANCH_NAME = PR-<ID>. for branches in the remote w/o a PR, BRANCH_NAME = <the name of the branch>
// THE_BRANCH is a hack to normalize this value depending on if Jenkins "discovered" using "branch" or "pull-request"
THE_BRANCH = "${env.CHANGE_BRANCH != null ? env.CHANGE_BRANCH : env.BRANCH_NAME}"
CI = "true"
RAILS_ENV = "test"
}
options {
buildDiscarder(logRotator(daysToKeepStr: '60'))
}
agent {
label 'vetsgov-general-purpose'
}
stages {
stage('Checkout Code') {
steps {
checkout scm
}
}
stage('Schedule Review Instance Creation') {
steps {
build job: 'deploys/vets-review-instance-deploy', parameters: [
stringParam(name: 'devops_branch', value: 'master'),
stringParam(name: 'api_branch', value: env.THE_BRANCH),
stringParam(name: 'web_branch', value: env.THE_BRANCH),
stringParam(name: 'content_branch', value: 'master'),
stringParam(name: 'source_repo', value: 'vets-api'),
], wait: false
}
}
}
post {
always {
sh 'env=$RAILS_ENV make down'
deleteDir() /* clean up our workspace */
}
}
}