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