Install git-review outside of loop 51/8351/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 10 Jan 2018 22:39:23 +0000 (17:39 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 12 Jan 2018 02:31:35 +0000 (21:31 -0500)
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>
.jjb-test/expected-xml/gerrit-maven-maven-verify-deps-master-mvn33-openjdk8
shell/gerrit-fetch-dependencies.sh

index 17ea739..693b4a0 100644 (file)
@@ -265,6 +265,17 @@ REPOS_DIR=&quot;$WORKSPACE/.repos&quot;
 
 IFS=&quot; &quot; read -r -a PATCHES &lt;&lt;&lt; &quot;$(echo &quot;$GERRIT_EVENT_COMMENT_TEXT&quot; | grep 'recheck:' | awk -F: '{print $2}')&quot;
 
+# Workaround for git-review bug in v1.24
+# https://storyboard.openstack.org/#!/story/2001081
+set +u  # Allow unbound variables for virtualenv
+virtualenv --quiet &quot;/tmp/v/git-review&quot;
+# shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
+source &quot;/tmp/v/git-review/bin/activate&quot;
+pip install --quiet --upgrade pip
+pip install --quiet --upgrade git-review
+set -u
+# End git-review workaround
+
 projects=()
 for patch in $(echo &quot;${PATCHES[@]}&quot;); do
     json=$(curl -s &quot;$GERRIT_URL/changes/$patch&quot; | sed -e &quot;s/)]}'//&quot;)
@@ -278,17 +289,6 @@ for patch in $(echo &quot;${PATCHES[@]}&quot;); do
         projects+=(&quot;$project&quot;)
     fi
 
-    # Workaround for git-review bug in v1.24
-    # https://storyboard.openstack.org/#!/story/2001081
-    set +u  # Allow unbound variables for virtualenv
-    virtualenv --quiet &quot;/tmp/v/git-review&quot;
-    # shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
-    source &quot;/tmp/v/git-review/bin/activate&quot;
-    pip install --quiet --upgrade pip
-    pip install --quiet --upgrade git-review
-    set -u
-    # End git-review workaround
-
     pushd &quot;$REPOS_DIR/$project&quot;
     # If remote gerrit already exists just make sure path is expected
     if ! git remote add gerrit &quot;$GERRIT_URL/$project&quot; &gt; /dev/null 2&gt;&amp;1; then
index 830243f..99a71f0 100644 (file)
@@ -24,6 +24,17 @@ REPOS_DIR="$WORKSPACE/.repos"
 
 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/)]}'//")
@@ -37,17 +48,6 @@ for patch in $(echo "${PATCHES[@]}"); do
         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