Skip to content

Commit c70a113

Browse files
committed
💚 Fix version/commit injection
1 parent 6b77d76 commit c70a113

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.gitlab-ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
--opt build-arg:VERSION=$1 \
2626
--opt build-arg:COMMIT=$CI_COMMIT_SHA \
2727
--output type=image,name=$CI_REGISTRY_IMAGE:$1,push=true
28+
29+
buildctl-daemonless.sh build \
30+
--frontend=dockerfile.v0 \
31+
--local context=. \
32+
--local dockerfile=. \
33+
--opt build-arg:VERSION=$1 \
34+
--opt build-arg:COMMIT=$CI_COMMIT_SHA \
35+
--output type=image,name=$CI_REGISTRY_IMAGE:latest,push=true
2836
}
2937
3038
deploy:

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ RUN go mod download
1818
COPY . .
1919

2020
ARG VERSION=dev
21+
ARG COMMIT=unknown
2122

2223
# Build the Go application
2324
RUN go build --ldflags "-X 'main.Version=$VERSION' -X 'main.Commit=$COMMIT'" -o automirror .

0 commit comments

Comments
 (0)