Add ci validation script
[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: ''
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: ''
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       - string:
245           name: DEPLOY_SCENARIO
246           default: '{scenario}'
247       - string:
248           name: EXTRA_ARGS
249           default: '-o {os}'
250
251     wrappers: &wrappers
252       - build-name:
253           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
254
255     scm: &scm
256       - git:
257           credentials-id: '{jenkins-ssh-credential}'
258           url: '{git-url}/{project}.git'
259           refspec: ''
260           branches:
261             - 'refs/heads/{branch}'
262           skip-tag: true
263           wipe-workspace: true
264           submodule:
265             disable: true
266             recursive: false
267             timeout: '{submodule-timeout}'
268           choosing-strategy: default
269
270     builders:
271       - description-setter:
272           description: "POD: $NODE_NAME"
273       - conditional-step:
274           condition-kind: regex-match
275           regex: 'compass'
276           label: '{installer}'
277           steps:
278             - shell:
279                 !include-raw-escape: ./iec-compass-build.sh
280             - shell:
281                 !include-raw-escape: ./iec-compass-deploy.sh
282             - shell:
283                 !include-raw-escape: ./iec-fdn-install.sh
284       - conditional-step:
285           condition-kind: regex-match
286           regex: 'fuel'
287           label: '{installer}'
288           steps:
289             - shell:
290                 !include-raw-escape: ./iec-fuel-deploy.sh
291
292     publishers: &publishers
293       - email:
294           recipients: armband@enea.com
295       - lf-infra-publish
296
297 - job-template:
298     name: 'iec-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
299     concurrent: true
300     node: '{slave-label}'
301     properties: *properties
302     parameters:
303       - lf-infra-parameters:
304           project: '{project}'
305           stream: '{stream}'
306           branch: '{branch}'
307       - '{project}-defaults'
308       - string:
309           name: DEPLOY_SCENARIO
310           default: '{scenario}'
311       - string:
312           name: EXTRA_ARGS
313           default: '-EEE -o {os}'
314
315     wrappers: *wrappers
316     scm: *scm
317
318     builders:
319       - description-setter:
320           description: "POD: $NODE_NAME"
321       - shell:
322           !include-raw-escape: ./iec-{installer}-destroy.sh
323
324     publishers: *publishers
325
326 - job-template:
327     name: 'iec-install-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}'
328     concurrent: true
329     node: '{slave-label}'
330     properties: *properties
331
332     parameters:
333       - lf-infra-parameters:
334           project: '{project}'
335           stream: '{stream}'
336           branch: '{branch}'
337       - '{project}-defaults'
338
339     wrappers:
340       - build-name:
341           name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${installer}-${deploy_type}'
342
343     scm: *scm
344
345     builders:
346       - shell:
347           !include-raw-escape: ./iec-{usecase}.sh
348
349     publishers: *publishers
350
351 ########################
352 # trigger macros
353 ########################
354 # CI PODs
355 # ----------------------------------------------------------------
356 # Akraino IEC CI Baremetal Triggers running against master branch
357 # ----------------------------------------------------------------
358 - trigger:
359     name: 'iec-fuel-virtual-ubuntu1604-daily-master-trigger'
360     triggers:
361       - timed: '0 1 * * 1,3,5'
362 - trigger:
363     name: 'iec-fuel-baremetal-ubuntu1604-daily-master-trigger'
364     triggers:
365       - timed: ''
366 - trigger:
367     name: 'iec-compass-virtual-ubuntu1604-daily-master-trigger'
368     triggers:
369       - timed: '0 13 * * *'
370 - trigger:
371     name: 'iec-fuel-virtual-ubuntu1804-daily-master-trigger'
372     triggers:
373       - timed: '0 1 * * 2,6'
374 - trigger:
375     name: 'iec-fuel-baremetal-ubuntu1804-daily-master-trigger'
376     triggers:
377       - timed: ''
378 - trigger:
379     name: 'iec-fuel-virtual-centos7-daily-master-trigger'
380     triggers:
381       - timed: '0 1 * * 4,7'
382 - trigger:
383     name: 'iec-fuel-baremetal-centos7-daily-master-trigger'
384     triggers:
385       - timed: ''