Merge "Migrate autorelease jobs to lf-infra-publish"
[releng/builder.git] / jjb / opendaylight-infra-push-gerrit-patch.sh
index 6679d271ce1af0037d3cf3718a68bd04280b2450..9e0266ea96977eb38d1dee1d2fef3c9ad1dac91c 100644 (file)
@@ -1,10 +1,16 @@
 #!/bin/bash
-CHANGE_ID=`ssh -p 29418 jenkins-$SILO@git.opendaylight.org gerrit query \
+
+# upgrade git-review to a version that will have the --reviewers option. existing minion
+# image has a version that does not have it.
+sudo pip install git-review --upgrade
+
+# 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 +19,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