chore(Makefile): add GONOSUMDB and GOPROXY
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Markus Pesch 2025-02-02 18:24:43 +01:00
parent e6f4e1ea66
commit 4177d66ae6
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982

View File

@ -12,30 +12,49 @@ ls:
# Download dependencies
.PHONY: download
download:
go mod download
GONOSUMDB=${GONOSUMDB} \
GOPROXY=${GOPROXY} \
go mod download
# Update project dependencies
.PHONY: update
update:
go get -u
go mod download
go mod tidy
GONOSUMDB=${GONOSUMDB} \
GOPROXY=${GOPROXY} \
go get -u
GONOSUMDB=${GONOSUMDB} \
GOPROXY=${GOPROXY} \
go mod download
GONOSUMDB=${GONOSUMDB} \
GOPROXY=${GOPROXY} \
go mod tidy
# Run project tests
.PHONY: test
test: download
go test ./... -v -race
GONOSUMDB=${GONOSUMDB} \
GOPROXY=${GOPROXY} \
go test ./... -v -race
# Look for "suspicious constructs" in source code
.PHONY: vet
vet: download
go vet ./...
GONOSUMDB=${GONOSUMDB} \
GOPROXY=${GOPROXY} \
go vet ./...
# Format code
.PHONY: fmt
fmt: download
go mod tidy
go fmt ./...
GONOSUMDB=${GONOSUMDB} \
GOPROXY=${GOPROXY} \
go mod tidy
GONOSUMDB=${GONOSUMDB} \
GOPROXY=${GOPROXY} \
go fmt ./...
# Check for unformatted go code
.PHONY: check/fmt
@ -45,16 +64,19 @@ check/fmt: download
# Build project
.PHONY: build
build:
CGO_ENABLED=0 go build \
-ldflags "\
-X main.version=${shell git describe --tags} \
-X main.commit=${shell git rev-parse HEAD} \
-X main.date=${shell date --iso-8601=seconds} \
-X main.builtBy=manual \
" \
-trimpath \
-o ${EXECUTABLE} \
exporter.go
CGO_ENABLED=0
GONOSUMDB=${GONOSUMDB} \
GOPROXY=${GOPROXY} \
go build \
-ldflags "\
-X main.version=${shell git describe --tags} \
-X main.commit=${shell git rev-parse HEAD} \
-X main.date=${shell date --iso-8601=seconds} \
-X main.builtBy=manual \
" \
-trimpath \
-o ${EXECUTABLE} \
exporter.go
# build container-image
.PHONY: build/container-image