Fix the buildimages jobs: call the ensure-tox role

... and use its output.

tox is not available by default on the images anymore.

Change-Id: If5ea0ffdfc51860842c19f0a6f238127d42eb292
(cherry picked from commit 2d0c3a8b98)
(cherry picked from commit 0a9a43cb76)
(cherry picked from commit cdf83a23a0)
This commit is contained in:
Luigi Toscano 2020-08-10 18:00:06 +02:00
parent 60896d55a4
commit 96abd08c28
4 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,4 @@
- hosts: all - hosts: all
roles: roles:
- ensure-tox
- build-sahara-images-dib - build-sahara-images-dib

View File

@ -4,3 +4,4 @@ sahara_build_directory: /var/tmp/sahara-image-build
sahara_plugin: vanilla sahara_plugin: vanilla
sahara_plugin_version: '' sahara_plugin_version: ''
sahara_plugin_distro: '' sahara_plugin_distro: ''
tox_executable: 'tox'

View File

@ -1,4 +1,4 @@
- name: Build all the images for the selected plugin - name: Build all the images for the selected plugin
command: ./tools/gate/build-images "{{ sahara_plugin }}" "{{ sahara_plugin_version }}" "{{ sahara_plugin_distro }}" command: ./tools/gate/build-images "{{ sahara_plugin }}" "{{ sahara_plugin_version }}" "{{ sahara_plugin_distro }}" "{{ tox_executable }}"
args: args:
chdir: "{{ sahara_image_elements_src_dir }}" chdir: "{{ sahara_image_elements_src_dir }}"

View File

@ -3,6 +3,7 @@
PLUGIN=$1 PLUGIN=$1
PLUGIN_VERSION=${2:-''} PLUGIN_VERSION=${2:-''}
PLUGIN_DISTRO=${3:-''} PLUGIN_DISTRO=${3:-''}
TOX_EXECUTABLE=${4:-'tox'}
export DIB_MIN_TMPFS=10 export DIB_MIN_TMPFS=10
@ -25,7 +26,7 @@ if [ -n "${PLUGIN}" ] && [ -n "${PLUGIN_VERSION}" ] && [ -n "${PLUGIN_DISTRO}" ]
VERSION_FLAG="" VERSION_FLAG=""
;; ;;
esac esac
tox -e venv -- sahara-image-create -x -u -p ${PLUGIN} -i ${PLUGIN_DISTRO} ${VERSION_FLAG} ${TOX_EXECUTABLE} -e venv -- sahara-image-create -x -u -p ${PLUGIN} -i ${PLUGIN_DISTRO} ${VERSION_FLAG}
exit exit
fi fi
@ -36,7 +37,7 @@ case "$PLUGIN" in
for distro in ubuntu centos7; do for distro in ubuntu centos7; do
# limit to 4 releases # limit to 4 releases
for version in 2.7.1 2.7.5 2.8.2 3.0.1; do for version in 2.7.1 2.7.5 2.8.2 3.0.1; do
tox -e venv -- sahara-image-create -x -u -p $PLUGIN -i $distro -v $version ${TOX_EXECUTABLE} -e venv -- sahara-image-create -x -u -p $PLUGIN -i $distro -v $version
done done
done done
;; ;;
@ -48,13 +49,13 @@ case "$PLUGIN" in
# NOTE(vgridnev): Number of versions are growing; testing only 2 latest # NOTE(vgridnev): Number of versions are growing; testing only 2 latest
# releases of CDH # releases of CDH
for version in 5.9 5.11; do for version in 5.9 5.11; do
tox -e venv -- sahara-image-create -x -u -p $PLUGIN -i $distro -v $version ${TOX_EXECUTABLE} -e venv -- sahara-image-create -x -u -p $PLUGIN -i $distro -v $version
find . -maxdepth 1 -name '*cloudera*.qcow2' -delete find . -maxdepth 1 -name '*cloudera*.qcow2' -delete
sudo rm -rf ~/.cache/image-create sudo rm -rf ~/.cache/image-create
done done
done done
;; ;;
*) *)
tox -e venv -- sahara-image-create -x -u -p $PLUGIN ${TOX_EXECUTABLE} -e venv -- sahara-image-create -x -u -p $PLUGIN
;; ;;
esac esac