Add JOB info to commit message 15/62615/3
authorJamo Luhrsen <jluhrsen@gmail.com>
Thu, 12 Dec 2019 20:25:36 +0000 (12:25 -0800)
committerJamo Luhrsen <jluhrsen@gmail.com>
Fri, 13 Dec 2019 23:41:23 +0000 (15:41 -0800)
Signed-off-by: Jamo Luhrsen <jluhrsen@gmail.com>
Change-Id: Icb6e7e40752a1c6f91b2c0f73c9cefc4ccfb91de
Signed-off-by: Jamo Luhrsen <jluhrsen@gmail.com>
shell/gerrit-push-patch.sh

index 62f8e9b..d0a77fe 100644 (file)
@@ -50,6 +50,7 @@ GERRIT_HOST="$(echo "$GERRIT_HOST" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")"
 GERRIT_TOPIC="$(echo "$GERRIT_TOPIC" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")"
 GERRIT_USER="$(echo "$GERRIT_USER" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")"
 REVIEWERS_EMAIL="$(echo "$REVIEWERS_EMAIL" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")"
+job=$JOB_NAME/$BUILD_NUMBER
 
 CHANGE_ID=$(ssh -p 29418 "$GERRIT_USER@$GERRIT_HOST" gerrit query \
                limit:1 owner:self is:open project:"$PROJECT" \
@@ -59,9 +60,9 @@ CHANGE_ID=$(ssh -p 29418 "$GERRIT_USER@$GERRIT_HOST" gerrit query \
                awk '{ print $2 }')
 
 if [ -z "$CHANGE_ID" ]; then
-   git commit -sm "$GERRIT_COMMIT_MESSAGE"
+   git commit -sm "$GERRIT_COMMIT_MESSAGE" -m "Job: ${job}"
 else
-   git commit -sm "$GERRIT_COMMIT_MESSAGE" -m "Change-Id: $CHANGE_ID"
+   git commit -sm "$GERRIT_COMMIT_MESSAGE" -m "Job: ${job}\nChange-Id: $CHANGE_ID"
 fi
 
 git status