- hosts: all | |
tasks: | |
- name: run pkg-validate.sh | |
shell: | |
cmd: | | |
export WORKSPACE={{ ansible_user_dir }} | |
export DIST_VER="{{ centos_releasever }}" | |
if [[ "$DIST_VER" -eq 9 ]]; then | |
export BUILD_TARGET="9s" | |
else | |
export BUILD_TARGET="8" | |
fi | |
export TARGET="$BUILD_TARGET" | |
./pkg-validate.sh cloud${DIST_VER}s-openstack-{{ zuul.branch|replace('-rdo', '') }}-el${BUILD_TARGET} cbs | |
chdir: "{{ zuul.projects['review.rdoproject.org/gating_scripts'].src_dir }}" | |
environment: | |
ZUUL3_HOME: "{{ ansible_env.HOME }}" | |
ZUUL_REF: "{{ zuul.ref }}" | |
ZUUL_PROJECT: "{{ zuul.project.name }}" | |
ZUUL_BRANCH: "{{ zuul.branch }}" | |
ZUUL_PIPELINE: "{{ zuul.pipeline }}" | |
ZUUL_CHANGES: "{% set comma = joiner('^') %} {% for chg in zuul['items'] %}{{ comma() }}{{ chg.project.name }}:{{ chg.branch }}:{{ chg.change_url }}{% endfor %}" # noqa 204 | |
LANG: 'en_US.UTF-8' | |
changed_when: true | |
- name: test install | |
shell: | |
cmd: | | |
set -x | |
# If there is no temporary release rpm means there are no packages to test | |
if [ ! -f {{ ansible_user_dir }}/rpmbuild/RPMS/noarch/rpmfactory-temp-release-1.0-1.noarch.rpm ]; then | |
echo "No test packages to install" | |
exit 0 | |
fi | |
# First, we create a chroot to be used in the installation | |
export YUM="{{ ansible_pkg_mgr }}" | |
sudo mkdir -p /tmp/root/var/lib/rpm | |
sudo rpm --root /tmp/root --initdb | |
sudo $YUM -y install $YUM-utils | |
{% if centos_releasever|int == 9 %} | |
sudo $YUM install --installroot=/tmp/root --releasever 9 --nogpgcheck -y --repofrompath=tmp,http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/ --disablerepo=* --enablerepo=tmp* centos-stream-release centos-stream-repos | |
{% else %} | |
yumdownloader centos-stream-release | |
sudo rpm --root /tmp/root -ivh --nodeps centos-stream-release-*.rpm | |
yumdownloader centos-stream-repos | |
sudo rpm --root /tmp/root -ivh --nodeps centos-stream-repos-*.rpm | |
{% endif %} | |
# rpmfactory-temp-release-1.0-1 is built by the base-pkg-validation builder | |
# It defines two repositories: the newton one (from CBS) and the temporary CBS one that contains | |
# packages we freshly built within that Koji task | |
sudo rpm --root /tmp/root -i {{ ansible_user_dir }}/rpmbuild/RPMS/noarch/rpmfactory-temp-release-1.0-1.noarch.rpm | |
# Packages in the temp repository contained only the packages fetched from CBS | |
# This should list the packages we just build in that Koji task | |
sudo $YUM --installroot=/tmp/root --disablerepo='*' --enablerepo='temp' list available | |
pkgs=$(sudo $YUM --installroot=/tmp/root --disablerepo='*' --enablerepo='temp' --exclude='*.src' list available | awk '/temp$/ {printf "%s ", $1}') | |
# Here we install locally the kust built packages | |
sudo $YUM install --installroot=/tmp/root -y $pkgs | |
changed_when: true |