Skip to content

Commit

Permalink
prepare-integration.sh: support alt VIRTUALENV_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Nov 12, 2024
1 parent 51bc606 commit 3e468ec
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/github/prepare-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ if [ "$(whoami)" != 'root' ]; then
exit 2
fi

# ./virtualenv is the Makefile managed dir.
# The workflow should set this to use a pants exported or other venv instead.
VIRTUALENV_DIR="${VIRTUALENV_DIR:-./virtualenv}"

# Activate the virtualenv created during make requirements phase
# shellcheck disable=SC1091
source ./virtualenv/bin/activate
# shellcheck disable=SC1090,SC1091
source "${VIRTUALENV_DIR}/bin/activate"

echo "Used config for the tests"
echo ""
Expand All @@ -22,7 +26,9 @@ cat conf/st2.ci.conf || true
echo ""

# install st2 client
python ./st2client/setup.py develop
if [ ! -x "${VIRTUALENV_DIR}/bin/st2" ] || ! st2 --version >/dev/null 2>&1; then
python ./st2client/setup.py develop
fi
st2 --version

# Clean up old st2 log files
Expand Down Expand Up @@ -56,7 +62,7 @@ chmod 777 logs/*

# root needs to access write some lock files when creating virtualenvs
# o=other; X=only set execute bit if user execute bit is set (eg on dirs)
chmod -R o+rwX ./virtualenv/
chmod -R o+rwX "${VIRTUALENV_DIR}/"
# newer virtualenv versions are putting lock files under ~/.local
# as this script runs with sudo, HOME is actually the CI user's home
chmod -R o+rwX "${HOME}/.local/share/virtualenv"

0 comments on commit 3e468ec

Please sign in to comment.