Merge "Add v1alpha2 integration ci job"
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-periodic-spinnaker.yaml
1 ---
2 #
3 # ============LICENSE_START=======================================================
4 #  Copyright (C) 2019 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
20
21 #--------------------------------------------------------------------------------------
22 # The jobs declared in this JJB configuration file are used for deploying and testing
23 # Spinnaker using k8-calico-spinnaker scenario.
24 #--------------------------------------------------------------------------------------
25
26 - project:
27     name: 'cloud-infra-periodic-spinnaker'
28
29     project: 'infra/engine'
30
31     cloud:
32       - city:
33           slave-label: 'city-jumphost-ubuntu1804'
34           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-onap'
35           daily-trigger: '@daily'
36
37     spinnaker-branch:
38       - '1.16':
39           nordix-branch: master
40           engine-version: master
41           engine-refspec: master
42           deploy-scenario: 'k8-calico-spinnaker'
43           deploy-scenario-version: master
44           deploy-scenario-refspec: master
45           disabled: false
46           delete-stack: 'yes'
47       # TODO: delete 1_16
48       - '1_16':
49           nordix-branch: master
50           engine-version: master
51           engine-refspec: master
52           deploy-scenario: 'k8-calico-spinnaker'
53           deploy-scenario-version: master
54           deploy-scenario-refspec: master
55           disabled: true
56           delete-stack: 'yes'
57
58     distro:
59       - ubuntu1804
60
61     ci-loop:
62       - daily
63
64     type:
65       - cloud:
66           pod-name: est-cloud
67           provisioner-type: heat
68           installer-type: kubespray
69
70     phase:
71       - spinnaker-deploy:
72           build-timeout: 60
73       - spinnaker-test:
74           build-timeout: 60
75       - promote-spinnaker:
76           build-timeout: 60
77
78     jobs:
79       - 'k8-calico-spinnaker-{distro}-{installer-type}-{cloud}-{type}-{ci-loop}-{spinnaker-branch}'
80       - '{phase}-{distro}-{installer-type}-{type}-{ci-loop}-{spinnaker-branch}'
81
82 - job-template:
83     name: 'k8-calico-spinnaker-{distro}-{installer-type}-{cloud}-{type}-{ci-loop}-{spinnaker-branch}'
84
85     project-type: multijob
86
87     disabled: '{obj:disabled}'
88
89     concurrent: false
90
91     parameters:
92       - project-parameters:
93           project: '{project}'
94           branch: '{nordix-branch}'
95       - nordix-gerrit-parameters
96       - label:
97           name: SLAVE_LABEL
98           default: '{slave-label}'
99           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
100       - string:
101           name: PROVISIONER_TYPE
102           default: 'heat'
103           description: 'Provisioner to use for provisioning nodes'
104       - string:
105           name: INSTALLER_TYPE
106           default: 'kubespray'
107           description: 'Installer to use for deploying the scenario'
108       - string:
109           name: DEPLOY_SCENARIO
110           default: 'k8-calico-spinnaker'
111           description: 'Scenario to deploy and test'
112       - string:
113           name: DEPLOY_TYPE
114           default: 'cloud'
115           description: 'Type of the deployment'
116       - string:
117           name: DISTRO
118           default: '{distro}'
119           description: 'Distribution to use for configuring target nodes (networking etc.)'
120       - string:
121           name: OPENSTACK_CLOUD_PROVIDER
122           default: '{cloud}'
123           description: 'Name of the cloud where this job is run'
124       - string:
125           name: SPINNAKER_VERSION
126           default: '{spinnaker-branch}'
127           description: 'Spinnaker version to deploy'
128       - string:
129           name: STACK_NAME
130           default: 'nordix-cicd-{deploy-scenario}-{spinnaker-branch}'
131       - string:
132           name: HEAT_ENVIRONMENT_FILENAME
133           default: "heat-environment-full.yaml"
134           description: 'Heat environment file to use for creating the stack'
135       - string:
136           name: ENGINE_VERSION
137           default: '{engine-version}'
138           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying Spinnaker. Could be sha, branch'
139       - string:
140           name: ENGINE_REFSPEC
141           default: '{engine-refspec}'
142           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying Spinnaker. Must be refspec.'
143       - string:
144           name: DEPLOY_SCENARIO_VERSION
145           default: '{deploy-scenario-version}'
146           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying Spinnaker. Depends on DEPLOY_SCENARIO_REFSPEC and could be sha, branch.'
147       - string:
148           name: DEPLOY_SCENARIO_REFSPEC
149           default: '{deploy-scenario-refspec}'
150           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying Spinnaker. Depends on DEPLOY_SCENARIO_VERSION and must be refspec.'
151       - string:
152           name: POD_NAME
153           default: '{pod-name}'
154           description: 'Development purposes only! Set to none for disabling test results DB reporting.'
155       - string:
156           name: DELETE_STACK
157           default: '{delete-stack}'
158           description: 'Development purposes only! Whether delete the stack or not. It must either be yes or no. Setting this to no will increase the cost!'
159
160     properties:
161       - logrotate
162       - build-blocker:
163           use-build-blocker: true
164           blocking-jobs:
165             - 'cloud-infra-periodic-engine-.*'
166             - 'onap-.*'
167             - 'k8-.*'
168           block-level: 'NODE'
169       - throttle:
170           max-per-node: 1
171           max-total: 1
172           option: project
173
174     wrappers:
175       - credentials-binding:
176           - file:
177               credential-id: '{openrc-credentials-file}'
178               variable: OPENRC_FILE
179       - mask-passwords
180       - build-timeout:
181           timeout: 630
182       - fix-workspace-permissions
183       - openstack:
184           single-use: True
185
186     triggers:
187       - timed: '{daily-trigger}'
188
189     scm:
190       - git-scm:
191           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
192           branch: '{nordix-branch}'
193           refspec: ''
194           wipe_workspace: true
195           clean_before: false
196
197     builders:
198       - description-setter:
199           description: $DEPLOY_SCENARIO | Spinnaker $SPINNAKER_VERSION
200       - shell: |
201           #!/bin/bash
202           /bin/rm -rf /tmp/openrc && /bin/cp -f $OPENRC_FILE /tmp/openrc
203       - multijob:
204           name: Deploy Spinnaker using Helm
205           condition: ALWAYS
206           projects:
207             - name: 'spinnaker-deploy-{distro}-{installer-type}-{type}-{ci-loop}-{spinnaker-branch}'
208               current-parameters: false
209               predefined-parameters: |
210                 DISTRO=$DISTRO
211                 OPENSTACK_CLOUD_PROVIDER=$OPENSTACK_CLOUD_PROVIDER
212                 DEPLOY_TYPE=$DEPLOY_TYPE
213                 PROVISIONER_TYPE=$PROVISIONER_TYPE
214                 INSTALLER_TYPE=$INSTALLER_TYPE
215                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
216                 SPINNAKER_VERSION=$SPINNAKER_VERSION
217                 POD_NAME=$POD_NAME
218                 STACK_NAME=$STACK_NAME
219                 HEAT_ENVIRONMENT_FILENAME=$HEAT_ENVIRONMENT_FILENAME
220                 ENGINE_VERSION=$ENGINE_VERSION
221                 ENGINE_REFSPEC=$ENGINE_REFSPEC
222                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
223                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
224               git-revision: true
225               node-parameters: true
226               kill-phase-on: NEVER
227               abort-all-job: false
228       - multijob:
229           name: Test Spinnaker Deployment (not activated)
230           condition: ALWAYS
231           projects:
232             - name: 'spinnaker-test-{distro}-{installer-type}-{type}-{ci-loop}-{spinnaker-branch}'
233               current-parameters: false
234               predefined-parameters: |
235                 DISTRO=$DISTRO
236                 OPENSTACK_CLOUD_PROVIDER=$OPENSTACK_CLOUD_PROVIDER
237                 DEPLOY_TYPE=$DEPLOY_TYPE
238                 PROVISIONER_TYPE=$PROVISIONER_TYPE
239                 INSTALLER_TYPE=$INSTALLER_TYPE
240                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
241                 SPINNAKER_VERSION=$SPINNAKER_VERSION
242                 POD_NAME=$POD_NAME
243                 STACK_NAME=$STACK_NAME
244                 HEAT_ENVIRONMENT_FILENAME=$HEAT_ENVIRONMENT_FILENAME
245                 ENGINE_VERSION=$ENGINE_VERSION
246                 ENGINE_REFSPEC=$ENGINE_REFSPEC
247                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
248                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
249               git-revision: true
250               node-parameters: true
251               kill-phase-on: NEVER
252               abort-all-job: false
253       - multijob:
254           name: Promote Spinnaker (not activated)
255           condition: ALWAYS
256           projects:
257             - name: 'promote-spinnaker-{distro}-{installer-type}-{type}-{ci-loop}-{spinnaker-branch}'
258               current-parameters: false
259               predefined-parameters: |
260                 DISTRO=$DISTRO
261                 OPENSTACK_CLOUD_PROVIDER=$OPENSTACK_CLOUD_PROVIDER
262                 DEPLOY_TYPE=$DEPLOY_TYPE
263                 PROVISIONER_TYPE=$PROVISIONER_TYPE
264                 INSTALLER_TYPE=$INSTALLER_TYPE
265                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
266                 SPINNAKER_VERSION=$SPINNAKER_VERSION
267                 POD_NAME=$POD_NAME
268                 STACK_NAME=$STACK_NAME
269                 HEAT_ENVIRONMENT_FILENAME=$HEAT_ENVIRONMENT_FILENAME
270                 ENGINE_VERSION=$ENGINE_VERSION
271                 ENGINE_REFSPEC=$ENGINE_REFSPEC
272                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
273                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
274               git-revision: true
275               node-parameters: true
276               kill-phase-on: NEVER
277               abort-all-job: false
278
279     publishers:
280       - postbuildscript:
281           builders:
282             - role: SLAVE
283               build-on:
284                 - SUCCESS
285                 - FAILURE
286                 - ABORTED
287                 - NOT_BUILT
288                 - UNSTABLE
289               build-steps:
290                 - shell:
291                     !include-raw-escape: ./wait-for-pkg-manager.sh
292                 - shell:
293                     !include-raw: ./delete-heat-stack.sh
294
295 - job-template:
296     name: '{phase}-{distro}-{installer-type}-{type}-{ci-loop}-{spinnaker-branch}'
297
298     disabled: false
299
300     concurrent: false
301
302     properties:
303       - logrotate
304
305     parameters:
306       - project-parameters:
307           project: '{project}'
308           branch: '{nordix-branch}'
309       - nordix-gerrit-parameters
310       - label:
311           name: SLAVE_LABEL
312           default: 'city-jumphost-ubuntu1804'
313           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
314       - string:
315           name: PROVISIONER_TYPE
316           default: 'heat'
317           description: 'Provisioner to use for provisioning nodes'
318       - string:
319           name: INSTALLER_TYPE
320           default: 'kubespray'
321           description: 'Installer to use for deploying the scenario'
322       - string:
323           name: DEPLOY_SCENARIO
324           default: 'k8-calico-spinnaker'
325           description: 'Scenario to deploy and test'
326       - string:
327           name: DEPLOY_TYPE
328           default: 'cloud'
329           description: 'Type of the deployment'
330       - string:
331           name: DISTRO
332           default: '{distro}'
333           description: 'Distribution to use for configuring target nodes (networking etc.)'
334       - string:
335           name: OPENSTACK_CLOUD_PROVIDER
336           default: '{cloud}'
337           description: 'Name of the cloud where this job is run'
338       - string:
339           name: SPINNAKER_VERSION
340           default: '{spinnaker-branch}'
341           description: 'Spinnaker version to deploy'
342       - string:
343           name: STACK_NAME
344           default: 'nordix-cicd-{deploy-scenario}-{spinnaker-branch}'
345       - string:
346           name: HEAT_ENVIRONMENT_FILENAME
347           default: "heat-environment-full.yaml"
348           description: 'Heat environment filename to use for creating the stack'
349       - string:
350           name: HEAT_ENVIRONMENT_FILE
351           default: "file://$WORKSPACE/.cache/repos/swconfig/scenarios/$DEPLOY_SCENARIO/$INSTALLER_TYPE/role/$DEPLOY_SCENARIO/files/$HEAT_ENVIRONMENT_FILENAME"
352           description: 'Heat environment file location to use for creating the stack'
353       - string:
354           name: ENGINE_VERSION
355           default: '{engine-version}'
356           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying Spinnaker. Could be sha, branch'
357       - string:
358           name: ENGINE_REFSPEC
359           default: '{engine-refspec}'
360           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying Spinnaker. Must be refspec.'
361       - string:
362           name: DEPLOY_SCENARIO_VERSION
363           default: '{deploy-scenario-version}'
364           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying Spinnaker. Depends on DEPLOY_SCENARIO_REFSPEC and could be sha, branch.'
365       - string:
366           name: DEPLOY_SCENARIO_REFSPEC
367           default: '{deploy-scenario-refspec}'
368           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying Spinnaker. Depends on DEPLOY_SCENARIO_VERSION and must be refspec.'
369       - string:
370           name: POD_NAME
371           default: '{pod-name}'
372           description: 'Development purposes only! Set to none for disabling test results DB reporting.'
373       - string:
374           name: DELETE_STACK
375           default: '{delete-stack}'
376           description: 'Development purposes only! Whether delete the stack or not. It must either be yes or no. Setting this to no will increase the cost!'
377
378     wrappers:
379       - mask-passwords
380       - build-timeout:
381           timeout: '{build-timeout}'
382       - fix-workspace-permissions
383       - credentials-binding:
384           - username-password-separated:
385               credential-id: 'nordix-cicd-arm-credentials'
386               username: NORDIX_ARM_USERNAME
387               password: NORDIX_ARM_TOKEN
388           - username-password-separated:
389               credential-id: 'nordix-cicd-harbor-credentials'
390               username: NORDIX_HARBOR_USERNAME
391               password: NORDIX_HARBOR_PASSWORD
392
393     scm:
394       - git-scm:
395           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
396           branch: '{nordix-branch}'
397           refspec: ''
398           wipe_workspace: true
399           clean_before: false
400
401     builders:
402       - description-setter:
403           description: $DEPLOY_SCENARIO | Spinnaker $SPINNAKER_VERSION | $OPENSTACK_CLOUD_PROVIDER
404       - '{phase}-macro'
405
406 # vim: set ts=2 sw=2 expandtab: