Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@ COPY --chown=gen3:gen3 ./deployment/wsgi/wsgi.py /${appname}/wsgi.py
# install the app
RUN poetry install --without dev --no-interaction

RUN git config --global --add safe.directory ${appname} && COMMIT=`git rev-parse HEAD` && echo "COMMIT=\"${COMMIT}\"" > ${appname}/version_data.py \
&& VERSION=`git describe --always --tags` && echo "VERSION=\"${VERSION}\"" >> ${appname}/version_data.py
RUN echo "Latest tags (sorted by date):" && git tag --contains HEAD --sort=-taggerdate
RUN echo "Git describe tags:" && git describe --always --tags
RUN VERSION=$(git tag --contains HEAD --sort=-taggerdate | head -n 1) && if [ -z "$VERSION" ]; then \
echo "Tag command failed or returned empty. Falling back to git describe."; \
VERSION=$(git describe --always --tags); \
echo "Using git describe VERSION: $VERSION"; \
else \
echo "Successfully found tag, VERSION: $VERSION"; \
fi && git config --global --add safe.directory ${appname} && COMMIT=`git rev-parse HEAD` && echo "COMMIT=\"${COMMIT}\"" > ${appname}/version_data.py \
&& echo "VERSION=\"${VERSION}\"" >> ${appname}/version_data.py

# Final stage
FROM base
Expand Down
Loading