cp2k/tools/docker/Dockerfile.test_python
2022-05-25 15:28:39 +02:00

30 lines
773 B
Text

#
# This file was created by generate_dockerfiles.py.
# Usage: docker build -f ./Dockerfile.test_python ../../
#
FROM ubuntu:22.04
# Install dependencies.
WORKDIR /opt/cp2k
COPY ./tools/docker/scripts/install_python.sh .
RUN ./install_python.sh
# Install sources.
ARG GIT_COMMIT_SHA
COPY ./src ./src
COPY ./exts ./exts
COPY ./data ./data
COPY ./tools ./tools
COPY ./Makefile .
RUN bash -c "if [ -n "${GIT_COMMIT_SHA}" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi"
# Run test for python.
COPY ./tools/docker/scripts/test_python.sh .
RUN ./test_python.sh 2>&1 | tee report.log
# Output the report if the image is old and was therefore pulled from the build cache.
CMD cat $(find ./report.log -mmin +10) | sed '/^Summary:/ s/$/ (cached)/'
ENTRYPOINT []
#EOF