|
1 | 1 | FROM python:3.13-alpine |
2 | 2 |
|
3 | 3 | # Runtime environment variables |
4 | | -ENV DESC="" |
5 | | -ENV SOURCE="" |
| 4 | +# ENV DESC="" |
| 5 | +# ENV SOURCE="" |
6 | 6 | ENV LOGFILE="/logs/logs.txt" |
7 | 7 | ENV DEPENDENCIES="" |
8 | 8 |
|
9 | | -RUN mkdir -p /logs |
10 | 9 |
|
11 | | -RUN echo "Setting up environment variables: DESC=$DESC, SOURCE=$SOURCE, LOGFILE=$LOGFILE, DEPENDENCIES=$DEPENDENCIES" >> $LOGFILE |
12 | 10 |
|
13 | | -# Install system dependencies |
14 | | -RUN apk add --no-cache gcc musl-dev |
| 11 | +CMD sh -c 'echo "Run unit tests with coverage" >> $LOGFILE' |
15 | 12 |
|
16 | | -# Install Poetry |
17 | | -RUN echo "Installing Poetry..." >> $LOGFILE |
18 | | -RUN pip install poetry==1.8.4 |
| 13 | +# RUN mkdir -p /logs |
19 | 14 |
|
20 | | -# Set workdir and copy dependency files first for caching |
21 | | -RUN echo "Setting up work directory and copying dependency files..." >> $LOGFILE |
22 | | -WORKDIR /app |
23 | | -COPY pyproject.toml poetry.lock ./ |
24 | | -RUN poetry install --no-root |
| 15 | +# RUN echo "CWD: $(pwd)" >> $LOGFILE |
| 16 | +# RUN echo ">>>>>>>>>>>>> Setting up environment variables: DESC=$DESC, SOURCE=$SOURCE, LOGFILE=$LOGFILE, DEPENDENCIES=$DEPENDENCIES" >> $LOGFILE |
25 | 17 |
|
26 | | -# Copy the rest of the code |
27 | | -COPY . . |
| 18 | +# # Install system dependencies |
| 19 | +# RUN apk add --no-cache gcc musl-dev |
28 | 20 |
|
29 | | -# Set PYTHONPATH for runtime |
30 | | -ENV PYTHONPATH=$SOURCE/src:$SOURCE/tests |
| 21 | +# # Install Poetry |
| 22 | +# RUN echo ">>>>>>>>>>>>> Installing Poetry..." >> $LOGFILE |
| 23 | +# RUN pip install poetry==1.8.4 |
31 | 24 |
|
32 | | -# Default command: install dependencies at runtime, then run tests |
33 | | -CMD sh -c 'if [ -n "$DEPENDENCIES" ]; then pip install $DEPENDENCIES; fi && \ |
34 | | - echo "Run unit tests with coverage" >> $LOGFILE && \ |
35 | | - poetry run coverage run --source=$SOURCE -m unittest discover -s $SOURCE || echo "$DESC tests failed" >> /logs/failed_tests.txt && \ |
36 | | - poetry run coverage xml -o /logs/sonarcloud-coverage-$DESC.xml' |
| 25 | +# # Set workdir and copy dependency files first for caching |
| 26 | +# RUN echo ">>>>>>>>>>>>> Setting up work directory and copying dependency files..." >> $LOGFILE |
| 27 | +# WORKDIR /app |
| 28 | +# COPY pyproject.toml poetry.lock ./ |
| 29 | +# RUN poetry install --no-root |
| 30 | + |
| 31 | +# # Copy the rest of the code |
| 32 | +# COPY . . |
| 33 | + |
| 34 | +# # Set PYTHONPATH for runtime |
| 35 | +# ENV PYTHONPATH=$SOURCE/src:$SOURCE/tests |
| 36 | + |
| 37 | +# # Default command: install dependencies at runtime, then run tests |
| 38 | +# CMD sh -c 'if [ -n "$DEPENDENCIES" ]; then pip install $DEPENDENCIES; fi && \ |
| 39 | +# echo "Run unit tests with coverage" >> $LOGFILE && \ |
| 40 | +# poetry run coverage run --source=$SOURCE -m unittest discover -s $SOURCE || echo "$DESC tests failed" >> /logs/failed_tests.txt && \ |
| 41 | +# poetry run coverage xml -o /logs/sonarcloud-coverage-$DESC.xml' |
0 commit comments