iec: Stop upstream job if IEC installation fails
[ci-management.git] / jjb / akraino-templates / akraino-iec-templates.yaml
1 ---
2 - job-template:
3     id: akraino-iec-install
4     name: 'iec-{iecType}-{installer}-{deploy_type}-{os}-daily-{stream}'
5     disabled: '{obj:disabled}'
6     concurrent: false
7     node: '{slave-label}'
8     properties:
9       - throttle:
10           enabled: true
11           max-total: 4
12           max-per-node: 1
13           option: 'project'
14       - build-blocker:
15           use-build-blocker: true
16           blocking-jobs:
17             - '.*-fuel-{deploy_type}-.*'
18             - '.*-compass-{deploy_type}-.*'
19           block-level: 'NODE'
20
21     wrappers:
22       - build-name:
23           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO $IEC_TYPE'
24
25     triggers:
26       - 'iec-{iecType}-{installer}-{deploy_type}-{os}-daily-{stream}-trigger'
27
28     parameters:
29       - lf-infra-parameters:
30           project: '{project}'
31           stream: '{stream}'
32           branch: '{branch}'
33       - '{project}-defaults'
34       - '{installer}-{os}-defaults'
35       - string:
36           name: DEPLOY_SCENARIO
37           default: '{scenario}'
38       - string:
39           name: IEC_TYPE
40           default: '{iecType}'
41
42     builders:
43       - trigger-builds:
44           - project: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}'
45             current-parameters: true
46             predefined-parameters:
47               DEPLOY_SCENARIO={scenario}
48             same-node: true
49             block: true
50       - trigger-builds:
51           - project: 'validation-enea-daily-{stream}'
52             same-node: true
53             current-parameters: true
54             predefined-parameters: |
55               CLUSTER_MASTER_IP=$K8S_MASTER_IP
56               CLUSTER_SSH_USER=$K8S_SSH_USER
57               CLUSTER_SSH_PASSWORD=$K8S_SSH_PASSWORD
58               CLUSTER_SSH_KEY=$K8S_SSH_KEY
59               BLUEPRINT={project-name}
60               VERSION=master
61               OPTIONAL=false
62             block: true
63           - project:
64               !j2: |
65                 {%- if deploy_type not in ['virtual'] -%}
66                 {%- for uc in usecase -%}
67                 {%- for ph in phase -%}
68                 iec-{{ iecType }}-{{ ph }}-{{ uc }}-{{ installer }}-{{ deploy_type }}-{{ os }}-daily-{{ stream }}
69                 {%- if not loop.last -%},{%- endif -%}
70                 {%- endfor %}
71                 {%- if not loop.last -%},{%- endif -%}
72                 {%- endfor %}
73                 {%- endif -%}
74             current-parameters: true
75             same-node: true
76             block: true
77             block-thresholds:
78               build-step-failure-threshold: 'never'
79               failure-threshold: 'never'
80               unstable-threshold: 'FAILURE'
81           - project: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
82             current-parameters: false
83             predefined-parameters: |
84               DEPLOY_SCENARIO={scenario}
85               IEC_TYPE={iecType}
86             same-node: true
87             block: true
88
89 - job-template:
90     id: akraino-iec-deploy
91     name: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}'
92     concurrent: true
93     node: '{slave-label}'
94     properties: &properties
95       - throttle:
96           enabled: true
97           max-total: 4
98           max-per-node: 1
99           option: 'project'
100       - build-blocker:
101           use-build-blocker: true
102           blocking-jobs:
103             - '.*-{iecType}-deploy-{installer}-{deploy_type}-.*'
104             - '.*-{iecType}-destroy-{installer}-{deploy_type}-.*'
105             - '.*-{iecType}-install-.*-{installer}-{deploy_type}-.*'
106           block-level: 'NODE'
107
108     parameters:
109       - lf-infra-parameters:
110           project: '{project}'
111           stream: '{stream}'
112           branch: '{branch}'
113       - '{project}-defaults'
114       - '{installer}-{os}-defaults'
115       - string:
116           name: DEPLOY_SCENARIO
117           default: '{scenario}'
118       - string:
119           name: IEC_TYPE
120           default: '{iecType}'
121       - string:
122           name: EXTRA_ARGS
123           default: '-o {os}'
124
125     wrappers: &wrappers
126       - build-name:
127           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO $IEC_TYPE'
128
129     scm: &scm
130       - git:
131           credentials-id: '{jenkins-ssh-credential}'
132           url: '{git-url}/{project}.git'
133           refspec: '$GERRIT_REFSPEC'
134           branches: '$GERRIT_BRANCH'
135           skip-tag: true
136           wipe-workspace: true
137           submodule:
138             disable: true
139             recursive: false
140             timeout: '{submodule-timeout}'
141           choosing-strategy: default
142
143     builders:
144       - description-setter:
145           description: "POD: $NODE_NAME"
146       - conditional-step:
147           condition-kind: regex-match
148           regex: 'compass'
149           label: '{installer}'
150           steps:
151             - shell:
152                 !include-raw-escape: ../iec/iec-compass-build.sh
153             - shell:
154                 !include-raw-escape: ../iec/iec-compass-deploy.sh
155             - shell:
156                 !include-raw-escape: ../iec/iec-fdn-install.sh
157       - conditional-step:
158           condition-kind: regex-match
159           regex: 'fuel'
160           label: '{installer}'
161           steps:
162             - shell:
163                 !include-raw-escape: ../iec/iec-fuel-deploy.sh
164
165     publishers: &publishers
166       - email:
167           recipients: armband@enea.com
168       - lf-infra-publish
169
170 - job-template:
171     id: akraino-iec-destroy
172     name: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
173     concurrent: true
174     node: '{slave-label}'
175     properties: *properties
176     parameters:
177       - lf-infra-parameters:
178           project: '{project}'
179           stream: '{stream}'
180           branch: '{branch}'
181       - '{project}-defaults'
182       - '{installer}-{os}-defaults'
183       - string:
184           name: DEPLOY_SCENARIO
185           default: '{scenario}'
186       - string:
187           name: IEC_TYPE
188           default: '{iecType}'
189       - string:
190           name: EXTRA_ARGS
191           default: '-EEE -o {os}'
192
193     wrappers: *wrappers
194     scm: *scm
195
196     builders:
197       - description-setter:
198           description: "POD: $NODE_NAME"
199       - shell:
200           !include-raw-escape: ../iec/iec-{installer}-destroy.sh
201
202     publishers: *publishers
203
204 - job-template:
205     id: akraino-iec-phase-usecase
206     name: 'iec-{iecType}-{phase}-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}'
207     concurrent: true
208     node: '{slave-label}'
209     properties: *properties
210
211     parameters:
212       - lf-infra-parameters:
213           project: '{project}'
214           stream: '{stream}'
215           branch: '{branch}'
216       - '{project}-defaults'
217       - '{installer}-{os}-defaults'
218       - '{usecase}-defaults'
219
220     wrappers:
221       - build-name:
222           name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${installer}-${deploy_type}'
223
224     scm: *scm
225
226     builders:
227       - shell:
228           !include-raw-escape: ../iec/iec-{usecase}.sh
229
230     publishers: *publishers