File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ WORKDIR /go/src/github.com/webdevops/pagerduty-exporter
1111# Compile
1212COPY . .
1313RUN make test
14- RUN make build # warmup
1514ARG TARGETOS TARGETARCH
1615RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build
1716
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ GIT_TAG := $(shell git describe --dirty --tags --always)
33GIT_COMMIT := $(shell git rev-parse --short HEAD)
44BUILD_DATE := $(shell TZ=UTC date '+% Y-% m-% dT% H:% M:% SZ')
55LDFLAGS := -X "main.gitTag=$(GIT_TAG ) " -X "main.gitCommit=$(GIT_COMMIT ) " -X "main.buildDate=$(BUILD_DATE ) " -extldflags "-static" -s -w
6+ BUILDFLAGS := -trimpath
67
78FIRST_GOPATH := $(firstword $(subst :, ,$(shell go env GOPATH) ) )
89GOLANGCI_LINT_BIN := $(FIRST_GOPATH ) /bin/golangci-lint
@@ -26,13 +27,13 @@ vendor:
2627
2728.PHONY : build-all
2829build-all :
29- GOOS=linux GOARCH=${GOARCH} CGO_ENABLED=0 go build -ldflags ' $(LDFLAGS)' -o ' $(PROJECT_NAME)' .
30- GOOS=darwin GOARCH=${GOARCH} CGO_ENABLED=0 go build -ldflags ' $(LDFLAGS)' -o ' $(PROJECT_NAME).darwin' .
31- GOOS=windows GOARCH=${GOARCH} CGO_ENABLED=0 go build -ldflags ' $(LDFLAGS)' -o ' $(PROJECT_NAME).exe' .
30+ GOOS=linux GOARCH=${GOARCH} CGO_ENABLED=0 go build -ldflags ' $(LDFLAGS)' $( BUILDFLAGS ) -o ' $(PROJECT_NAME)' .
31+ GOOS=darwin GOARCH=${GOARCH} CGO_ENABLED=0 go build -ldflags ' $(LDFLAGS)' $( BUILDFLAGS ) -o ' $(PROJECT_NAME).darwin' .
32+ GOOS=windows GOARCH=${GOARCH} CGO_ENABLED=0 go build -ldflags ' $(LDFLAGS)' $( BUILDFLAGS ) -o ' $(PROJECT_NAME).exe' .
3233
3334.PHONY : build
3435build :
35- GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=0 go build -ldflags ' $(LDFLAGS)' -o $(PROJECT_NAME ) .
36+ GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=0 go build -ldflags ' $(LDFLAGS)' $( BUILDFLAGS ) -o $(PROJECT_NAME ) .
3637
3738.PHONY : image
3839image : image
You can’t perform that action at this time.
0 commit comments