summaryrefslogtreecommitdiff
path: root/contrib/gate/entrypoint.sh
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-05 19:28:10 +0100
committerGitHub <noreply@github.com>2020-03-05 19:28:10 +0100
commit60e9e7ca9c9081f31f6b37c922f0058f82b989ad (patch)
treeeaa56f2370e98e7c91a1d6c26944761d1fdb286a /contrib/gate/entrypoint.sh
parent36260286402a514417b642abd8f45a800f0dc9da (diff)
parentd0782e7839888d9eecdc97e8e885d5f787f5b8a7 (diff)
downloadpodman-60e9e7ca9c9081f31f6b37c922f0058f82b989ad.tar.gz
podman-60e9e7ca9c9081f31f6b37c922f0058f82b989ad.tar.bz2
podman-60e9e7ca9c9081f31f6b37c922f0058f82b989ad.zip
Merge pull request #5039 from cevich/fix_gobin_exit_bug
Cirrus: Fix gate image & false-positive exits
Diffstat (limited to 'contrib/gate/entrypoint.sh')
-rwxr-xr-xcontrib/gate/entrypoint.sh22
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 "$@"