Mistakenly put the virtualenv bits inside of a loop. Minor
issue and code still works without this patch but should move
it as best practice.
Change-Id: I047ec5f67daea10ef71bc151a2999f6a2235e44f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
IFS=" " read -r -a PATCHES <<< "$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'recheck:' | awk -F: '{print $2}')"
IFS=" " read -r -a PATCHES <<< "$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'recheck:' | awk -F: '{print $2}')"
+# Workaround for git-review bug in v1.24
+# https://storyboard.openstack.org/#!/story/2001081
+set +u # Allow unbound variables for virtualenv
+virtualenv --quiet "/tmp/v/git-review"
+# shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
+source "/tmp/v/git-review/bin/activate"
+pip install --quiet --upgrade pip
+pip install --quiet --upgrade git-review
+set -u
+# End git-review workaround
+
projects=()
for patch in $(echo "${PATCHES[@]}"); do
json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//")
projects=()
for patch in $(echo "${PATCHES[@]}"); do
json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//")
projects+=("$project")
fi
projects+=("$project")
fi
- # Workaround for git-review bug in v1.24
- # https://storyboard.openstack.org/#!/story/2001081
- set +u # Allow unbound variables for virtualenv
- virtualenv --quiet "/tmp/v/git-review"
- # shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
- source "/tmp/v/git-review/bin/activate"
- pip install --quiet --upgrade pip
- pip install --quiet --upgrade git-review
- set -u
- # End git-review workaround
-
pushd "$REPOS_DIR/$project"
# If remote gerrit already exists just make sure path is expected
if ! git remote add gerrit "$GERRIT_URL/$project" > /dev/null 2>&1; then
pushd "$REPOS_DIR/$project"
# If remote gerrit already exists just make sure path is expected
if ! git remote add gerrit "$GERRIT_URL/$project" > /dev/null 2>&1; then
IFS=" " read -r -a PATCHES <<< "$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'recheck:' | awk -F: '{print $2}')"
IFS=" " read -r -a PATCHES <<< "$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'recheck:' | awk -F: '{print $2}')"
+# Workaround for git-review bug in v1.24
+# https://storyboard.openstack.org/#!/story/2001081
+set +u # Allow unbound variables for virtualenv
+virtualenv --quiet "/tmp/v/git-review"
+# shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
+source "/tmp/v/git-review/bin/activate"
+pip install --quiet --upgrade pip
+pip install --quiet --upgrade git-review
+set -u
+# End git-review workaround
+
projects=()
for patch in $(echo "${PATCHES[@]}"); do
json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//")
projects=()
for patch in $(echo "${PATCHES[@]}"); do
json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//")
projects+=("$project")
fi
projects+=("$project")
fi
- # Workaround for git-review bug in v1.24
- # https://storyboard.openstack.org/#!/story/2001081
- set +u # Allow unbound variables for virtualenv
- virtualenv --quiet "/tmp/v/git-review"
- # shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
- source "/tmp/v/git-review/bin/activate"
- pip install --quiet --upgrade pip
- pip install --quiet --upgrade git-review
- set -u
- # End git-review workaround
-
pushd "$REPOS_DIR/$project"
# If remote gerrit already exists just make sure path is expected
if ! git remote add gerrit "$GERRIT_URL/$project" > /dev/null 2>&1; then
pushd "$REPOS_DIR/$project"
# If remote gerrit already exists just make sure path is expected
if ! git remote add gerrit "$GERRIT_URL/$project" > /dev/null 2>&1; then