5b8db9f3b805e38d02c0247468a222e984fa3277
[ci-management.git] / 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               BLUEPRINT={project-name}
235               LAYER=k8s
236               VERSION=master
237               OPTIONAL=yes
238             block: true
239           - project:
240               !j2: |
241                 {%- for uc in usecase -%}
242                 iec-{{ iecType }}-install-{{ uc | first }}-{{ installer }}-{{ deploy_type }}-{{ os }}-daily-{{ stream }}
243                 {%- if not loop.last -%},{%- endif -%}
244                 {%- endfor %}
245             current-parameters: true
246             same-node: true
247             block: true
248             block-thresholds:
249               build-step-failure-threshold: 'never'
250               failure-threshold: 'never'
251               unstable-threshold: 'FAILURE'
252           - project: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
253             current-parameters: false
254             predefined-parameters: |
255               DEPLOY_SCENARIO={scenario}
256               IEC_TYPE={iecType}
257             same-node: true
258             block: true
259
260 - job-template:
261     name: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}'
262     concurrent: true
263     node: '{slave-label}'
264     properties: &properties
265       - throttle:
266           enabled: true
267           max-total: 4
268           max-per-node: 1
269           option: 'project'
270       - build-blocker:
271           use-build-blocker: true
272           blocking-jobs:
273             - '.*-{iecType}-deploy-{installer}-{deploy_type}-.*'
274             - '.*-{iecType}-destroy-{installer}-{deploy_type}-.*'
275             - '.*-{iecType}-install-.*-{installer}-{deploy_type}-.*'
276           block-level: 'NODE'
277
278     parameters:
279       - lf-infra-parameters:
280           project: '{project}'
281           stream: '{stream}'
282           branch: '{branch}'
283       - '{project}-defaults'
284       - '{installer}-{os}-defaults'
285       - string:
286           name: DEPLOY_SCENARIO
287           default: '{scenario}'
288       - string:
289           name: IEC_TYPE
290           default: '{iecType}'
291       - string:
292           name: EXTRA_ARGS
293           default: '-o {os}'
294
295     wrappers: &wrappers
296       - build-name:
297           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO $IEC_TYPE'
298
299     scm: &scm
300       - git:
301           credentials-id: '{jenkins-ssh-credential}'
302           url: '{git-url}/{project}.git'
303           refspec: ''
304           branches:
305             - 'refs/heads/{branch}'
306           skip-tag: true
307           wipe-workspace: true
308           submodule:
309             disable: true
310             recursive: false
311             timeout: '{submodule-timeout}'
312           choosing-strategy: default
313
314     builders:
315       - description-setter:
316           description: "POD: $NODE_NAME"
317       - conditional-step:
318           condition-kind: regex-match
319           regex: 'compass'
320           label: '{installer}'
321           steps:
322             - shell:
323                 !include-raw-escape: ./iec-compass-build.sh
324             - shell:
325                 !include-raw-escape: ./iec-compass-deploy.sh
326             - shell:
327                 !include-raw-escape: ./iec-fdn-install.sh
328       - conditional-step:
329           condition-kind: regex-match
330           regex: 'fuel'
331           label: '{installer}'
332           steps:
333             - shell:
334                 !include-raw-escape: ./iec-fuel-deploy.sh
335
336     publishers: &publishers
337       - email:
338           recipients: armband@enea.com
339       - lf-infra-publish
340
341 - job-template:
342     name: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
343     concurrent: true
344     node: '{slave-label}'
345     properties: *properties
346     parameters:
347       - lf-infra-parameters:
348           project: '{project}'
349           stream: '{stream}'
350           branch: '{branch}'
351       - '{project}-defaults'
352       - '{installer}-{os}-defaults'
353       - string:
354           name: DEPLOY_SCENARIO
355           default: '{scenario}'
356       - string:
357           name: IEC_TYPE
358           default: '{iecType}'
359       - string:
360           name: EXTRA_ARGS
361           default: '-EEE -o {os}'
362
363     wrappers: *wrappers
364     scm: *scm
365
366     builders:
367       - description-setter:
368           description: "POD: $NODE_NAME"
369       - shell:
370           !include-raw-escape: ./iec-{installer}-destroy.sh
371
372     publishers: *publishers
373
374 - job-template:
375     name: 'iec-{iecType}-install-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}'
376     concurrent: true
377     node: '{slave-label}'
378     properties: *properties
379
380     parameters:
381       - lf-infra-parameters:
382           project: '{project}'
383           stream: '{stream}'
384           branch: '{branch}'
385       - '{project}-defaults'
386       - '{installer}-{os}-defaults'
387
388     wrappers:
389       - build-name:
390           name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${installer}-${deploy_type}'
391
392     scm: *scm
393
394     builders:
395       - shell:
396           !include-raw-escape: ./iec-{usecase}.sh
397
398     publishers: *publishers
399
400
401 ########################
402 # trigger macros
403 ########################
404 # CI PODs
405 # ----------------------------------------------------------------
406 # Akraino IEC CI Baremetal Triggers running against master branch
407 # ----------------------------------------------------------------
408 - trigger:
409     name: 'iec-type2-fuel-virtual-ubuntu1604-daily-master-trigger'
410     triggers:
411       - timed: '0 1 * * 1,3,5'
412 - trigger:
413     name: 'iec-type2-fuel-baremetal-ubuntu1604-daily-master-trigger'
414     triggers:
415       - timed: ''
416 - trigger:
417     name: 'iec-type2-compass-virtual-ubuntu1604-daily-master-trigger'
418     triggers:
419       - timed: '0 13 * * *'
420 - trigger:
421     name: 'iec-type2-fuel-virtual-ubuntu1804-daily-master-trigger'
422     triggers:
423       - timed: '0 1 * * 2,6'
424 - trigger:
425     name: 'iec-type2-fuel-baremetal-ubuntu1804-daily-master-trigger'
426     triggers:
427       - timed: ''
428 - trigger:
429     name: 'iec-type2-fuel-virtual-centos7-daily-master-trigger'
430     triggers:
431       - timed: '0 1 * * 4,7'
432 - trigger:
433     name: 'iec-type2-fuel-baremetal-centos7-daily-master-trigger'
434     triggers:
435       - timed: ''
436 - trigger:
437     name: 'iec-type1-compass-virtual-ubuntu1604-daily-master-trigger'
438     triggers:
439       - timed: '0 19 * * *'