a40d909931ba5bc3994802d36bd78f1d29db40af
[infra/cicd.git] / jjb / nolabs / nolabs-booking-jobs.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 verifying patches
23 # that are sent to the repositories below
24 #   - cloud-infra/engine
25 #
26 # These jobs verify changes that
27 #   - implement new features or fix bugs for the deployment framework, engine, itself
28 #   - implement new features or fix bugs to the playbooks and roles used for utilizing
29 #     open source components such as bifrost, kubespray, and kolla-ansible
30 #   - bump versions of open source components or the scenarios
31 #
32 # These jobs are set to run on slaves with label vpod-deploy-ubuntu1604.
33 # The slaves have
34 #   - Ubuntu1604 as the base distro
35 #   - nested virtualization
36 #   - internet access
37 #   - passwordless sudo
38 #   - 16 CPUs/32GB RAM/200 GB Disk
39 #   - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
40 #     gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
41 #
42 # The slaves should not have a cloud infra scenario deployed on them.
43 #--------------------------------------------------------------------------------------
44
45 - project:
46     name: 'nolabs-booking'
47
48     project: 'infra/engine'
49
50     stream:
51       - 'master':
52           branch: '{stream}'
53           slave-label: 'vpod-deploy-ubuntu1804'
54           build-timeout: 60
55
56     booking-phase:
57       - 'handle'
58       - 'delete'
59
60     target-site:
61       - 'test':
62           api-tokens-endpoint: 'http://188.212.108.245/api/tokens'
63           api-users-endpoint: 'http://188.212.108.245/api/users'
64           api-bookings-endpoint: 'http://188.212.108.245/api/bookings'
65       - 'production':
66           api-tokens-endpoint: 'https://labs.nordix.org/api/tokens'
67           api-users-endpoint: 'https://labs.nordix.org/api/users'
68           api-bookings-endpoint: 'https://labs.nordix.org/api/bookings'
69
70     jobs:
71       - 'nolabs-{booking-phase}-booking-{target-site}site-{stream}'
72
73 - job-template:
74     name: 'nolabs-{booking-phase}-booking-{target-site}site-{stream}'
75
76     disabled: '{obj:disabled}'
77
78     concurrent: true
79
80     parameters:
81       - project-parameters:
82           project: '{project}'
83           branch: '{branch}'
84       - nordix-gerrit-parameters
85       - string:
86           name: TARGET_SITE
87           default: '{target-site}'
88           description: 'Target site to handle the bookings for.'
89       - label:
90           name: SLAVE_LABEL
91           default: '{slave-label}'
92           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use.'
93       - string:
94           name: BOOKING_PHASE
95           default: '{booking-phase}'
96           description: 'Phase of the booking.'
97       - string:
98           name: BOOKING_ID
99           default: 0
100           description: 'ID of the booking to handle. Default is 0 which is a non-existent booking to prevent running the job by mistake.'
101       - string:
102           name: DEPLOY_SCENARIO
103           default: 'k8-mycoolplugin-mycoolfeature'
104           description: 'Scenario to deploy for the booking. Default is a non-existent scenario to prevent running the job by mistake.'
105       - string:
106           name: NOLABS_API_TOKENS_ENDPOINT
107           default: '{api-tokens-endpoint}'
108           description: 'API endpoint for tokens.'
109       - string:
110           name: NOLABS_API_USERS_ENDPOINT
111           default: '{api-users-endpoint}'
112           description: 'API endpoint for users.'
113       - string:
114           name: NOLABS_API_BOOKINGS_ENDPOINT
115           default: '{api-bookings-endpoint}'
116           description: 'API endpoint for bookings.'
117       - string:
118           name: NOLABS_USER_SSHPUBKEY
119           default: '/tmp/nolabs/id_rsa.pub'
120           description: 'SSH public key for the user who created the booking.'
121       - string:
122           name: NOLABS_VENV
123           default: '/tmp/nolabs/.venv'
124           description: 'Python virtualenv location to use.'
125       - string:
126           name: GERRIT_REFSPEC
127           default: 'refs/changes/79/2079/8'
128           description: 'Refspec to checkout'
129       - string:
130           name: HEAT_ENVIRONMENT_FILE
131           default: 'https://gerrit.nordix.org/gitweb?p=infra/engine.git;a=blob_plain;f=engine/provisioner/heat/playbooks/roles/install-configure-heat/files/heat-environment.yaml;h=401e1c4f547e9a2631e68d800cbcadef81b85641;hb=70df134c93b7ca3232ae723c3de98ad2b0299728'
132           description: 'Using a special heat environment file until the change gets merged.'
133
134     properties:
135       - logrotate
136       - build-blocker:
137           use-build-blocker: true
138           blocking-jobs:
139             - 'cloud-infra-verify-engine-.*'
140             - 'cloud-infra-verify-scenario-.*'
141             - 'cloud-infra-periodic-engine-.*'
142             - 'k8-.*'
143             - 'nolabs-.*'
144           block-level: 'NODE'
145       - throttle:
146           max-per-node: 1
147           max-total: 10
148           option: project
149
150     wrappers:
151       - credentials-binding:
152           - file:
153               credential-id: nordix-nolabs-openrcfile-city-karlskrona-defaultproject
154               variable: OPENRC_FILE
155           - username-password-separated:
156               credential-id: nordix-nolabs-jenkins-api-credentials
157               username: NOLABS_API_USERNAME
158               password: NOLABS_API_PASSWORD
159       - mask-passwords
160       - build-timeout:
161           timeout: '{build-timeout}'
162       - fix-workspace-permissions
163       - openstack:
164           single-use: True
165
166     scm:
167       - git-scm:
168           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
169           branch: '{branch}'
170           refspec: ''
171           wipe_workspace: true
172           clean_before: false
173
174     builders:
175       - description-setter:
176           description: $BOOKING_ID | $DEPLOY_SCENARIO
177       - '{booking-phase}booking-macro'
178
179 # vim: set ts=2 sw=2 expandtab: