fix: report actual version instead of hardcoded 3.0.0-dev
- Add version variable to main.go, set via -X ldflags at build time - Pass version through to Server, used in the / endpoint response - Makefile passes VERSION from git describe - Dockerfile accepts VERSION build arg - Woodpecker passes CI_COMMIT_TAG as VERSION
This commit is contained in:
+2
-1
@@ -9,7 +9,8 @@ RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o artifactapi ./cmd/artifactapi
|
||||
ARG VERSION=dev
|
||||
RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=${VERSION}" -o artifactapi ./cmd/artifactapi
|
||||
|
||||
FROM gcr.io/distroless/static-debian12:nonroot
|
||||
|
||||
|
||||
Reference in New Issue
Block a user