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