Enable merge jobs to trigger downstream job
[ci-management.git] / jjb / iec / iec.yaml
1 ---
2 - project:
3     name: 'iec'
4     project-name: 'iec'
5     project: '{project-name}'
6     views:
7       - project-view
8     # -------------------------------
9     # BRANCH DEFINITIONS
10     # -------------------------------
11     stream:
12       - master:
13           branch: '{stream}'
14           gs-pathname: ''
15           disabled: false
16
17     # -------------------------------
18     # INSTALLER DEFINITIONS
19     # -------------------------------
20     installer:
21       - fuel
22       - compass
23
24     # -------------------------------
25     # OPERATING SYSTEM DEFINITIONS
26     # -------------------------------
27     os:
28       - ubuntu1604
29       - ubuntu1804
30       - centos7
31
32     # -------------------------------
33     # DEPLOY TYPE DEFINITIONS
34     # -------------------------------
35     deploy_type:
36       - baremetal:
37           slave-label: 'aarch64_dev'
38           scenario: 'k8-calico-iec-noha'
39       - virtual:
40           slave-label: 'aarch64_dev'
41           scenario: 'k8-calico-iec-noha'
42
43     exclude:
44       # Compass does not run against baremetal PODs yet
45       - installer: compass
46         deploy_type: baremetal
47       - installer: compass
48         os: centos7
49       - installer: compass
50         os: ubuntu1804
51
52     # -------------------------------
53     # USECASE DEFINITIONS
54     # -------------------------------
55     usecase:
56       - seba_on_arm:
57           slave-label: 'aarch64_dev'
58           scenario: 'k8-calico-iec-noha'
59
60     jobs:
61       - 'iec-{installer}-{deploy_type}-{os}-daily-{stream}'
62       - 'iec-deploy-{installer}-{deploy_type}-{os}-daily-{stream}'
63       - 'iec-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
64       - 'iec-install-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}'
65
66 ##############
67 # PARAMETERS #
68 ##############
69 - parameter:
70     name: 'iec-defaults'
71     parameters:
72       - string:
73           name: INSTALLER_IP
74           default: '10.20.0.2'
75           description: 'IP of the installer'
76       - string:
77           name: SSH_KEY
78           default: '/var/lib/opnfv/mcp.rsa'
79           description: 'Path to private SSH key to access environment nodes'
80       - string:
81           name: EXTERNAL_NETWORK
82           default: 'floating_net'
83           description: 'external network for test'
84       - string:
85           name: CI_DEBUG
86           default: 'false'
87           description: 'Show debug output information'
88       - string:
89           name: ARCHIVE_ARTIFACTS
90           default: '**/*.log'
91           description: Artifacts to archive to the logs server.
92 - parameter:
93     name: 'seba_on_arm-defaults'
94     parameters:
95       - string:
96           name: K8S_SSH_USER
97           default: 'ubuntu'
98           description: 'SSH username to connect to the K8s master '
99       - string:
100           name: K8S_SSH_PASSWORD
101           default: ''
102           description: 'SSH password to connect to the K8s master'
103       - string:
104           name: K8S_SSH_KEY
105           default: ''
106           description: 'SSH key to connect to the K8s master'
107       - string:
108           name: K8S_MASTER_IP_COMPASS
109           default: '10.1.0.50'
110           description: 'IP address to compass connect to the K8s master'
111       - string:
112           name: K8S_SSH_PASSWORD_COMPASS
113           default: 'root'
114           description: 'SSH password to compass connect to the K8s master'
115       - string:
116           name: K8S_SSH_USER_COMPASS
117           default: 'root'
118           description: 'SSH username to compass connect to the K8s master'
119
120 ########################
121 # job templates
122 ########################
123 - job-template:
124     name: 'iec-{installer}-{deploy_type}-{os}-daily-{stream}'
125     disabled: '{obj:disabled}'
126     concurrent: false
127     node: '{slave-label}'
128     properties:
129       - throttle:
130           enabled: true
131           max-total: 4
132           max-per-node: 1
133           option: 'project'
134       - build-blocker:
135           use-build-blocker: true
136           blocking-jobs:
137             - '.*-fuel-{deploy_type}-.*'
138             - '.*-compass-{deploy_type}-.*'
139           blocking-level: 'NODE'
140
141     wrappers:
142       - build-name:
143           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
144
145     triggers:
146       - 'iec-{installer}-{deploy_type}-{os}-daily-{stream}-trigger'
147
148     parameters:
149       - lf-infra-parameters:
150           project: '{project}'
151           stream: '{stream}'
152           branch: '{branch}'
153       - '{project}-defaults'
154       - string:
155           name: DEPLOY_SCENARIO
156           default: '{scenario}'
157
158     builders:
159       - trigger-builds:
160           - project: 'iec-deploy-{installer}-{deploy_type}-{os}-daily-{stream}'
161             current-parameters: false
162             predefined-parameters:
163               DEPLOY_SCENARIO={scenario}
164             same-node: true
165             block: true
166           - project:
167               !j2: |
168                 {%- for uc in usecase -%}
169                 iec-install-{{ uc | first }}-{{ installer }}-{{ deploy_type }}-{{ os }}-daily-{{ stream }}
170                 {%- if not loop.last -%},{%- endif -%}
171                 {%- endfor %}
172             current-parameters: false
173             same-node: true
174             block: true
175             block-thresholds:
176               build-step-failure-threshold: 'never'
177               failure-threshold: 'never'
178               unstable-threshold: 'FAILURE'
179           - project: 'iec-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
180             current-parameters: false
181             predefined-parameters:
182               DEPLOY_SCENARIO={scenario}
183             same-node: true
184             block: true
185
186 - job-template:
187     name: 'iec-deploy-{installer}-{deploy_type}-{os}-daily-{stream}'
188     concurrent: true
189     node: '{slave-label}'
190     properties: &properties
191       - throttle:
192           enabled: true
193           max-total: 4
194           max-per-node: 1
195           option: 'project'
196       - build-blocker:
197           use-build-blocker: true
198           blocking-jobs:
199             - '.*-deploy-{installer}-{deploy_type}-.*'
200             - '.*-destroy-{installer}-{deploy_type}-.*'
201             - '.*-install-.*-{installer}-{deploy_type}-.*'
202           blocking-level: 'NODE'
203
204     parameters:
205       - lf-infra-parameters:
206           project: '{project}'
207           stream: '{stream}'
208           branch: '{branch}'
209       - '{project}-defaults'
210       - string:
211           name: DEPLOY_SCENARIO
212           default: '{scenario}'
213       - string:
214           name: EXTRA_ARGS
215           default: '-o {os}'
216
217     wrappers: &wrappers
218       - build-name:
219           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
220
221     scm: &scm
222       - git:
223           credentials-id: '{jenkins-ssh-credential}'
224           url: '{git-url}/{project}.git'
225           refspec: ''
226           branches:
227             - 'refs/heads/{branch}'
228           skip-tag: true
229           wipe-workspace: true
230           submodule:
231             disable: true
232             recursive: false
233             timeout: '{submodule-timeout}'
234           choosing-strategy: default
235
236     builders:
237       - description-setter:
238           description: "POD: $NODE_NAME"
239       - conditional-step:
240           condition-kind: regex-match
241           regex: 'compass'
242           label: '{installer}'
243           steps:
244             - shell:
245                 !include-raw-escape: ./iec-compass-build.sh
246             - shell:
247                 !include-raw-escape: ./iec-compass-deploy.sh
248             - shell:
249                 !include-raw-escape: ./iec-fdn-install.sh
250       - conditional-step:
251           condition-kind: regex-match
252           regex: 'fuel'
253           label: '{installer}'
254           steps:
255             - shell:
256                 !include-raw-escape: ./iec-fuel-deploy.sh
257
258     publishers: &publishers
259       - email:
260           recipients: armband@enea.com
261       - lf-infra-publish
262
263 - job-template:
264     name: 'iec-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
265     concurrent: true
266     node: '{slave-label}'
267     properties: *properties
268     parameters:
269       - lf-infra-parameters:
270           project: '{project}'
271           stream: '{stream}'
272           branch: '{branch}'
273       - '{project}-defaults'
274       - string:
275           name: DEPLOY_SCENARIO
276           default: '{scenario}'
277       - string:
278           name: EXTRA_ARGS
279           default: '-EEE -o {os}'
280
281     wrappers: *wrappers
282     scm: *scm
283
284     builders:
285       - description-setter:
286           description: "POD: $NODE_NAME"
287       - shell:
288           !include-raw-escape: ./iec-{installer}-destroy.sh
289
290     publishers: *publishers
291
292 - job-template:
293     name: 'iec-install-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}'
294     concurrent: true
295     node: '{slave-label}'
296     properties: *properties
297
298     parameters:
299       - lf-infra-parameters:
300           project: '{project}'
301           stream: '{stream}'
302           branch: '{branch}'
303       - '{project}-defaults'
304       - '{usecase}-defaults'
305
306     wrappers:
307       - build-name:
308           name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${installer}-${deploy_type}'
309
310     scm: *scm
311
312     builders:
313       - shell:
314           !include-raw-escape: ./iec-{usecase}.sh
315
316     publishers: *publishers
317
318 ########################
319 # trigger macros
320 ########################
321 # CI PODs
322 # ----------------------------------------------------------------
323 # Akraino IEC CI Baremetal Triggers running against master branch
324 # ----------------------------------------------------------------
325 - trigger:
326     name: 'iec-fuel-virtual-ubuntu1604-daily-master-trigger'
327     triggers:
328       - timed: '0 1 * * 1,3,5'
329 - trigger:
330     name: 'iec-fuel-baremetal-ubuntu1604-daily-master-trigger'
331     triggers:
332       - timed: ''
333 - trigger:
334     name: 'iec-compass-virtual-ubuntu1604-daily-master-trigger'
335     triggers:
336       - timed: '0 13 * * *'
337 - trigger:
338     name: 'iec-fuel-virtual-ubuntu1804-daily-master-trigger'
339     triggers:
340       - timed: '0 1 * * 2,6'
341 - trigger:
342     name: 'iec-fuel-baremetal-ubuntu1804-daily-master-trigger'
343     triggers:
344       - timed: ''
345 - trigger:
346     name: 'iec-fuel-virtual-centos7-daily-master-trigger'
347     triggers:
348       - timed: '0 1 * * 4,7'
349 - trigger:
350     name: 'iec-fuel-baremetal-centos7-daily-master-trigger'
351     triggers:
352       - timed: ''