X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fgerrit-fetch-dependencies.sh;h=c897f552e8f1b24a3f8303fe758812c10aec1791;hb=f216bdeee46b3c3299868bc6fdd2753785358f0a;hp=30ba7c86be08ec9a128d0a4c684d8f2fd8dd7f1c;hpb=a97f48ea67f1bd469d25ae816d7ba66786ecd68a;p=releng%2Fglobal-jjb.git diff --git a/shell/gerrit-fetch-dependencies.sh b/shell/gerrit-fetch-dependencies.sh index 30ba7c86..c897f552 100644 --- a/shell/gerrit-fetch-dependencies.sh +++ b/shell/gerrit-fetch-dependencies.sh @@ -8,6 +8,7 @@ # 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 @@ -24,21 +25,18 @@ set -eu -o pipefail REPOS_DIR="$WORKSPACE/.repos" -IFS=" " read -r -a PATCHES <<< "$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep -E '(recheck:|reverify:)' | awk -F: '{print $2}')" +IFS=" " read -r -a PATCHES <<< \ + "$(echo "$GERRIT_EVENT_COMMENT_TEXT" | \ + grep -E '(recheck:|reverify:)' | awk -F: '{print $2}')" + +# shellcheck disable=SC1090 +source ~/lf-env.sh + +lf-activate-venv "git-review==1.28" -# 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==9.0.3" setuptools -pip install --quiet --upgrade git-review -set -u -# End git-review workaround projects=() -for patch in $(echo "${PATCHES[@]}"); do +for patch in "${PATCHES[@]}"; do json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//") project=$(echo "$json" | jq -r '.project') branch=$(echo "$json" | jq -r '.branch')