Skip to content

Commit

Permalink
cleanup build
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
  • Loading branch information
mblaschke committed Feb 8, 2022
1 parent 684f108 commit 80a9820
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 80a9820

Please sign in to comment.