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