6 name: ta-parameters-manifest
9 default: refs/heads/master
11 name: SCM_REFSPEC_MANIFEST
15 name: ta-parameters-build-tools
18 default: refs/heads/master
20 name: SCM_REFSPEC_BUILD_TOOLS
24 name: ta-parameters-rpmbuilder
27 default: refs/heads/master
29 name: SCM_REFSPEC_RPMBUILDER
33 name: ta-parameters-ci
35 - ta-parameters-manifest
36 - ta-parameters-build-tools
37 - ta-parameters-rpmbuilder
40 name: ta-parameters-ci-ta/rpmbuilder
42 - ta-parameters-manifest
43 - ta-parameters-build-tools
47 name: SCM_PROJECT_TO_BUILD
50 default: refs/heads/master
52 name: SCM_PROJECT_TO_BUILD_REFSPEC
59 # Enhanced version of the global-jjb
60 name: ta-lf-infra-gerrit-scm
63 credentials-id: '{jenkins-ssh-credential}'
67 - 'refs/heads/{branch}'
71 recursive: '{submodule-recursive}'
72 timeout: '{submodule-timeout}'
73 choosing-strategy: '{choosing-strategy}'
77 name: ta-lf-infra-gerrit-scm-merge
79 - ta-lf-infra-gerrit-scm:
80 jenkins-ssh-credential: '{jenkins-ssh-credential}'
84 submodule-recursive: '{submodule-recursive}'
85 submodule-timeout: '{submodule-timeout}'
87 choosing-strategy: default
90 name: ta-lf-infra-gerrit-scm-verify
92 - ta-lf-infra-gerrit-scm:
93 jenkins-ssh-credential: '{jenkins-ssh-credential}'
97 submodule-recursive: '{submodule-recursive}'
98 submodule-timeout: '{submodule-timeout}'
100 choosing-strategy: gerrit
106 name: lf-display-node-uuid
109 echo "---> Node UUID:"
110 curl -s http://169.254.169.254/openstack/latest/meta_data.json | python -c 'import sys, json; data = json.load(sys.stdin); print(data["uuid"])' || true
121 for f in $(find $GERRIT_PROJECT -name tox.ini); do
132 # Skip RPM build in case no *.spec file is found within the {project-to-build}
133 if [ -n "$(find {project-to-build} -name '*.spec')" ]
135 if apt --version 2>1 >/dev/null; then
136 # We need a specific version of mock (1.4.14) and devtools
137 # not available in Ubuntu/Debian repos, so fetch them from RHEL mirrors
138 if [ "$(mock --version 2>/dev/null)" != '1.4.14' ]; then
139 sudo groupadd mock || true
140 sudo usermod -aG mock $USER
142 # Explicitly install mock dependencies
143 sudo apt install -y createrepo alien systemd-container python-pip \
144 python-decoratortools yum-utils usermode pigz
145 wget http://vault.centos.org/centos/7.6.1810/os/x86_64/Packages/rpmdevtools-8.3-5.el7.noarch.rpm \
146 https://kojipkgs.fedoraproject.org/packages/mock/1.4.14/2.el7/noarch/mock-1.4.14-2.el7.noarch.rpm
150 # RHEL tools hardcode the full path for certain distro tools
151 sudo ln -sf /bin/tar /usr/bin/gtar
152 sudo ln -sf /bin/machinectl /bin/df /usr/bin/
153 # Some mock dependencies are only available via pip
154 sudo pip install distro pyroute2
157 sudo yum install -y createrepo
159 ta/build-tools/build_rpms.sh \
173 git clone {git-url}/{project} {project}
175 if echo {ref} | grep -q "refs/"; then
176 git fetch origin {ref}
177 git checkout FETCH_HEAD
184 name: ta-lf-infra-ship-rpms
186 # Ensure no pre-existing .netrc files are overriding logs config
187 - lf-provide-maven-settings-cleanup
188 - config-file-provider:
190 - file-id: 'ta-settings'
191 variable: 'SETTINGS_FILE'
192 - file-id: lftoolsini
193 target: "$HOME/.config/lftools/lftools.ini"
194 - file-id: sigul-config
195 variable: SIGUL_CONFIG
196 - file-id: sigul-password
197 variable: SIGUL_PASSWORD
200 - file-id: signing-pubkey
201 variable: SIGNING_PUBKEY
203 properties-content: 'ALT_NEXUS_URL=https://nexus3.akraino.org'
204 - lf-infra-create-netrc:
205 server-id: rpm.snapshots
207 properties-content: |
210 - shell: !include-raw:
211 # Ensure python-tools are installed in case job template does not
212 # call the lf-infra-pre-build macro.
213 - ../../global-jjb/shell/python-tools-install.sh
214 - shell: !include-raw: ../global-jjb/shell/sigul-configuration.sh
215 - shell: !include-raw: ../global-jjb/shell/sigul-install.sh
216 - shell: !include-raw:
217 - ../shell/ta-rpm-deploy.sh
218 - shell: !include-raw:
219 - ../../global-jjb/shell/logs-clear-credentials.sh
222 name: ta-lf-infra-ship-isos
224 # Ensure no pre-existing .netrc files are overriding logs config
225 - lf-provide-maven-settings-cleanup
226 - config-file-provider:
228 - file-id: 'ta-settings'
229 variable: 'SETTINGS_FILE'
230 - file-id: lftoolsini
231 target: "$HOME/.config/lftools/lftools.ini"
232 - file-id: sigul-config
233 variable: SIGUL_CONFIG
234 - file-id: sigul-password
235 variable: SIGUL_PASSWORD
238 - file-id: signing-pubkey
239 variable: SIGNING_PUBKEY
240 - lf-infra-create-netrc:
241 server-id: images-snapshots
242 - shell: !include-raw:
243 # Ensure python-tools are installed in case job template does not
244 # call the lf-infra-pre-build macro.
245 - ../../global-jjb/shell/python-tools-install.sh
246 - shell: !include-raw: ../global-jjb/shell/sigul-configuration.sh
247 - shell: !include-raw: ../global-jjb/shell/sigul-install.sh
248 - shell: !include-raw:
249 - ../shell/ta-iso-deploy.sh
250 - shell: !include-raw:
251 - ../../global-jjb/shell/logs-clear-credentials.sh
254 name: ta-builder-job-verify
258 project: 'ta/manifest'
259 ref: '$SCM_REFSPEC_MANIFEST'
262 project: 'ta/build-tools'
263 ref: '$SCM_REFSPEC_BUILD_TOOLS'
266 project: 'ta/rpmbuilder'
267 ref: '$SCM_REFSPEC_RPMBUILDER'
270 project-to-build: '$GERRIT_PROJECT'
273 name: ta-builder-job-verify-ta/rpmbuilder
277 project: 'ta/manifest'
278 ref: '$SCM_REFSPEC_MANIFEST'
281 project: 'ta/build-tools'
282 ref: '$SCM_REFSPEC_BUILD_TOOLS'
285 project: '$SCM_PROJECT_TO_BUILD'
286 ref: '$SCM_PROJECT_TO_BUILD_REFSPEC'
289 # Just package some random project to verify "rpmbuilder" changes
290 project-to-build: '$SCM_PROJECT_TO_BUILD'
293 name: ta-builder-job-merge
297 project: 'ta/manifest'
298 ref: '$SCM_REFSPEC_MANIFEST'
301 project: 'ta/build-tools'
302 ref: '$SCM_REFSPEC_BUILD_TOOLS'
305 project: 'ta/rpmbuilder'
306 ref: '$SCM_REFSPEC_RPMBUILDER'
308 project-to-build: '$GERRIT_PROJECT'
309 - ta-lf-infra-ship-rpms
312 name: ta-builder-install-docker
316 if apt --version 2>1 >/dev/null; then
317 sudo chmod +r /boot/vmlinuz*
318 if ! docker --version 2>1 >/dev/null; then
320 sudo apt install -y apt-transport-https ca-certificates curl software-properties-common rename
321 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
322 sudo add-apt-repository -y "deb http://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
324 sudo apt install -y docker-ce
327 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
328 sudo yum -y install docker-ce docker-ce-cli containerd.io
330 sudo mkdir -p /etc/docker/
331 echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
332 sudo systemctl start docker
333 # Ugly hack to make docker usable for non-root
334 # (adding to the group would require re-login)
335 sudo chmod 777 /var/run/docker.sock
338 name: ta-builder-install-build-tools
342 if apt --version 2>1 >/dev/null; then
343 if ! createrepo --version 2>1 >/dev/null; then
345 sudo apt install -y createrepo libguestfs-tools jq
348 sudo yum -y install createrepo libguestfs-tools-c jq
350 sudo systemctl start libvirtd
351 systemctl status libvirtd
358 name: ta-trigger-job-verify
361 server-name: '{gerrit-server-name}'
363 - patchset-created-event:
364 exclude-drafts: 'false'
365 exclude-trivial-rebase: 'false'
366 exclude-no-code-change: 'false'
367 - draft-published-event
368 - comment-added-contains-event:
369 comment-contains-value: 'recheck'
370 - comment-added-contains-event:
371 comment-contains-value: 'reverify'
373 - project-compare-type: 'ANT'
374 project-pattern: '{project}'
376 - branch-compare-type: 'ANT'
377 branch-pattern: '**/{branch}'
378 readable-message: true
380 successful: '{gerrit-skip-vote}'
381 failed: '{gerrit-skip-vote}'
382 unstable: '{gerrit-skip-vote}'
383 notbuilt: '{gerrit-skip-vote}'
386 name: ta-trigger-job-merge
389 server-name: '{gerrit-server-name}'
391 # Not sure if it would be better to use "change-merged" here and just clone the master
392 # branch. With the current approach the SCM can be identical in verify and merge jobs.
394 - comment-added-contains-event:
395 comment-contains-value: 'remerge'
397 - project-compare-type: 'ANT'
398 project-pattern: '{project}'
400 - branch-compare-type: 'ANT'
401 branch-pattern: '**/{branch}'
402 readable-message: true
409 name: ta-publisher-job-verify
414 name: ta-publisher-job-merge
416 - ta-publisher-ci-build:
418 - trigger-parameterized-builds:
419 - project: 'ta-ci-build-{arch}'
420 condition: UNSTABLE_OR_BETTER
421 trigger-with-no-params: true
424 name: ta-publisher-ci-build
429 {%- if 'arm64' in arch -%}