Skip to content

Commit 94bb769

Browse files
authored
fix(build): Include Git version when using 'make build' (#1218)
Signed-off-by: James Alseth <james@jalseth.me>
1 parent bbbb04c commit 94bb769

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ COPY . .
1414

1515
## BUILDER STAGE ##
1616
FROM base AS builder
17-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o conftest -ldflags="-w -s -X github.com/open-policy-agent/conftest/internal/commands.version=${VERSION}" main.go
17+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o conftest -ldflags="-w -s -X github.com/open-policy-agent/conftest/internal/version.Version=${VERSION}" main.go
1818

1919
## TEST STAGE ##
2020
FROM base AS test

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TEST_DIRS := $(patsubst tests/%/, tests/%, $(dir $(wildcard tests/**/.)))
2727

2828
.PHONY: build
2929
build: ## Builds Conftest.
30-
@go build -ldflags="-X github.com/open-policy-agent/conftest/internal/commands.version=${GIT_VERSION}"
30+
@go build -ldflags="-X github.com/open-policy-agent/conftest/internal/version.Version=${GIT_VERSION}"
3131

3232
.PHONY: test
3333
test: ## Tests Conftest.

0 commit comments

Comments
 (0)