1
0
mirror of https://github.com/containers/podman.git synced 2026-02-05 06:45:31 +01:00

install swagger from source

First of all this removes the need for a network connection, second
renovate can update the version as it is tracked in go.mod.

However the real important part is that the binary downloads are
broken[1]. For some reason the swagger created with them does not
include all the type information for the examples. However when building
from source the same thing works fine.

[1] https://github.com/go-swagger/go-swagger/issues/2842

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2024-04-12 13:53:42 +02:00
parent f95b9d4e37
commit 5e9725983d
1011 changed files with 247016 additions and 46 deletions

View File

@@ -1,31 +0,0 @@
#!/usr/bin/env bash
# This script is intended to be a convenience, to be called from the
# Makefile `.install.swagger` target. Any other usage is not recommended.
BIN="$BINDIR/swagger"
die() { echo "${1:-No error message given} (from $(basename $0))"; exit 1; }
function install() {
echo "Installing swagger v$VERSION into $BIN"
curl -sS --retry 5 --location -o $BIN \
https://github.com/go-swagger/go-swagger/releases/download/v$VERSION/swagger_${GOOS}_${GOARCH}
chmod +x $BIN
$BIN version
}
for req_var in VERSION BINDIR GOOS GOARCH; do
[[ -n "${!req_var}" ]] || die "\$$req_var is empty or undefined"
done
if [ ! -x "$BIN" ]; then
install
else
$BIN version | grep "$VERSION"
if [[ "$?" -eq 0 ]]; then
echo "Using existing $BIN"
else
install
fi
fi