X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fopendaylight-infra-push-gerrit-patch.sh;h=a75710b2c463bcacb4062316bcd35573cf9eb1b3;hb=8dc3ddb44c36cae7a3bf28555544c3b61131989a;hp=6679d271ce1af0037d3cf3718a68bd04280b2450;hpb=ced8056ad126c3d625bf86af8a59839889a0cc31;p=releng%2Fbuilder.git diff --git a/jjb/opendaylight-infra-push-gerrit-patch.sh b/jjb/opendaylight-infra-push-gerrit-patch.sh index 6679d271c..a75710b2c 100644 --- a/jjb/opendaylight-infra-push-gerrit-patch.sh +++ b/jjb/opendaylight-infra-push-gerrit-patch.sh @@ -1,10 +1,23 @@ #!/bin/bash -CHANGE_ID=`ssh -p 29418 jenkins-$SILO@git.opendaylight.org gerrit query \ + +# Install git-review using virtualenv to the latest version that supports +# --reviewers option, available through pip install. Existing minion image has a +# version that does not have it. +virtualenv "/tmp/v/git-review" +# shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091 +source "/tmp/v/git-review/bin/activate" +pip install --upgrade pip +pip install --upgrade git-review +pip install --upgrade pipdeptree +pipdeptree + +# shellcheck disable=SC1083 +CHANGE_ID=$(ssh -p 29418 "jenkins-$SILO@git.opendaylight.org" gerrit query \ limit:1 owner:self is:open project:{project} \ message:'{gerrit-commit-message}' \ topic:{gerrit-topic} | \ grep 'Change-Id:' | \ - awk '{{ print $2 }}'` + awk '{{ print $2 }}') if [ -z "$CHANGE_ID" ]; then git commit -sm "{gerrit-commit-message}" @@ -13,8 +26,9 @@ else fi git status -git remote add gerrit ssh://jenkins-$SILO@git.opendaylight.org:29418/releng/builder.git +git remote add gerrit "ssh://jenkins-$SILO@git.opendaylight.org:29418/releng/builder.git" # Don't fail the build if this command fails because it's possible that there # is no changes since last update. -git review --yes -t {gerrit-topic} || true +# shellcheck disable=SC1083 +git review --yes -t {gerrit-topic} --reviewers jluhrsen@redhat.com || true