From 1c95e66b20dd7358cc0733c7ef225cd5bb6715e9 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 15 Jan 2020 07:56:47 +0100 Subject: contrib/gate/Dockerfile: bump to F31 Use fedora:31 as a base image and rebuild to fetch the latest tools. Signed-off-by: Valentin Rothberg --- contrib/gate/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contrib/gate/Dockerfile b/contrib/gate/Dockerfile index 1939d7ad1..c6aacead5 100644 --- a/contrib/gate/Dockerfile +++ b/contrib/gate/Dockerfile @@ -1,6 +1,5 @@ -FROM fedora:30 +FROM fedora:31 RUN dnf -y install \ - atomic-registries \ btrfs-progs-devel \ bzip2 \ container-selinux \ @@ -46,7 +45,6 @@ WORKDIR $GOSRC # Install dependencies RUN set -x && \ - make install.tools && \ install -D -m 755 $GOSRC/contrib/gate/entrypoint.sh /usr/local/bin/ && \ rm -rf "$GOSRC" -- cgit v1.2.3-54-g00ecf From b6155c1657344b53bf0e99f2a9e116df4f518101 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 15 Jan 2020 08:29:33 +0100 Subject: Makefile: remove gometalinter Remove all references on gometalinter including the target to install it. We are not using it anymore since we have fully migrated to golangci-lint. Signed-off-by: Valentin Rothberg --- Makefile | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 06b6fd03d..520b853c4 100644 --- a/Makefile +++ b/Makefile @@ -481,7 +481,7 @@ uninstall: GIT_CHECK_EXCLUDE="./vendor:docs/make.bat" $(GOBIN)/git-validation -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..$(HEAD) .PHONY: install.tools -install.tools: .install.gitvalidation .install.gometalinter .install.md2man .install.ginkgo .install.golangci-lint ## Install needed tools +install.tools: .install.gitvalidation .install.md2man .install.ginkgo .install.golangci-lint ## Install needed tools define go-get env GO111MODULE=off \ @@ -498,15 +498,6 @@ endef $(call go-get,github.com/vbatts/git-validation); \ fi -.install.gometalinter: .gopathok - if [ ! -x "$(GOBIN)/gometalinter" ]; then \ - $(call go-get,github.com/alecthomas/gometalinter); \ - cd $(FIRST_GOPATH)/src/github.com/alecthomas/gometalinter; \ - git checkout --detach e8d801238da6f0dfd14078d68f9b53fa50a7eeb5; \ - $(GO) install github.com/alecthomas/gometalinter; \ - $(GOBIN)/gometalinter --install; \ - 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; \ -- cgit v1.2.3-54-g00ecf From b830d3eb07e163864048fb6b4d0873cb61965dd0 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 15 Jan 2020 08:47:03 +0100 Subject: 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 --- Makefile | 4 +--- hack/install_golangci.sh | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 hack/install_golangci.sh 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 -- cgit v1.2.3-54-g00ecf