Skip to content

Commit d54b137

Browse files
authored
fix: Try again to get version into generated image (#248)
My last attempt didn't work on cloudbuild.
1 parent 37b59e0 commit d54b137

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Dockerfile

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ RUN apt-get install -y cmake pkg-config libssl-dev librdkafka-dev protobuf-compi
99
RUN USER=root cargo new --bin taskbroker
1010
WORKDIR /taskbroker
1111

12-
ARG config_file=config-sentry-dev.yaml
12+
# This is set by the cloudbuild.yaml file
13+
ARG TASKBROKER_GIT_REVISION
14+
ARG CONFIG_FILE=config-sentry-dev.yaml
15+
16+
ENV TASKBROKER_VERSION=$TASKBROKER_GIT_REVISION
1317

1418
# All these files are required to build or run the application
1519
COPY ./Cargo.lock ./Cargo.lock
1620
COPY ./Cargo.toml ./Cargo.toml
1721
COPY ./migrations ./migrations
18-
COPY ./config/${config_file} ./config.yaml
22+
COPY ./config/${CONFIG_FILE} ./config.yaml
1923
COPY ./benches ./benches
2024

21-
# This is set by the cloudbuild.yaml file
22-
ARG TASKBROKER_GIT_REVISION=""
23-
ENV TASKBROKER_GIT_REVISION=${TASKBROKER_GIT_REVISION}
24-
2525
# Build dependencies in a way they can be cached
2626
RUN cargo build --release
2727
RUN rm src/*.rs
@@ -33,7 +33,7 @@ COPY ./src ./src
3333
RUN rm ./target/release/deps/taskbroker*
3434
RUN cargo build --release
3535

36-
RUN echo "${TASKBROKER_GIT_REVISION}" > ./VERSION
36+
RUN echo "${TASKBROKER_VERSION}" > ./VERSION
3737

3838
# Runtime image
3939
FROM rust:1-bookworm

0 commit comments

Comments
 (0)