forked from containers/podman
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Showing
9 changed files
with
117 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.git/ | ||
.github/ | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
 | ||
|
||
A standard container image for `gofmt` and lint-checking the libpod | ||
repository. The [contributors guide contains the documentation for usage.](https://github.com/containers/libpod/blob/master/CONTRIBUTING.md#go-format-and-lint) | ||
A standard container image for lint-checking and validating changes to the libpod | ||
repository. The | ||
[contributors guide contains the documentation for usage.](https://github.com/containers/libpod/blob/master/CONTRIBUTING.md#go-format-and-lint). Note that this container image is also utilized | ||
in automation, see the file [.cirrus.yml](.cirrus.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$VERSION" ]; then | ||
echo \$VERSION is empty | ||
exit 1 | ||
fi | ||
set -e | ||
|
||
if [ -z "$GOBIN" ]; then | ||
echo \$GOBIN is empty | ||
exit 1 | ||
fi | ||
die() { echo "${1:-No error message given} (from $(basename $0))"; exit 1; } | ||
|
||
[ -n "$VERSION" ] || die "\$VERSION is empty or undefined" | ||
[ -n "$GOBIN" ] || die "\$GOBIN is empty or undefined" | ||
|
||
$GOBIN/golangci-lint --version | grep $VERSION | ||
if [ $? -ne 0 ]; then | ||
set -e | ||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOBIN v$VERSION | ||
BIN="$GOBIN/golangci-lint" | ||
if [ ! -x "$BIN" ]; then | ||
echo "Installing golangci-lint v$VERSION into $GOBIN" | ||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOBIN v$VERSION | ||
else | ||
# Prints it's own file name as part of --verison output | ||
echo "Using existing $(dirname $BIN)/$($BIN --version)" | ||
fi |