Skip to content

Commit

Permalink
Makefile: use release-info from go-bits
Browse files Browse the repository at this point in the history
  • Loading branch information
talal committed Nov 26, 2021
1 parent ca36d01 commit c7c1cfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ test/bin:
build/cover.out: test/bin

build/release-info: CHANGELOG.md | build
go run $(GO_BUILDFLAGS) tools/releaseinfo.go $< $(shell git describe --tags --abbrev=0) > $@
go install github.com/sapcc/go-bits/tools/release-info@latest
release-info $< $(shell git describe --tags --abbrev=0) > $@

build-all: build/absent-metrics-operator

GO_BUILDFLAGS = -mod vendor
GO_LDFLAGS = -X main.version=$(VERSION) -X main.commit=$(COMMIT_HASH) -X main.date=$(BUILD_DATE)
GO_TESTENV =
GO_TESTENV =

build/absent-metrics-operator: FORCE
go build $(GO_BUILDFLAGS) -ldflags '-s -w $(GO_LDFLAGS)' -o build/absent-metrics-operator .
Expand All @@ -62,7 +63,7 @@ check: build-all static-check build/cover.html FORCE
@printf "\e[1;32m>> All checks successful.\e[0m\n"

static-check: FORCE
@command -v golangci-lint >/dev/null 2>&1 || { echo >&2 "Error: golangci-lint is not installed. See: https://golangci-lint.run/usage/install/"; exit 1; }
@if ! hash golangci-lint 2>/dev/null; then printf "\e[1;36m>> Installing golangci-lint...\e[0m\n"; curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin; fi
@printf "\e[1;36m>> golangci-lint\e[0m\n"
@golangci-lint run

Expand Down
6 changes: 2 additions & 4 deletions Makefile.maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ binaries:
vendoring:
enabled: true

staticCheck:
golangciLint: true

# Do not auto generate CI workflow as we use a custom version of it.
githubWorkflows:
global:
Expand Down Expand Up @@ -40,4 +37,5 @@ verbatim: |
build/cover.out: test/bin
build/release-info: CHANGELOG.md | build
go run $(GO_BUILDFLAGS) tools/releaseinfo.go $< $(shell git describe --tags --abbrev=0) > $@
go install github.com/sapcc/go-bits/tools/release-info@latest
release-info $< $(shell git describe --tags --abbrev=0) > $@

0 comments on commit c7c1cfc

Please sign in to comment.