diff options
author | Chris Evich <cevich@redhat.com> | 2020-10-05 09:56:15 -0400 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2020-10-05 10:13:24 -0400 |
commit | 0f04cf27c50a7905a12c3d6741410ba87b3cd7b0 (patch) | |
tree | 8fcf95eb117ce71eeb32a9dccd1016e1f07710b0 /contrib/cirrus/lib.sh | |
parent | 2c9084e2245834094e14e9105e64b6062d70a0f1 (diff) | |
download | podman-0f04cf27c50a7905a12c3d6741410ba87b3cd7b0.tar.gz podman-0f04cf27c50a7905a12c3d6741410ba87b3cd7b0.tar.bz2 podman-0f04cf27c50a7905a12c3d6741410ba87b3cd7b0.zip |
Cirrus: Fix branch-validation failure
When validating code on a branch, determining a starting commit to check
from isn't as straightforward as it would seem. Default to using the
SHA from last time CI was green. If for some reason that isn't
available, use an obviously wrong value to cause an intentional
failure. Entirely skip this check on tag-push, since determining a
starting point is incredibly difficult to do automatically.
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus/lib.sh')
-rw-r--r-- | contrib/cirrus/lib.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index b57aee1af..23987938b 100644 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -76,11 +76,12 @@ CIRRUS_CI="${CIRRUS_CI:-false}" DEST_BRANCH="${DEST_BRANCH:-master}" CONTINUOUS_INTEGRATION="${CONTINUOUS_INTEGRATION:-false}" CIRRUS_REPO_NAME=${CIRRUS_REPO_NAME:-podman} -CIRRUS_BASE_SHA=${CIRRUS_BASE_SHA:-unknown$(date +%s)} # difficult to reliably discover +# N/B: CIRRUS_BASE_SHA is empty on branch and tag push. +CIRRUS_BASE_SHA=${CIRRUS_BASE_SHA:-${CIRRUS_LAST_GREEN_CHANGE:-YOU_FOUND_A_BUG}} CIRRUS_BUILD_ID=${CIRRUS_BUILD_ID:-$RANDOM$(date +%s)} # must be short and unique -# Needed for linting and code validation -EPOCH_TEST_COMMIT=${CIRRUS_BASE_SHA:-$CIRRUS_LAST_GREEN_CHANGE} +# The starting place for linting and code validation +EPOCH_TEST_COMMIT="$CIRRUS_BASE_SHA" # Regex of env. vars. to explicitly pass when executing tests # inside a container or as a rootless user |