Skip to content

Commit

Permalink
docker: add git revision to version during docker build
Browse files Browse the repository at this point in the history
Using a "local version identifier" per PEP 440,
the version looks like: 1.3.0+d7abeb3

PEP for reference: https://peps.python.org/pep-0440/

This will help distinguish ETL builds from each other while we still
build directly from git.
  • Loading branch information
mikix committed Sep 24, 2024
1 parent d7abeb3 commit 665fd9b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ RUN pip3 install nltk
RUN python3 -m nltk.downloader -d /usr/local/share/nltk_data averaged_perceptron_tagger

COPY . /app
RUN sed -i "s/\(__version__.*\)\"/\1+`git -C /app rev-parse --short HEAD`\"/" /app/cumulus_etl/__init__.py
RUN --mount=type=cache,target=/root/.cache \
pip3 install /app
RUN rm -r /app
Expand Down

0 comments on commit 665fd9b

Please sign in to comment.