From cfdaf954d5a2dd285561c73a499db95ebc3e6821 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 7 Jul 2025 14:16:08 -0500 Subject: [PATCH] fix parser version check --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index adfeeff..3956956 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,9 @@ RUN mix local.hex --force && mix local.rebar --force # Set build environment ENV MIX_ENV="prod" -ENV PARSER_GIT_HASH="unknown" + +# Capture APRS parser git hash from GitHub API during build +RUN curl -s https://api.github.com/repos/aprsme/aprs/commits/main | grep -o '"sha":"[^\"]*"' | head -1 | cut -d'"' -f4 | cut -c1-7 > /tmp/parser_hash.txt # Install dependencies COPY mix.exs mix.lock ./ @@ -62,6 +64,12 @@ RUN mkdir -p /app # Set deployment timestamp to current time during runtime container build RUN date -u +"%Y-%m-%dT%H:%M:%SZ" > /app/deployed_at.txt +# Copy parser hash from builder stage +COPY --from=builder /tmp/parser_hash.txt /app/parser_hash.txt + +# Set parser git hash environment variable for runtime +ENV PARSER_GIT_HASH=$(cat /app/parser_hash.txt) + # Copy release from builder COPY --from=builder --chown=nobody:root /app/release ./