Update remote gerrit to use GERRIT_URL 35/8335/3
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 10 Jan 2018 18:40:39 +0000 (13:40 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 10 Jan 2018 20:34:35 +0000 (15:34 -0500)
Because GIT_BASE and GIT_URL now point to a git mirror
that is not a Gerrit system we need to set it up with
GERRIT_URL anonymous http.

Change-Id: I8f4eccf89dc14d7c27d353b00a7595fdcded70b2
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 13edea6..17ea739 100644 (file)
@@ -278,8 +278,22 @@ 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;
-    git remote add gerrit &quot;$GIT_URL/$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
+        git remote set-url gerrit &quot;$GERRIT_URL/$project&quot;
+    fi
     git review --cherrypick=&quot;$patch&quot;
     popd
 done
index e9c337c..830243f 100644 (file)
@@ -37,8 +37,22 @@ 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"
-    git remote add gerrit "$GIT_URL/$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
+        git remote set-url gerrit "$GERRIT_URL/$project"
+    fi
     git review --cherrypick="$patch"
     popd
 done