Import infrared workspace if available

Change-Id: I06469d73e4da3005bccc6333becb5a0a69e4c89c
This commit is contained in:
Federico Ressi 2020-03-11 11:21:51 +01:00
parent df574359c4
commit 447231ef0a
2 changed files with 12 additions and 0 deletions

3
.gitignore vendored
View File

@ -40,4 +40,7 @@ Pipfile.lock
tobiko.conf
clouds.yaml
ssh_config
# Infrared things
.infrared
workspace.tgz

View File

@ -5,6 +5,10 @@ source $(dirname "$0")/tox
set -eu
if [ "${IR_DEBUG:-}" != "" ]; then
set -x
fi
IR_VIRTUAL_ENV=$(realpath "${IR_VIRTUAL_ENV:-.tox/infrared}")
IR_REPO="https://github.com/redhat-openstack/infrared.git"
IR_BRANCH=${IR_BRANCH:-master}
@ -12,6 +16,7 @@ IR_SOURCE_DIR=$(realpath "${IR_SOURCE_DIR:-${IR_VIRTUAL_ENV}/infrared}")
IR_EXECUTABLE=${IR_VIRTUAL_ENV}/bin/infrared
export IR_HOME=$(realpath ${IR_HOME:-$(pwd)/.infrared/})
IR_TOBIKO_PLUGIN=$(realpath ${IR_TOBIKO_PLUGIN:-$(pwd)/roles/infrared})
IR_WORKSPACE_FILE=${IR_WORKSPACE_FILE:-$(realpath ./workspace.tgz)}
function ir {
@ -33,11 +38,15 @@ function ir_setup {
pip install --upgrade "${package_name}"
done
rm -fR "${IR_HOME}"
(
cd "${IR_SOURCE_DIR}"
"${IR_EXECUTABLE}" plugin list --available --versions || true
"${IR_EXECUTABLE}" plugin remove tobiko || true
"${IR_EXECUTABLE}" plugin add "${IR_TOBIKO_PLUGIN}"
if [ -f "${IR_WORKSPACE_FILE}" ]; then
"${IR_EXECUTABLE}" workspace import "${IR_WORKSPACE_FILE}"
fi
)
fi