version id
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Wolfgang Hottgenroth 2024-02-01 09:48:54 +01:00
parent fd3e8751fe
commit 4dbc156439
3 changed files with 10 additions and 2 deletions

View File

@ -10,6 +10,9 @@ steps:
from_secret: container_registry_username from_secret: container_registry_username
password: password:
from_secret: container_registry_password from_secret: container_registry_password
build_args:
- VERSION_ID1=${CI_COMMIT_SHA}
- VERSION_ID2=${CI_COMMIT_TAG}
dockerfile: Dockerfile dockerfile: Dockerfile
when: when:
- event: [push, tag] - event: [push, tag]

View File

@ -1,6 +1,8 @@
FROM python:3.12-alpine3.19 FROM python:3.12-alpine3.19
ARG APP_DIR="/opt/app" ARG APP_DIR="/opt/app"
ARG VERSION_ID1="x"
ARG VERSION_ID2="alpha"
COPY ./src/ ${APP_DIR}/ COPY ./src/ ${APP_DIR}/
COPY start.sh ${APP_DIR}/ COPY start.sh ${APP_DIR}/
@ -9,7 +11,9 @@ WORKDIR ${APP_DIR}
RUN \ RUN \
apk add --no-cache build-base libpq-dev && \ 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 EXPOSE 8080

View File

@ -177,6 +177,7 @@ function updateTotalNutrition() {
<nav id="navbar"> <nav id="navbar">
<h1>Elo's Rezept Rechner</h1> <h1>Elo's Rezept Rechner</h1>
<ul> <ul>
<li class="versionid">VERSION_ID1 - VERSION_ID2</li>
<li><a href="/" class="active">Rechner</a></li> <li><a href="/" class="active">Rechner</a></li>
<li><a href="/nutrition">Neue Lebensmittel</a></li> <li><a href="/nutrition">Neue Lebensmittel</a></li>
</ul> </ul>
@ -232,4 +233,4 @@ function updateTotalNutrition() {
</table> </table>
</div> </div>
</body> </body>
</html> </html>