Files
podman/contrib/gate/entrypoint.sh
Chris Evich d0782e7839 Cirrus: Fix gate image & false-positive exits
A number of scripts relating to tooling used and the gate container
image were not exiting upon errors as intended.  Coupled with
external service unavailability (i.e. downloading golangci-lint)
was observed to cause difficult to debug failures.

This change corrects the scripts inside/out of the gate container as
well as fixes many golang related path consistency problems vs other CI
jobs.  After this change, all jobs use consistent path names reducing
the number of special-case overrides needed.

Lastly, I also made a documentation-pass, updating/correcting as needed,
including documenting a likely local validation-failure mode, related to
`$EPOCH_TEST_COMMIT`.  This is dependent on the developers git
environment, so documentation is the only possible "fix".

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-03-02 08:50:54 -05:00

24 lines
772 B
Bash
Executable File

#!/bin/bash
set -e
die() {
echo "${2:-FATAL ERROR (but no message given!)} (gate container entrypoint)"
exit ${1:-1}
}
[[ -n "$SRCPATH" ]] || die 1 "ERROR: \$SRCPATH must be non-empty"
[[ -n "$GOPATH" ]] || die 2 "ERROR: \$GOPATH must be non-empty"
[[ -n "$GOSRC" ]] || die 3 "ERROR: \$GOSRC must be non-empty"
[[ -r "${SRCPATH}/contrib/gate/Dockerfile" ]] || \
die 4 "ERROR: Expecting libpod repository root at $SRCPATH"
# Working from a copy avoids needing to perturb the actual source files
# if/when developers use gate container for local testing
echo "Copying $SRCPATH to $GOSRC"
mkdir -vp "$GOSRC"
/usr/bin/rsync --recursive --links --quiet --safe-links \
--perms --times --delete "${SRCPATH}/" "${GOSRC}/"
cd "$GOSRC"
exec make "$@"