From 9ace820ccb26638aad261697cb0a180e77af95e2 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Wed, 10 Jan 2018 13:40:39 -0500 Subject: [PATCH] Update remote gerrit to use GERRIT_URL 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 --- .../gerrit-maven-maven-verify-deps-master-mvn33-openjdk8 | 16 +++++++++++++++- shell/gerrit-fetch-dependencies.sh | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.jjb-test/expected-xml/gerrit-maven-maven-verify-deps-master-mvn33-openjdk8 b/.jjb-test/expected-xml/gerrit-maven-maven-verify-deps-master-mvn33-openjdk8 index 13edea68..17ea739e 100644 --- a/.jjb-test/expected-xml/gerrit-maven-maven-verify-deps-master-mvn33-openjdk8 +++ b/.jjb-test/expected-xml/gerrit-maven-maven-verify-deps-master-mvn33-openjdk8 @@ -278,8 +278,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 diff --git a/shell/gerrit-fetch-dependencies.sh b/shell/gerrit-fetch-dependencies.sh index e9c337c1..830243fe 100644 --- a/shell/gerrit-fetch-dependencies.sh +++ b/shell/gerrit-fetch-dependencies.sh @@ -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 -- 2.16.6