Add mandatory container_mode to reproducer script

Reproducer playbook requires container_mode, set it for 'podman'
by default.
Change-Id: If764a36d76278d303e07177b41d11db7370c5c87
This commit is contained in:
Sagi Shnaidman 2020-07-16 12:46:52 +03:00
parent d7de304715
commit 9a3f78fc94
1 changed files with 44 additions and 36 deletions

View File

@ -18,6 +18,7 @@
: ${UPSTREAM_GERRIT_SSH_KEY:="id_rsa"}
: ${RDO_GERRIT_SSH_KEY:="id_rsa"}
: ${EXTRA_PARAMS:=""}
: ${CONTAINER_MODE:="podman"}
usage () {
echo "Usage: $0 [options]"
@ -146,6 +147,11 @@ while [ "x$1" != "x" ]; do
shift
;;
--container-cli|-cont)
CONTAINER_MODE=$2
shift
;;
--help|-h)
usage
exit
@ -195,7 +201,8 @@ install_package_deps_via_bindep
# Ensure pip is updated
sudo pip install --upgrade pip
if [ -x "/usr/bin/docker" ] ; then
if [[ "$CONTAINER_CLI" == "docker"]]; then
if [ -x "/usr/bin/docker" ] ; then
# Fail as early as possible if the docker
# group is not setup appropriately.
# This has to be done AFTER package intalls.
@ -234,6 +241,7 @@ if [ -x "/usr/bin/docker" ] ; then
# Ensure the docker process has been restarted
sudo systemctl restart docker
fi
fi
# Start from a clean workspace
@ -298,10 +306,10 @@ if [[ "$RDO_GERRIT_SSH_KEY" != "$USER_SSH_KEY" ]]; then
EXTRA_PARAMS="$EXTRA_PARAMS -e rdo_gerrit_key=$RDO_GERRIT_SSH_KEY "
fi
# Run the launcher playbook
PATH=${HOME}/.local/bin:$PATH ansible-playbook \
$WORKSPACE/launcher-playbook.yaml \
-e container_mode="$CONTAINER_MODE" \
-vv \
--tags all \
${EXTRA_PARAMS[@]}