diff --git a/Dockerfile b/Dockerfile index 3d5a557..c2b1ceb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,10 @@ FROM jdxcode/mise:latest AS build ARG VERSION=development -ARG COMMIT=development +ARG COMMIT_SHA=development ENV VERSION=${VERSION} -ENV COMMIT_SHA=${COMMIT} +ENV COMMIT_SHA=${COMMIT_SHA} WORKDIR /app @@ -34,6 +34,9 @@ RUN --mount=type=cache,target=${GOCACHE} \ RUN bun install --frozen-lockfile +# Verify environment variables +RUN echo "VERSION=${VERSION}" && echo "COMMIT_SHA=${COMMIT_SHA}" + # Copy the rest of the source code COPY . . RUN --mount=type=cache,target=${GOCACHE} ~/bin/task core:release:docker diff --git a/core/Taskfile.yaml b/core/Taskfile.yaml index 3175c37..fdb5559 100644 --- a/core/Taskfile.yaml +++ b/core/Taskfile.yaml @@ -91,6 +91,7 @@ tasks: # Centralise Docker release command into here for simpler maintenance instead of specifying # within Dockerfile release:docker: + deps: [generate] cmds: - go build -o ./bin/main -ldflags "-s -w -X main.Version=$VERSION -X main.Commit=$COMMIT_SHA" -trimpath -tags "no_duckdb_arrow" ./cmd/ - chmod +x ./bin/main @@ -99,6 +100,7 @@ tasks: CGO_ENABLED: "1" release:linux:amd64: + deps: [generate] cmds: - go build -o ./bin/medama_linux_amd64 -ldflags "-s -w -X main.Version=$VERSION -X main.Commit=$COMMIT_SHA" -trimpath -tags "no_duckdb_arrow" ./cmd/ - chmod +x ./bin/medama_linux_amd64 @@ -109,6 +111,7 @@ tasks: GOARCH: "amd64" release:linux:arm64: + deps: [generate] cmds: - go build -o ./bin/medama_linux_arm64 -ldflags "-s -w -X main.Version=$VERSION -X main.Commit=$COMMIT_SHA" -trimpath -tags "no_duckdb_arrow" ./cmd/ - chmod +x ./bin/medama_linux_arm64 @@ -121,6 +124,7 @@ tasks: GOARCH: "arm64" release:darwin:amd64: + deps: [generate] cmds: - go build -o ./bin/medama_darwin_amd64 -ldflags "-s -w -X main.Version=$VERSION -X main.Commit=$COMMIT_SHA" -trimpath -tags "no_duckdb_arrow" ./cmd/ - chmod +x ./bin/medama_darwin_amd64 @@ -131,6 +135,7 @@ tasks: GOARCH: "amd64" release:darwin:arm64: + deps: [generate] cmds: - go build -o ./bin/medama_darwin_arm64 -ldflags "-s -w -X main.Version=$VERSION -X main.Commit=$COMMIT_SHA" -trimpath -tags "no_duckdb_arrow" ./cmd/ - chmod +x ./bin/medama_darwin_arm64