From 447231ef0a0de10cb3a7724e63a20c5241b5f589 Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Wed, 11 Mar 2020 11:21:51 +0100 Subject: [PATCH] Import infrared workspace if available Change-Id: I06469d73e4da3005bccc6333becb5a0a69e4c89c --- .gitignore | 3 +++ tools/ci/ir | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index 402a1f803..876ab628d 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,7 @@ Pipfile.lock tobiko.conf clouds.yaml ssh_config + +# Infrared things .infrared +workspace.tgz diff --git a/tools/ci/ir b/tools/ci/ir index 22120370a..9ebea775b 100755 --- a/tools/ci/ir +++ b/tools/ci/ir @@ -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