Skip to content

Commit

Permalink
Taxtastic version setwith build-args
Browse files Browse the repository at this point in the history
  • Loading branch information
crosenth committed Aug 13, 2024
1 parent e1dab6f commit f813604
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# docker build --build-arg VERSION=something --tag taxtastic:latest .
FROM python:3.11-slim-bullseye

ENV PIP_ROOT_USER_ACTION=ignore
ARG VERSION=
ENV PIP_ROOT_USER_ACTION=ignore TAXTASTIC_VERSION=$VERSION

RUN apt-get -y update && apt-get upgrade -y && apt-get install -y unzip wget

WORKDIR /opt/build
COPY dev/install_pplacer.sh /opt/build/install_pplacer.sh

COPY dev/install_pplacer.sh ./
RUN /opt/build/install_pplacer.sh /usr/local

COPY setup.py MANIFEST.in README.rst requirements.txt /opt/build/
COPY taxtastic /opt/build/taxtastic/
RUN pip3 install --upgrade pip && pip3 install --requirement requirements.txt .
COPY setup.py MANIFEST.in README.rst ./
COPY taxtastic/ ./taxtastic/
RUN pip3 install --upgrade pip && pip3 install .

WORKDIR /opt/run
RUN mkdir -p /app /fh /mnt /run/shm
Expand Down
11 changes: 7 additions & 4 deletions taxtastic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from os import path
import os

try:
with open(path.join(path.dirname(__file__), 'data', 'ver')) as f:
ver = os.path.join(os.path.dirname(__file__), 'data', 'ver')
if 'TAXTASTIC_VERSION' in os.environ:
__version__ = os.environ['TAXTASTIC_VERSION']
elif os.path.isfile(ver):
with open(ver) as f:
__version__ = f.read().strip().replace('-', '+', 1).replace('-', '.')
__version__ = __version__.lstrip('v')
except Exception as e:
else:
__version__ = ''

0 comments on commit f813604

Please sign in to comment.