mirror of
https://github.com/containers/podman.git
synced 2025-06-29 23:22:40 +08:00
Merge pull request #16161 from cevich/install_swagger
[CI:DOCS] Add swagger install + allow version updates in CI
This commit is contained in:
10
Makefile
10
Makefile
@ -849,7 +849,7 @@ install.systemd:
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: install.tools
|
.PHONY: install.tools
|
||||||
install.tools: .install.ginkgo .install.golangci-lint ## Install needed tools
|
install.tools: .install.ginkgo .install.golangci-lint .install.swagger ## Install needed tools
|
||||||
$(MAKE) -C test/tools
|
$(MAKE) -C test/tools
|
||||||
|
|
||||||
.PHONY: .install.goimports
|
.PHONY: .install.goimports
|
||||||
@ -868,6 +868,14 @@ install.tools: .install.ginkgo .install.golangci-lint ## Install needed tools
|
|||||||
.install.golangci-lint:
|
.install.golangci-lint:
|
||||||
VERSION=1.46.2 ./hack/install_golangci.sh
|
VERSION=1.46.2 ./hack/install_golangci.sh
|
||||||
|
|
||||||
|
.PHONY: .install.swagger
|
||||||
|
.install.swagger:
|
||||||
|
env VERSION=0.30.3 \
|
||||||
|
BINDIR=$(BINDIR) \
|
||||||
|
GOOS=$(GOOS) \
|
||||||
|
GOARCH=$(GOARCH) \
|
||||||
|
./hack/install_swagger.sh
|
||||||
|
|
||||||
.PHONY: .install.md2man
|
.PHONY: .install.md2man
|
||||||
.install.md2man:
|
.install.md2man:
|
||||||
if [ ! -x "$(GOMD2MAN)" ]; then \
|
if [ ! -x "$(GOMD2MAN)" ]; then \
|
||||||
|
@ -363,7 +363,9 @@ case "$TEST_FLAVOR" in
|
|||||||
showrun $ssh podman tag $helper_fqin \
|
showrun $ssh podman tag $helper_fqin \
|
||||||
docker.io/gitlab/gitlab-runner-helper:x86_64-latest-pwsh
|
docker.io/gitlab/gitlab-runner-helper:x86_64-latest-pwsh
|
||||||
;;
|
;;
|
||||||
swagger) ;& # use next item
|
swagger)
|
||||||
|
make .install.swagger
|
||||||
|
;;
|
||||||
release) ;;
|
release) ;;
|
||||||
*) die_unknown TEST_FLAVOR
|
*) die_unknown TEST_FLAVOR
|
||||||
esac
|
esac
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# This script is intended to be a convenience, to be called from the
|
||||||
|
# Makefile `.install.golangci-lint` target. Any other usage is not recommended.
|
||||||
|
|
||||||
die() { echo "${1:-No error message given} (from $(basename $0))"; exit 1; }
|
die() { echo "${1:-No error message given} (from $(basename $0))"; exit 1; }
|
||||||
|
|
||||||
[ -n "$VERSION" ] || die "\$VERSION is empty or undefined"
|
[ -n "$VERSION" ] || die "\$VERSION is empty or undefined"
|
||||||
|
31
hack/install_swagger.sh
Executable file
31
hack/install_swagger.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/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
|
Reference in New Issue
Block a user