refactor: store version in constants

This commit is contained in:
Stavros
2025-05-20 16:39:27 +03:00
parent 415eea6fab
commit 91e3bbc9d9
9 changed files with 122 additions and 56 deletions

View File

@@ -1,3 +1,8 @@
# Arguments
ARG VERSION
ARG COMMIT_HASH
ARG BUILD_TIMESTAMP
# Site builder
FROM oven/bun:1.2.12-alpine AS frontend-builder
@@ -35,8 +40,8 @@ COPY ./cmd ./cmd
COPY ./internal ./internal
COPY --from=frontend-builder /frontend/dist ./internal/assets/dist
RUN CGO_ENABLED=0 go build -ldflags "-s -w"
RUN go build -ldflags "-s -w -X tinyauth/internal/constants.Version=${VERSION} -X tinyauth/internal/constants.CommitHash=${COMMIT_HASH} -X tinyauth/internal/constants.BuildTimestamp=${BUILD_TIMESTAMP}"
# Runner
FROM alpine:3.21 AS runner