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