10
10
- TODO: #527 Get this list automatically from python-ci.yml at runtime.
11
11
*/
12
12
13
- def indicator_list = [" backfill_corrections" , " changehc" , " claims_hosp" , " google_symptoms" , " hhs_hosp" , " nchs_mortality" , " quidel_covidtest" , " sir_complainsalot" , " doctor_visits" , " nwss_wastewater" , " nssp" ]
13
+ def indicator_list = [' backfill_corrections' , ' changehc' , ' claims_hosp' , ' google_symptoms' , ' hhs_hosp' , ' nchs_mortality' , ' quidel_covidtest' , ' sir_complainsalot' , ' doctor_visits' , ' nwss_wastewater' , ' nssp' ]
14
14
def build_package_main = [:]
15
15
def build_package_prod = [:]
16
16
def deploy_staging = [:]
@@ -19,39 +19,62 @@ def deploy_production = [:]
19
19
pipeline {
20
20
agent any
21
21
stages {
22
- stage(' Build and Package main' ) {
22
+ stage(' Build dev/feature branch' ) {
23
+ when {
24
+ not {
25
+ anyOf {
26
+ branch ' main'
27
+ branch ' prod'
28
+ }
29
+ }
30
+ }
31
+ steps {
32
+ script {
33
+ indicator_list. each { indicator ->
34
+ stage(" Build ${ indicator} " ) {
35
+ sh " jenkins/build-indicator.sh ${ indicator} "
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ stage(' Build and Package main branch' ) {
23
42
when {
24
- branch " main" ;
43
+ branch ' main'
25
44
}
26
45
steps {
27
46
script {
28
47
indicator_list. each { indicator ->
29
- build_package_main[indicator] = {
30
- sh " jenkins/build-and-package.sh ${ indicator} main"
48
+ stage(" Build ${ indicator} " ) {
49
+ sh " jenkins/build-indicator.sh ${ indicator} "
50
+ }
51
+ stage(" Package ${ indicator} " ) {
52
+ sh " jenkins/package-indicator.sh ${ indicator} main"
31
53
}
32
54
}
33
- parallel build_package_main
34
55
}
35
56
}
36
57
}
37
- stage(' Build and Package prod' ) {
58
+ stage(' Build and Package prod branch ' ) {
38
59
when {
39
- branch " prod" ;
60
+ branch ' prod'
40
61
}
41
62
steps {
42
63
script {
43
64
indicator_list. each { indicator ->
44
- build_package_prod[indicator] = {
45
- sh " jenkins/build-and-package.sh ${ indicator} prod"
65
+ stage(" Build ${ indicator} " ) {
66
+ sh " jenkins/build-indicator.sh ${ indicator} "
67
+ }
68
+ stage(" Package ${ indicator} " ) {
69
+ sh " jenkins/package-indicator.sh ${ indicator} prod"
46
70
}
47
71
}
48
- parallel build_package_prod
49
72
}
50
73
}
51
74
}
52
- stage(' Deploy staging' ) {
75
+ stage(' Deploy main branch to staging env ' ) {
53
76
when {
54
- branch " main" ;
77
+ branch ' main'
55
78
}
56
79
steps {
57
80
script {
@@ -64,9 +87,9 @@ pipeline {
64
87
}
65
88
}
66
89
}
67
- stage(' Deploy production' ) {
90
+ stage(' Deploy prod branch to production env ' ) {
68
91
when {
69
- branch " prod" ;
92
+ branch ' prod'
70
93
}
71
94
steps {
72
95
script {
0 commit comments