Merge "move network id to local jenkins configuration managed files"
[releng/builder.git] / jjb / opendaylight-infra-push-gerrit-patch.sh
1 #!/bin/bash
2 CHANGE_ID=`ssh -p 29418 jenkins-$SILO@git.opendaylight.org gerrit query \
3                limit:1 owner:self is:open project:{project} \
4                message:'{gerrit-commit-message}' \
5                topic:{gerrit-topic} | \
6                grep 'Change-Id:' | \
7                awk '{{ print $2 }}'`
8
9 if [ -z "$CHANGE_ID" ]; then
10     git commit -sm "{gerrit-commit-message}"
11 else
12     git commit -sm "{gerrit-commit-message}" -m "Change-Id: $CHANGE_ID"
13 fi
14
15 git status
16 git remote add gerrit ssh://jenkins-$SILO@git.opendaylight.org:29418/releng/builder.git
17
18 # Don't fail the build if this command fails because it's possible that there
19 # is no changes since last update.
20 git review --yes -t {gerrit-topic} || true