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
119 source /tmp/v/tox/bin/activate
120 for f in $(find $GERRIT_PROJECT -name tox.ini); do
131 # Skip RPM build in case no *.spec file is found within the {project-to-build}
132 if [ -n "$(find {project-to-build} -name '*.spec')" ]
134 if apt --version 2>1 >/dev/null; then
135 sudo groupadd mock || true
136 sudo usermod -aG mock $USER
138 # Explicitly install mock dependencies
139 sudo apt install -y createrepo alien systemd-container python-pip \
140 python-decoratortools yum-utils usermode pigz
141 # We need a specific version of mock (1.4.14) and devtools
142 # not available in Ubuntu/Debian repos, so fetch them from RHEL mirrors
143 wget http://vault.centos.org/centos/7.6.1810/os/x86_64/Packages/rpmdevtools-8.3-5.el7.noarch.rpm \
144 https://kojipkgs.fedoraproject.org/packages/mock/1.4.14/2.el7/noarch/mock-1.4.14-2.el7.noarch.rpm
148 # RHEL tools hardcode the full path for certain distro tools
149 sudo ln -sf /bin/tar /usr/bin/gtar
150 sudo ln -sf /bin/machinectl /bin/df /usr/bin/
151 # Some mock dependencies are only available via pip
152 sudo pip install distro pyroute2
154 sudo yum install -y createrepo
156 ta/build-tools/build_rpms.sh \
170 git clone {git-url}/{project} {project}
172 if echo {ref} | grep -q "refs/"; then
173 git fetch origin {ref}
174 git checkout FETCH_HEAD
181 name: ta-lf-infra-ship-rpms
183 # Ensure no pre-existing .netrc files are overriding logs config
184 - lf-provide-maven-settings-cleanup
185 - config-file-provider:
187 - file-id: 'ta-settings'
188 variable: 'SETTINGS_FILE'
190 properties-content: 'ALT_NEXUS_URL=https://nexus3.akraino.org'
191 - lf-infra-create-netrc:
192 server-id: rpm.snapshots
194 properties-content: |
197 - shell: !include-raw:
198 # Ensure python-tools are installed in case job template does not
199 # call the lf-infra-pre-build macro.
200 - ../../global-jjb/shell/python-tools-install.sh
201 - ../shell/ta-rpm-deploy.sh
202 - shell: !include-raw:
203 - ../../global-jjb/shell/logs-clear-credentials.sh
206 name: ta-lf-infra-ship-isos
208 # Ensure no pre-existing .netrc files are overriding logs config
209 - lf-provide-maven-settings-cleanup
210 - config-file-provider:
212 - file-id: 'ta-settings'
213 variable: 'SETTINGS_FILE'
214 - lf-infra-create-netrc:
215 server-id: images-snapshots
216 - shell: !include-raw:
217 # Ensure python-tools are installed in case job template does not
218 # call the lf-infra-pre-build macro.
219 - ../../global-jjb/shell/python-tools-install.sh
220 - ../shell/ta-iso-deploy.sh
221 - shell: !include-raw:
222 - ../../global-jjb/shell/logs-clear-credentials.sh
225 name: ta-builder-job-verify
229 project: 'ta/manifest'
230 ref: '$SCM_REFSPEC_MANIFEST'
233 project: 'ta/build-tools'
234 ref: '$SCM_REFSPEC_BUILD_TOOLS'
237 project: 'ta/rpmbuilder'
238 ref: '$SCM_REFSPEC_RPMBUILDER'
241 project-to-build: '$GERRIT_PROJECT'
244 name: ta-builder-job-verify-ta/rpmbuilder
248 project: 'ta/manifest'
249 ref: '$SCM_REFSPEC_MANIFEST'
252 project: 'ta/build-tools'
253 ref: '$SCM_REFSPEC_BUILD_TOOLS'
256 project: '$SCM_PROJECT_TO_BUILD'
257 ref: '$SCM_PROJECT_TO_BUILD_REFSPEC'
260 # Just package some random project to verify "rpmbuilder" changes
261 project-to-build: '$SCM_PROJECT_TO_BUILD'
264 name: ta-builder-job-merge
268 project: 'ta/manifest'
269 ref: '$SCM_REFSPEC_MANIFEST'
272 project: 'ta/build-tools'
273 ref: '$SCM_REFSPEC_BUILD_TOOLS'
276 project: 'ta/rpmbuilder'
277 ref: '$SCM_REFSPEC_RPMBUILDER'
279 project-to-build: '$GERRIT_PROJECT'
280 - ta-lf-infra-ship-rpms
283 name: ta-builder-install-docker
287 if apt --version 2>1 >/dev/null; then
289 sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
290 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
291 sudo add-apt-repository -y "deb http://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
293 sudo apt install -y docker-ce
295 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
296 sudo yum -y install docker-ce docker-ce-cli containerd.io
298 sudo mkdir -p /etc/docker/
299 echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
300 sudo systemctl start docker
301 # Ugly hack to make docker usable for non-root
302 # (adding to the group would require re-login)
303 sudo chmod 777 /var/run/docker.sock
306 name: ta-builder-install-build-tools
310 if apt --version 2>1 >/dev/null; then
312 sudo apt install -y createrepo libguestfs-tools jq
314 sudo yum -y install createrepo libguestfs-tools-c jq
316 sudo systemctl start libvirtd
317 systemctl status libvirtd
324 name: ta-trigger-job-verify
327 server-name: '{gerrit-server-name}'
329 - patchset-created-event:
330 exclude-drafts: 'false'
331 exclude-trivial-rebase: 'false'
332 exclude-no-code-change: 'false'
333 - draft-published-event
334 - comment-added-contains-event:
335 comment-contains-value: 'recheck'
336 - comment-added-contains-event:
337 comment-contains-value: 'reverify'
339 - project-compare-type: 'ANT'
340 project-pattern: '{project}'
342 - branch-compare-type: 'ANT'
343 branch-pattern: '**/{branch}'
344 readable-message: true
346 successful: '{gerrit-skip-vote}'
347 failed: '{gerrit-skip-vote}'
348 unstable: '{gerrit-skip-vote}'
349 notbuilt: '{gerrit-skip-vote}'
352 name: ta-trigger-job-merge
355 server-name: '{gerrit-server-name}'
357 # Not sure if it would be better to use "change-merged" here and just clone the master
358 # branch. With the current approach the SCM can be identical in verify and merge jobs.
360 - comment-added-contains-event:
361 comment-contains-value: 'remerge'
363 - project-compare-type: 'ANT'
364 project-pattern: '{project}'
366 - branch-compare-type: 'ANT'
367 branch-pattern: '**/{branch}'
368 readable-message: true
375 name: ta-publisher-job-verify
380 name: ta-publisher-job-merge
383 - trigger-parameterized-builds:
384 - project: 'ta-ci-build-{arch}'
385 condition: UNSTABLE_OR_BETTER
386 trigger-with-no-params: true