diff --git a/.woodpecker.yml b/.woodpecker.yml index 853827a..3274f69 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -10,6 +10,9 @@ steps: from_secret: container_registry_username password: from_secret: container_registry_password + build_args: + - VERSION_ID1=${CI_COMMIT_SHA} + - VERSION_ID2=${CI_COMMIT_TAG} dockerfile: Dockerfile when: - event: [push, tag] diff --git a/Dockerfile b/Dockerfile index 23a5925..bb0132a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ FROM python:3.12-alpine3.19 ARG APP_DIR="/opt/app" +ARG VERSION_ID1="x" +ARG VERSION_ID2="alpha" COPY ./src/ ${APP_DIR}/ COPY start.sh ${APP_DIR}/ @@ -9,7 +11,9 @@ WORKDIR ${APP_DIR} RUN \ apk add --no-cache build-base libpq-dev && \ - pip install -r requirements.txt + pip install -r requirements.txt && \ + sed -i -e 's/VERSION_ID1/'$VERSION_ID1'/' ${APP_DIR}/templates/index.html && \ + sed -i -e 's/VERSION_ID2/'$VERSION_ID2'/' ${APP_DIR}/templates/index.html EXPOSE 8080 diff --git a/src/templates/index.html b/src/templates/index.html index ad55e19..345412d 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -177,6 +177,7 @@ function updateTotalNutrition() {