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