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