2 # yamllint disable-file
10 name: SCM_REFSPEC_MANIFEST
11 default: refs/heads/master
15 name: SCM_REFSPEC_BUILD_TOOLS
16 default: refs/heads/master
20 name: SCM_REFSPEC_RPMBUILDER
21 default: refs/heads/master
25 name: SCM_PROJECT_TO_BUILD
30 name: SCM_PROJECT_TO_BUILD_REFSPEC
31 default: refs/heads/master
39 # Enhanced version of the global-jjb
40 name: ta-lf-infra-gerrit-scm
43 credentials-id: "{jenkins-ssh-credential}"
47 - "refs/heads/{branch}"
51 recursive: "{submodule-recursive}"
52 timeout: "{submodule-timeout}"
53 choosing-strategy: "{choosing-strategy}"
57 name: ta-lf-infra-gerrit-scm-merge
59 - ta-lf-infra-gerrit-scm:
60 jenkins-ssh-credential: "{jenkins-ssh-credential}"
64 submodule-recursive: "{submodule-recursive}"
65 submodule-timeout: "{submodule-timeout}"
67 choosing-strategy: default
70 name: ta-lf-infra-gerrit-scm-verify
72 - ta-lf-infra-gerrit-scm:
73 jenkins-ssh-credential: "{jenkins-ssh-credential}"
77 submodule-recursive: "{submodule-recursive}"
78 submodule-timeout: "{submodule-timeout}"
80 choosing-strategy: gerrit
86 name: lf-display-node-uuid
88 # yamllint disable rule:line-length
90 echo "---> Node UUID:"
91 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
92 # yamllint enable rule:line-length
103 for f in $(find $GERRIT_PROJECT -name tox.ini); do
114 # Skip RPM build in case no *.spec file is found within the {project-to-build}
115 if [ -n "$(find {project-to-build} -name '*.spec')" ]; then
116 if apt --version >/dev/null 2>&1; then
117 # We need a specific version of mock (1.4.14) and devtools
118 # not available in Ubuntu/Debian repos, so fetch them from RHEL mirrors
119 if [ "$(mock --version 2>/dev/null)" != '1.4.14' ]; then
120 sudo groupadd mock || true
121 sudo usermod -aG mock $USER
123 # Explicitly install mock dependencies
124 sudo apt install -y createrepo alien systemd-container python-pip \
125 python-peak.util.decorators yum-utils usermode pigz
126 wget http://vault.centos.org/centos/7.6.1810/os/x86_64/Packages/rpmdevtools-8.3-5.el7.noarch.rpm \
127 https://kojipkgs.fedoraproject.org/packages/mock/1.4.14/2.el7/noarch/mock-1.4.14-2.el7.noarch.rpm
129 sudo dpkg --force-overwrite -i *.deb
131 # RHEL tools hardcode the full path for certain distro tools
132 sudo ln -sf /bin/tar /usr/bin/gtar
133 sudo ln -sf /bin/machinectl /bin/df /usr/bin/
134 # Some mock dependencies are only available via pip
135 sudo pip install distro pyroute2 lxml urllib3
138 sudo yum install -y createrepo
140 ta/build-tools/build_rpms.sh \
154 git clone {git-url}/{project} {project}
156 if echo {ref} | grep -q "refs/"; then
157 git fetch origin {ref}
158 git checkout FETCH_HEAD
165 name: ta-lf-infra-ship-rpms
167 # Ensure no pre-existing .netrc files are overriding logs config
168 - lf-provide-maven-settings-cleanup
169 - config-file-provider:
171 - file-id: "ta-settings"
172 variable: "SETTINGS_FILE"
174 properties-content: "ALT_NEXUS_URL=https://nexus3.akraino.org"
175 - lf-infra-create-netrc:
176 server-id: rpm.snapshots
178 properties-content: |
181 - shell: !include-raw:
182 # Ensure python-tools are installed in case job template does not
183 # call the lf-infra-pre-build macro.
184 - ../../global-jjb/shell/python-tools-install.sh
185 - shell: !include-raw:
186 - ../shell/ta-rpm-deploy.sh
187 - shell: !include-raw:
188 - ../../global-jjb/shell/logs-clear-credentials.sh
191 name: ta-lf-infra-ship-isos
193 # Ensure no pre-existing .netrc files are overriding logs config
194 - lf-provide-maven-settings-cleanup
195 - config-file-provider:
197 - file-id: "ta-settings"
198 variable: "SETTINGS_FILE"
199 - lf-infra-create-netrc:
200 server-id: images-snapshots
201 - shell: !include-raw:
202 # Ensure python-tools are installed in case job template does not
203 # call the lf-infra-pre-build macro.
204 - ../../global-jjb/shell/python-tools-install.sh
205 - shell: !include-raw:
206 - ../shell/ta-iso-deploy.sh
207 - shell: !include-raw:
208 - ../../global-jjb/shell/logs-clear-credentials.sh
211 name: ta-builder-job-verify
215 project: "ta/manifest"
216 ref: "$SCM_REFSPEC_MANIFEST"
219 project: "ta/build-tools"
220 ref: "$SCM_REFSPEC_BUILD_TOOLS"
223 project: "ta/rpmbuilder"
224 ref: "$SCM_REFSPEC_RPMBUILDER"
227 project-to-build: "$GERRIT_PROJECT"
230 name: ta-builder-job-verify-ta/rpmbuilder
234 project: "ta/manifest"
235 ref: "$SCM_REFSPEC_MANIFEST"
238 project: "ta/build-tools"
239 ref: "$SCM_REFSPEC_BUILD_TOOLS"
242 project: "$SCM_PROJECT_TO_BUILD"
243 ref: "$SCM_PROJECT_TO_BUILD_REFSPEC"
246 # Just package some random project to verify "rpmbuilder" changes
247 project-to-build: "$SCM_PROJECT_TO_BUILD"
250 name: ta-builder-job-merge
254 project: "ta/manifest"
255 ref: "$SCM_REFSPEC_MANIFEST"
258 project: "ta/build-tools"
259 ref: "$SCM_REFSPEC_BUILD_TOOLS"
262 project: "ta/rpmbuilder"
263 ref: "$SCM_REFSPEC_RPMBUILDER"
265 project-to-build: "$GERRIT_PROJECT"
266 - ta-lf-infra-ship-rpms
269 name: ta-builder-install-docker
273 if apt --version 2>1 >/dev/null; then
274 sudo chmod +r /boot/vmlinuz*
275 if ! docker --version 2>1 >/dev/null; then
277 sudo apt install -y apt-transport-https ca-certificates curl software-properties-common rename
278 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
279 sudo add-apt-repository -y "deb http://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
281 sudo apt install -y docker-ce
284 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
285 sudo yum -y install docker-ce docker-ce-cli containerd.io
287 sudo mkdir -p /etc/docker/
288 echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
289 sudo systemctl start docker
290 # Ugly hack to make docker usable for non-root
291 # (adding to the group would require re-login)
292 sudo chmod 777 /var/run/docker.sock
295 name: ta-builder-install-build-tools
299 if apt --version 2>1 >/dev/null; then
300 if ! createrepo --version 2>1 >/dev/null; then
302 sudo apt install -y createrepo libguestfs-tools jq libvirt-daemon-system
305 sudo yum -y install createrepo libguestfs-tools-c jq
307 sudo systemctl start libvirtd
308 systemctl status libvirtd
315 name: ta-trigger-job-verify
318 server-name: "{gerrit-server-name}"
320 - patchset-created-event:
321 exclude-drafts: "false"
322 exclude-trivial-rebase: "false"
323 exclude-no-code-change: "false"
324 - draft-published-event
325 - comment-added-contains-event:
326 comment-contains-value: "recheck"
327 - comment-added-contains-event:
328 comment-contains-value: "reverify"
330 - project-compare-type: "ANT"
331 project-pattern: "{project}"
333 - branch-compare-type: "ANT"
334 branch-pattern: "**/{branch}"
335 readable-message: true
337 successful: "{gerrit-skip-vote}"
338 failed: "{gerrit-skip-vote}"
339 unstable: "{gerrit-skip-vote}"
340 notbuilt: "{gerrit-skip-vote}"
343 name: ta-trigger-job-merge
346 server-name: "{gerrit-server-name}"
348 # Not sure if it would be better to use "change-merged" here and just clone the master
349 # branch. With the current approach the SCM can be identical in verify and merge jobs.
351 - comment-added-contains-event:
352 comment-contains-value: "remerge"
354 - project-compare-type: "ANT"
355 project-pattern: "{project}"
357 - branch-compare-type: "ANT"
358 branch-pattern: "**/{branch}"
359 readable-message: true
366 name: ta-publisher-job-verify
371 name: ta-publisher-job-merge
374 - ta-publisher-ci-build:
376 - trigger-parameterized-builds:
377 - project: "ta-ci-build-{arch}"
378 condition: UNSTABLE_OR_BETTER
379 trigger-with-no-params: true
382 name: ta-publisher-ci-build
387 {%- if 'arm64' in arch -%}