summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-01-15 08:47:03 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-01-15 08:55:46 +0100
commitb830d3eb07e163864048fb6b4d0873cb61965dd0 (patch)
tree010ae9597a92d24dd143c84e255f62ee97cdda4d
parentb6155c1657344b53bf0e99f2a9e116df4f518101 (diff)
downloadpodman-b830d3eb07e163864048fb6b4d0873cb61965dd0.tar.gz
podman-b830d3eb07e163864048fb6b4d0873cb61965dd0.tar.bz2
podman-b830d3eb07e163864048fb6b4d0873cb61965dd0.zip
make .install.golangci-lint: force specific version
Instead of only performing a presence check of the binary, also do a version check and force installing the specified one if needed. This will prevent users and the CI from using a wrong version in the future. Move the logic into a dedicated shell script as I find built-in bash in Makefiles hard to maintain. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
-rw-r--r--Makefile4
-rw-r--r--hack/install_golangci.sh5
2 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 520b853c4..a02706eaf 100644
--- a/Makefile
+++ b/Makefile
@@ -499,9 +499,7 @@ endef
fi
.install.golangci-lint: .gopathok
- if [ ! -x "$(GOBIN)/golangci-lint" ]; then \
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOBIN)/ v1.18.0; \
- fi
+ VERSION=1.18.0 GOBIN=$(GOBIN) sh ./hack/install_golangci.sh
.install.md2man: .gopathok
if [ ! -x "$(GOMD2MAN)" ]; then \
diff --git a/hack/install_golangci.sh b/hack/install_golangci.sh
new file mode 100644
index 000000000..9d23bbd31
--- /dev/null
+++ b/hack/install_golangci.sh
@@ -0,0 +1,5 @@
+#!/bin/bash -e
+$GOBIN/golangci-lint --version | grep $VERSION
+if [ $? -ne 0 ]; then
+ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOBIN v$VERSION
+fi