-
Notifications
You must be signed in to change notification settings - Fork 17
/
Jenkinsfile
91 lines (87 loc) · 2.7 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!groovy
// Import shared lib.
@Library('jenkins-shared-library') _
/*
Declare variables.
- indicator_list should contain all the indicators to handle in the pipeline.
- Keep in sync with '.github/workflows/python-ci.yml'.
- TODO: #527 Get this list automatically from python-ci.yml at runtime.
*/
def indicator_list = ["backfill_corrections", "changehc", "claims_hosp", "google_symptoms", "hhs_hosp", "nchs_mortality", "quidel_covidtest", "sir_complainsalot", "doctor_visits", "nwss_wastewater", "nssp"]
def build_package_main = [:]
def build_package_prod = [:]
def deploy_staging = [:]
def deploy_production = [:]
pipeline {
agent any
stages {
stage('Build and Package main') {
when {
branch "main";
}
steps {
script {
indicator_list.each { indicator ->
build_package_main[indicator] = {
sh "jenkins/build-and-package.sh ${indicator} main"
}
}
parallel build_package_main
}
}
}
stage('Build and Package prod') {
when {
branch "prod";
}
steps {
script {
indicator_list.each { indicator ->
build_package_prod[indicator] = {
sh "jenkins/build-and-package.sh ${indicator} prod"
}
}
parallel build_package_prod
}
}
}
stage('Deploy staging') {
when {
branch "main";
}
steps {
script {
indicator_list.each { indicator ->
deploy_staging[indicator] = {
sh "jenkins/deploy-staging.sh ${indicator}"
}
}
parallel deploy_staging
}
}
}
stage('Deploy production') {
when {
branch "prod";
}
steps {
script {
indicator_list.each { indicator ->
deploy_production[indicator] = {
sh "jenkins/deploy-production.sh ${indicator}"
}
}
parallel deploy_production
}
}
}
}
post {
always {
script {
// Use slackNotifier.groovy from shared lib.
slackNotifier(currentBuild.currentResult)
}
}
}
}