VENV: Allows venv to be in two locations
This allows the venv to be found in two different locations:
- /.venv
- /home/buildslave/.venv
This is to allow for the transmission from the former to the latter
without causing any new issues.
Change-Id: I79584a6414d8d5e5b7b72bd9c7a4344415ce9dc9
Signed-off-by: Matthew Dalzell <matthew.dalzell@arm.com>
diff --git a/src/org/trustedfirmware/Gerrit.groovy b/src/org/trustedfirmware/Gerrit.groovy
index bbfd743..8df8af0 100644
--- a/src/org/trustedfirmware/Gerrit.groovy
+++ b/src/org/trustedfirmware/Gerrit.groovy
@@ -38,7 +38,13 @@
echo Not running for a Gerrit change, skipping vote.
exit 0
fi
- . /.venv/bin/activate
+
+ if [ -d "./.venv" ]; then
+ . /.venv/bin/activate
+ elif [ -d "/home/buildslave/.venv" ]; then
+ . /home/buildslave/.venv/bin/activate
+ fi
+
pip -q install requests
./tf-m-ci-scripts/jenkins/verify.py --category ${category} --value ${value} --verify-name ${verify_name} --user \$VERIFY_USER
""")
@@ -62,7 +68,13 @@
echo Not running for a Gerrit change, skipping.
exit 0
fi
- . /.venv/bin/activate
+
+ if [ -d "./.venv" ]; then
+ . /.venv/bin/activate
+ elif [ -d "/home/buildslave/.venv" ]; then
+ . /home/buildslave/.venv/bin/activate
+ fi
+
pip -q install requests
./tf-m-ci-scripts/jenkins/comment.py --comment "${comment}" --user \$GERRIT_USER
""")