Docker: User build context for all images

This commit is contained in:
Ole Schütt 2022-02-19 14:35:21 +01:00 committed by Ole Schütt
parent 75fc08f981
commit f2768158e7
64 changed files with 941 additions and 1155 deletions

View file

@ -5,16 +5,25 @@
FROM ubuntu:20.04
# Install test for python.
WORKDIR /workspace
COPY ./tools/docker/scripts/install_basics.sh .
RUN ./install_basics.sh
# Install dependencies.
WORKDIR /workspace/cp2k
COPY ./tools/docker/scripts/install_python.sh .
RUN ./install_python.sh
COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_python.sh ./
CMD ["./ci_entrypoint.sh", "./test_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 +3) | sed '/^Summary:/ s/$/ (cached)/'
#EOF