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}'
80 name: lf-display-node-uuid
83 echo "---> Node UUID:"
84 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"])'
93 source /tmp/v/tox/bin/activate
94 for f in $(find $GERRIT_PROJECT -name tox.ini); do
105 # Skip RPM build in case no *.spec file is found within the {project-to-build}
106 if [ -n "$(find {project-to-build} -name '*.spec')" ]
108 if apt --version 2>1 >/dev/null; then
109 sudo groupadd mock || true
110 sudo usermod -aG mock $USER
112 # Explicitly install mock dependencies
113 sudo apt install -y createrepo alien systemd-container python-pip \
114 python-decoratortools yum-utils usermode pigz
115 # We need a specific version of mock (1.4.14) and devtools
116 # not available in Ubuntu/Debian repos, so fetch them from RHEL mirrors
117 wget http://mirror.centos.org/centos/7.6.1810/os/x86_64/Packages/rpmdevtools-8.3-5.el7.noarch.rpm \
118 https://kojipkgs.fedoraproject.org/packages/mock/1.4.14/2.el7/noarch/mock-1.4.14-2.el7.noarch.rpm
122 # RHEL tools hardcode the full path for certain distro tools
123 sudo ln -sf /bin/tar /usr/bin/gtar
124 sudo ln -sf /bin/machinectl /bin/df /usr/bin/
125 # Some mock dependencies are only available via pip
126 sudo pip install distro pyroute2
128 sudo yum install -y createrepo
130 ta/build-tools/build_rpms.sh \
144 git clone {git-url}/{project} {project}
146 if echo {ref} | grep -q "refs/"; then
147 git fetch origin {ref}
148 git checkout FETCH_HEAD
155 name: ta-lf-infra-ship-rpms
157 # Ensure no pre-existing .netrc files are overriding logs config
158 - lf-provide-maven-settings-cleanup
159 - config-file-provider:
161 - file-id: 'ta-settings'
162 variable: 'SETTINGS_FILE'
164 properties-content: 'ALT_NEXUS_URL=https://nexus3.akraino.org'
165 - lf-infra-create-netrc:
166 server-id: rpm.snapshots
168 properties-content: |
171 - shell: !include-raw:
172 # Ensure python-tools are installed in case job template does not
173 # call the lf-infra-pre-build macro.
174 - ../../global-jjb/shell/python-tools-install.sh
175 - ../shell/ta-rpm-deploy.sh
176 - shell: !include-raw:
177 - ../../global-jjb/shell/logs-clear-credentials.sh
180 name: ta-lf-infra-ship-isos
182 # Ensure no pre-existing .netrc files are overriding logs config
183 - lf-provide-maven-settings-cleanup
184 - config-file-provider:
186 - file-id: 'ta-settings'
187 variable: 'SETTINGS_FILE'
188 - lf-infra-create-netrc:
189 server-id: images-snapshots
190 - shell: !include-raw:
191 # Ensure python-tools are installed in case job template does not
192 # call the lf-infra-pre-build macro.
193 - ../../global-jjb/shell/python-tools-install.sh
194 - ../shell/ta-iso-deploy.sh
195 - shell: !include-raw:
196 - ../../global-jjb/shell/logs-clear-credentials.sh
199 name: ta-builder-job-verify
203 project: 'ta/manifest'
204 ref: '$SCM_REFSPEC_MANIFEST'
207 project: 'ta/build-tools'
208 ref: '$SCM_REFSPEC_BUILD_TOOLS'
211 project: 'ta/rpmbuilder'
212 ref: '$SCM_REFSPEC_RPMBUILDER'
215 project-to-build: '$GERRIT_PROJECT'
218 name: ta-builder-job-verify-ta/rpmbuilder
222 project: 'ta/manifest'
223 ref: '$SCM_REFSPEC_MANIFEST'
226 project: 'ta/build-tools'
227 ref: '$SCM_REFSPEC_BUILD_TOOLS'
230 project: '$SCM_PROJECT_TO_BUILD'
231 ref: '$SCM_PROJECT_TO_BUILD_REFSPEC'
234 # Just package some random project to verify "rpmbuilder" changes
235 project-to-build: '$SCM_PROJECT_TO_BUILD'
238 name: ta-builder-job-merge
242 project: 'ta/manifest'
243 ref: '$SCM_REFSPEC_MANIFEST'
246 project: 'ta/build-tools'
247 ref: '$SCM_REFSPEC_BUILD_TOOLS'
250 project: 'ta/rpmbuilder'
251 ref: '$SCM_REFSPEC_RPMBUILDER'
253 project-to-build: '$GERRIT_PROJECT'
254 - ta-lf-infra-ship-rpms
257 name: ta-builder-install-docker
261 if apt --version 2>1 >/dev/null; then
263 sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
264 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
265 sudo add-apt-repository -y "deb http://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
267 sudo apt install -y docker-ce
269 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
270 sudo yum -y install docker-ce docker-ce-cli containerd.io
272 sudo mkdir -p /etc/docker/
273 echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
274 sudo systemctl start docker
275 # Ugly hack to make docker usable for non-root
276 # (adding to the group would require re-login)
277 sudo chmod 777 /var/run/docker.sock
280 name: ta-builder-install-build-tools
284 if apt --version 2>1 >/dev/null; then
286 sudo apt install -y createrepo libguestfs-tools jq
288 sudo yum -y install createrepo libguestfs-tools-c jq
290 sudo systemctl start libvirtd
291 systemctl status libvirtd
298 name: ta-trigger-job-verify
301 server-name: '{gerrit-server-name}'
303 - patchset-created-event:
304 exclude-drafts: 'false'
305 exclude-trivial-rebase: 'false'
306 exclude-no-code-change: 'false'
307 - draft-published-event
308 - comment-added-contains-event:
309 comment-contains-value: 'recheck'
310 - comment-added-contains-event:
311 comment-contains-value: 'reverify'
313 - project-compare-type: 'ANT'
314 project-pattern: '{project}'
316 - branch-compare-type: 'ANT'
317 branch-pattern: '**/{branch}'
318 readable-message: true
320 successful: '{gerrit-skip-vote}'
321 failed: '{gerrit-skip-vote}'
322 unstable: '{gerrit-skip-vote}'
323 notbuilt: '{gerrit-skip-vote}'
326 name: ta-trigger-job-merge
329 server-name: '{gerrit-server-name}'
331 # Not sure if it would be better to use "change-merged" here and just clone the master
332 # branch. With the current approach the SCM can be identical in verify and merge jobs.
334 - comment-added-contains-event:
335 comment-contains-value: 'remerge'
337 - project-compare-type: 'ANT'
338 project-pattern: '{project}'
340 - branch-compare-type: 'ANT'
341 branch-pattern: '**/{branch}'
342 readable-message: true
349 name: ta-publisher-job-verify
354 name: ta-publisher-job-merge
357 - trigger-parameterized-builds:
358 - project: 'ta-ci-build-{arch}'
359 condition: UNSTABLE_OR_BETTER
360 trigger-with-no-params: true