summaryrefslogtreecommitdiff
path: root/.cirrus.yml
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2020-02-03 11:58:38 -0500
committerChris Evich <cevich@redhat.com>2020-02-03 16:23:46 -0500
commitdbb9d098b5cb87f60debc4861dd15774257c9dbf (patch)
tree8d45150d0ef9d3dea6e4c865e870096f66aeadf2 /.cirrus.yml
parent23f795786224c27f737e9043e9d513f54fa35ba8 (diff)
downloadpodman-dbb9d098b5cb87f60debc4861dd15774257c9dbf.tar.gz
podman-dbb9d098b5cb87f60debc4861dd15774257c9dbf.tar.bz2
podman-dbb9d098b5cb87f60debc4861dd15774257c9dbf.zip
Cirrus: Fix gate task + make lint|validate
A recent Makefile change (4ec893a748) removed a side-effect necessary for 'make validation' to pass under automation. Making things worse, change 12bd7e927c was found upon investigation to always point at the latest upstream HEAD. However, this is rarely a fork-point for pull-requests. Further investigation showed the built-in Cirrus-CI, golang-based git does not obtain sufficient data for the Makefile command `git merge-base HEAD $${DEST_BRANCH:-master}` to function properly (in the context of the gate container). Fix this by customizing the clone operation and slightly adjust the Makefile command to function as intended in the gate container. Also add checks to the validate and lint targets which validate the variable EPOCH_TEST_COMMIT value is never an empty string or whitespace. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to '.cirrus.yml')
-rw-r--r--.cirrus.yml11
1 files changed, 10 insertions, 1 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index bb2da0812..8f355b3ba 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -93,7 +93,6 @@ gating_task:
CIRRUS_WORKING_DIR: "/usr/src/libpod"
GOPATH: "/go"
GOSRC: "/go/src/github.com/containers/libpod"
- EPOCH_TEST_COMMIT: "${CIRRUS_BASE_SHA}"
# Runs within Cirrus's "community cluster"
container:
@@ -103,6 +102,16 @@ gating_task:
timeout_in: 20m
+ # Custom cloning is required to satisfy lint/validation needs
+ clone_script: |
+ git clone --recursive --branch=$DEST_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
+ git remote update origin
+ if [[ -n "$CIRRUS_PR" ]]; then # running for a PR
+ git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
+ git checkout pull/$CIRRUS_PR
+ fi
+ git reset --hard $CIRRUS_CHANGE_IN_REPO
+
# Don't bother going further if something is down
networking_script: '${CIRRUS_WORKING_DIR}/${SCRIPT_BASE}/networking.sh'