Add Geode to jenkins slave update build script
[infra/cicd.git] / jjb / infra / packer_build_jobs.yaml
1 ---
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2021 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19 - project:
20
21     name: jenkins-slave-update-job
22
23     project: infra/tools
24
25     stream:
26       - master:
27           branch: '{stream}'
28
29     target:
30       - 'cloud-infra':
31            image: 'cloud-infra-base-ubuntu1804'
32            openstack-project: 'CICD'
33            region: 'fra'
34       - 'nordix-nsm-build-server':
35            image: 'nordix-nsm-build-ubuntu1804'
36            openstack-project: 'CICD'
37            region: 'fra'
38       - 'uds-build-server':
39            image: 'onap-uds-build-ubuntu1804'
40            openstack-project: 'CICD'
41            region: 'fra'
42       - 'nordix-onap-jenkins-build-server':
43            image: 'onap-build-ubuntu1804'
44            openstack-project: 'DefaultProject34201'
45            region: 'kna'
46       - 'oransc-build-server':
47            image: 'oransc-build-ubuntu2004'
48            openstack-project: 'DefaultProject34201'
49            region: 'kna'
50       - 'geode-build-server':
51            image: 'geode-build-ubuntu2004'
52            openstack-project: 'DefaultProject34201'
53            region: 'kna'
54
55     jobs:
56       - jenkins-slave-update-{target}-{stream}
57
58 - job-template:
59     name: jenkins-slave-update-{target}-{stream}
60
61     node: packer-ubuntu1804
62
63     disabled: false
64
65     concurrent: false
66
67     parameters:
68       - project-parameters:
69           project: '{project}'
70           branch: '{branch}'
71       - nordix-gerrit-parameters
72       - string:
73           name: PACKER_VERSION
74           default: '1.6.0'
75           description: 'Packer version.'
76       - string:
77           name: TARGET
78           default: '{target}'
79           description: 'Target project name.'
80       - string:
81           name: IMAGE
82           default: '{image}'
83           description: 'Image name to build.'
84
85     properties:
86       - logrotate
87
88     scm:
89       - git-scm:
90           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
91           branch: '{branch}'
92           refspec: ''
93           wipe_workspace: true
94           clean_before: false
95
96     triggers:
97       - nordix-gerrit-trigger-change-merged:
98           project: '{project}'
99           branch: '{branch}'
100           files: 'infra/jenkins/slave-setup/{target}/**'
101
102     wrappers:
103       - build-timeout:
104           timeout: 150
105       - fix-workspace-permissions
106       - mask-passwords
107       - openstack:
108           single-use: true
109       - credentials-binding:
110           - file:
111               credential-id: '{openstack-project}-openrc-{region}'
112               variable: OPENRC_FILE
113
114     builders:
115       - shell: |
116           #!/bin/bash
117           /bin/rm -f /tmp/openrc
118           /bin/cp -f $OPENRC_FILE /tmp/openrc
119       - shell:
120           !include-raw-escape: ./update-jenkins-slave.sh
121       - shell: |
122           #!/bin/bash
123           /bin/rm -f /tmp/openrc