-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
58 lines (49 loc) · 1.24 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
pipeline {
agent none
parameters {
string(name: 'GIT_COMMIT', defaultValue: 'master', description: 'Commit SHA or origin branch to deploy')
}
stages {
stage('release: dev') {
steps {
ci_pipeline("dev", params.GIT_COMMIT)
}
}
stage('release: staging') {
when {
expression {
milestone label: "release-staging"
input message: 'Deploy to staging?'
return true
}
beforeAgent true
}
steps {
ci_pipeline("staging", params.GIT_COMMIT)
}
}
stage('release: prod') {
when {
expression {
milestone label: "release-prod"
input message: 'Deploy to prod?'
return true
}
beforeAgent true
}
steps {
ci_pipeline("prod", params.GIT_COMMIT)
}
}
}
}
void ci_pipeline(env, version) {
lock("company-matching-service-ci-pipeline-${env}") {
build job: "ci-pipeline", parameters: [
string(name: "Team", value: "data-workspace-apps"),
string(name: "Project", value: "company-matching-service"),
string(name: "Environment", value: env),
string(name: "Version", value: version)
]
}
}