diff options
author | Chris Evich <cevich@redhat.com> | 2020-01-31 12:50:27 -0500 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2020-03-02 08:50:54 -0500 |
commit | d0782e7839888d9eecdc97e8e885d5f787f5b8a7 (patch) | |
tree | 3611ed6dffdab3013c47a92c2d1dca3a7746e70b /contrib/gate/entrypoint.sh | |
parent | 275e9b855dd0a384a283174912c08f3f097101b5 (diff) | |
download | podman-d0782e7839888d9eecdc97e8e885d5f787f5b8a7.tar.gz podman-d0782e7839888d9eecdc97e8e885d5f787f5b8a7.tar.bz2 podman-d0782e7839888d9eecdc97e8e885d5f787f5b8a7.zip |
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>
Diffstat (limited to 'contrib/gate/entrypoint.sh')
-rwxr-xr-x | contrib/gate/entrypoint.sh | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/contrib/gate/entrypoint.sh b/contrib/gate/entrypoint.sh index 0189cf7c5..ab6528e00 100755 --- a/contrib/gate/entrypoint.sh +++ b/contrib/gate/entrypoint.sh @@ -1,15 +1,23 @@ #!/bin/bash -[[ -n "$SRCPATH" ]] || \ - ( echo "ERROR: \$SRCPATH must be non-empty" && exit 1 ) -[[ -n "$GOSRC" ]] || \ - ( echo "ERROR: \$GOSRC must be non-empty" && exit 2 ) +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" ]] || \ - ( echo "ERROR: Expecting libpod repository root at $SRCPATH" && exit 3 ) + die 4 "ERROR: Expecting libpod repository root at $SRCPATH" # Working from a copy avoids needing to perturb the actual source files -mkdir -p "$GOSRC" +# 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" -make "$@" +exec make "$@" |