From 80a9820e7ead8d8d1b5c88bc52cceae1a25c7c48 Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Tue, 8 Feb 2022 20:25:57 +0100 Subject: [PATCH] cleanup build Signed-off-by: Markus Blaschke --- Dockerfile | 7 +------ Makefile | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8f5075d..08c8c89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,14 +2,9 @@ FROM golang:1.17 as build WORKDIR /go/src/github.com/webdevops/kube-pool-manager -# Get deps (cached) -COPY ./go.mod /go/src/github.com/webdevops/kube-pool-manager -COPY ./go.sum /go/src/github.com/webdevops/kube-pool-manager -COPY ./Makefile /go/src/github.com/webdevops/kube-pool-manager -RUN make dependencies - # Compile COPY ./ /go/src/github.com/webdevops/kube-pool-manager +RUN make dependencies RUN make test RUN make build RUN ./kube-pool-manager --help diff --git a/Makefile b/Makefile index 34b3a57..8e52575 100644 --- a/Makefile +++ b/Makefile @@ -34,12 +34,20 @@ build-push-development: test: go test ./... +.PHONY: dependencies +dependencies: + go mod vendor + .PHONY: lint lint: $(GOLANGCI_LINT_BIN) - $(GOLANGCI_LINT_BIN) run -E exportloopref,gofmt --timeout=10m + $(GOLANGCI_LINT_BIN) run -E exportloopref,gofmt --timeout=25m -.PHONY: dependencies -dependencies: $(GOLANGCI_LINT_BIN) +.PHONY: gosec +gosec: $(GOSEC_BIN) + $(GOSEC_BIN) ./... $(GOLANGCI_LINT_BIN): - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(FIRST_GOPATH)/bin v1.32.2 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin + +$(GOSEC_BIN): + curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(FIRST_GOPATH)/bin v2.7.0