X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fgerrit-fetch-dependencies.sh;h=24542e90b1a9bfe74d170366afba809488aefb75;hb=2a10c83b2d506008cc6c01c134515fb6328e1f3a;hp=99a71f021ce637bf01a162ba3ca6b30494095df7;hpb=7b76f3eba41881e26089e33b0118416d01643fe7;p=releng%2Fglobal-jjb.git diff --git a/shell/gerrit-fetch-dependencies.sh b/shell/gerrit-fetch-dependencies.sh index 99a71f02..24542e90 100644 --- a/shell/gerrit-fetch-dependencies.sh +++ b/shell/gerrit-fetch-dependencies.sh @@ -8,11 +8,14 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## +echo "---> gerrit-fetch-dependencies.sh" # Fetches patches all projects provided by comment trigger # # Takes a list of Gerrit patches and fetches all projects and cherry-pick # patches for projects. The trigger is # 'recheck: SPACE_SEPERATED_LIST_OF_PATCHES' +# or +# 'reverify: SPACE_SEPERATED_LIST_OF_PATCHES' # # NOTE: This script assumes the user will provide the correct dependency order # via the PATCHES list. @@ -22,7 +25,7 @@ set -eu -o pipefail REPOS_DIR="$WORKSPACE/.repos" -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 -E '(recheck:|reverify:)' | awk -F: '{print $2}')" # Workaround for git-review bug in v1.24 # https://storyboard.openstack.org/#!/story/2001081 @@ -30,7 +33,7 @@ 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 "pip==9.0.3" setuptools pip install --quiet --upgrade git-review set -u # End git-review workaround @@ -41,6 +44,11 @@ for patch in $(echo "${PATCHES[@]}"); do project=$(echo "$json" | jq -r '.project') branch=$(echo "$json" | jq -r '.branch') + if [ "$GERRIT_CHANGE_NUMBER" == "$patch" ]; then + echo "WARN: GERRIT_CHANGE and $patch are one and the same. Ignoring patch..." + continue + fi + if [ ! -d "$REPOS_DIR/$project" ]; then git clone -q --depth 1 -b "$branch" "$GIT_URL/$project" "$REPOS_DIR/$project"