Browse Source

Gerrit support: assume *-source job gets triggered with full gerrit params

The *-gerrit job which triggers the *-source job should
use the "Current build parameters" option. Otherwise
the *-source job might have a GIT_COMMIT present in
its working space which doesn't match the according
patchset under review.

So always assume that we can rely on parameter
GERRIT_PATCHSET_REVISION to fetch the patchset under
review that should be used for building gerrit stuff.

Development sponsored by Sipwise GmbH
tags/v0.11.0
Michael Prokop 7 years ago
parent
commit
30fd6bb112
1 changed files with 2 additions and 10 deletions
  1. +2
    -10
      scripts/generate-git-snapshot

+ 2
- 10
scripts/generate-git-snapshot View File

@@ -227,8 +227,8 @@ branch_checkout() {

echo "Checking out branch $random_branch based on git commit $GIT_COMMIT"
git checkout -b "$random_branch" "$GIT_COMMIT"
elif [ -z "${GERRIT_EVENT_TYPE:-}" ] && [ -n "${GERRIT_PATCHSET_REVISION:-}" ] ; then
echo "*** We seem to be building for Gerrit but didn't receive the Gerrit event type ***"
elif [ -n "${GERRIT_PATCHSET_REVISION:-}" ] ; then
echo "*** We seem to be building for Gerrit ***"

echo "Making sure that random_branch $random_branch does not exist"
git branch -D "$random_branch" || true
@@ -238,14 +238,6 @@ branch_checkout() {

echo "Checking out branch $random_branch based on Gerrit patchset revision ${GERRIT_PATCHSET_REVISION} ***"
git checkout -b "$random_branch" "$GERRIT_PATCHSET_REVISION"
elif [ -n "${GERRIT_REFSPEC:-}" ] ; then
echo "*** We seem to building for Gerrit, skipping branch/tag handling ***"

echo "Making sure that random_branch $random_branch does not exist"
git branch -D "$random_branch" || true

echo "Checking out branch $random_branch based on git commit $GIT_COMMIT"
git checkout -b "$random_branch" "$GIT_COMMIT"
elif [ -n "${tag:-}" ] && [ "${tag:-}" != "none" ] ; then
echo "Making sure that random_branch $random_branch does not exist"
git branch -D "$random_branch" || true


Loading…
Cancel
Save