3 # Install git-review using virtualenv to the latest version that supports
4 # --reviewers option, available through pip install. Existing minion image has a
5 # version that does not have it.
6 virtualenv "$WORKSPACE/.virtualenvs/git-review"
7 # shellcheck source=./.virtualenvs/tox/bin/activate disable=SC1091
8 source "$WORKSPACE/.virtualenvs/git-review/bin/activate"
9 PYTHON="$WORKSPACE/.virtualenvs/git-review/bin/python"
10 $PYTHON -m pip install --upgrade pip
11 $PYTHON -m pip install --upgrade git-review
14 # shellcheck disable=SC1083
15 CHANGE_ID=$(ssh -p 29418 "jenkins-$SILO@git.opendaylight.org" gerrit query \
16 limit:1 owner:self is:open project:{project} \
17 message:'{gerrit-commit-message}' \
18 topic:{gerrit-topic} | \
22 if [ -z "$CHANGE_ID" ]; then
23 git commit -sm "{gerrit-commit-message}"
25 git commit -sm "{gerrit-commit-message}" -m "Change-Id: $CHANGE_ID"
29 git remote add gerrit "ssh://jenkins-$SILO@git.opendaylight.org:29418/releng/builder.git"
31 # Don't fail the build if this command fails because it's possible that there
32 # is no changes since last update.
33 # shellcheck disable=SC1083
34 git review --yes -t {gerrit-topic} --reviewers jluhrsen@redhat.com || true