2022-02-02 22:58:19 +01:00
|
|
|
#
|
|
|
|
|
# This file was created by generate_dockerfiles.py.
|
|
|
|
|
# Usage: docker build -f ./Dockerfile.test_python ../../
|
|
|
|
|
#
|
2018-11-08 13:56:15 +01:00
|
|
|
|
2022-05-11 10:10:44 +02:00
|
|
|
FROM ubuntu:22.04
|
2018-11-08 13:56:15 +01:00
|
|
|
|
2022-02-19 14:35:21 +01:00
|
|
|
# Install dependencies.
|
2022-03-11 12:33:27 +01:00
|
|
|
WORKDIR /opt/cp2k
|
2022-02-02 22:58:19 +01:00
|
|
|
COPY ./tools/docker/scripts/install_python.sh .
|
2018-11-08 13:56:15 +01:00
|
|
|
RUN ./install_python.sh
|
|
|
|
|
|
2022-02-19 14:35:21 +01:00
|
|
|
# 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.
|
2022-02-25 11:04:11 +01:00
|
|
|
CMD cat $(find ./report.log -mmin +10) | sed '/^Summary:/ s/$/ (cached)/'
|
2022-05-24 00:41:10 +02:00
|
|
|
ENTRYPOINT []
|
2018-11-08 13:56:15 +01:00
|
|
|
|
2020-08-10 11:50:46 +02:00
|
|
|
#EOF
|