summaryrefslogtreecommitdiff
path: root/contrib/cirrus
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2021-12-08 10:46:26 -0500
committerChris Evich <cevich@redhat.com>2021-12-09 12:14:44 -0500
commita63035be203254b979e56bb77e7cf48646e9962b (patch)
treec0a222838baa37eb88d1f3fb42569a2ac8b4df35 /contrib/cirrus
parentd6079debd86861c40f98cf66d6da3208bc5b397a (diff)
downloadpodman-a63035be203254b979e56bb77e7cf48646e9962b.tar.gz
podman-a63035be203254b979e56bb77e7cf48646e9962b.tar.bz2
podman-a63035be203254b979e56bb77e7cf48646e9962b.zip
Cirrus: Use cached swagger binary
An error was observed in another PR while downloading the swagger binary. The error was relating to the upstream egress quota. Obviously our downloading it every time for each CI run isn't helping. Fix this by moving the download into the image-build process, and simply re-use the already present binary here. Ref: https://github.com/containers/automation_images/pull/103 Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus')
-rwxr-xr-xcontrib/cirrus/runner.sh10
1 files changed, 2 insertions, 8 deletions
diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh
index 2c961da06..c52fd9216 100755
--- a/contrib/cirrus/runner.sh
+++ b/contrib/cirrus/runner.sh
@@ -141,11 +141,8 @@ function _run_swagger() {
local envvarsfile
req_env_vars GCPJSON GCPNAME GCPPROJECT CTR_FQIN
- # Building this is a PITA, just grab binary for use in automation
- # Ref: https://goswagger.io/install.html#static-binary
- download_url=$(\
- curl -s https://api.github.com/repos/go-swagger/go-swagger/releases/latest | \
- jq -r '.assets[] | select(.name | contains("linux_amd64")) | .browser_download_url')
+ [[ -x /usr/local/bin/swagger ]] || \
+ die "Expecting swagger binary to be present and executable."
# The filename and bucket depend on the automation context
#shellcheck disable=SC2154,SC2153
@@ -166,9 +163,6 @@ function _run_swagger() {
die "Unknown execution context, expected a non-empty value for \$CIRRUS_TAG, \$CIRRUS_BRANCH, or \$CIRRUS_PR"
fi
- curl -s -o /usr/local/bin/swagger -L'#' "$download_url"
- chmod +x /usr/local/bin/swagger
-
# Swagger validation takes a significant amount of time
msg "Pulling \$CTR_FQIN '$CTR_FQIN' (background process)"
podman pull --quiet $CTR_FQIN &