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