diff --git a/tools/docker/Dockerfile.test_manual b/tools/docker/Dockerfile.test_manual index 8b365fcdcc..28aa4baff3 100644 --- a/tools/docker/Dockerfile.test_manual +++ b/tools/docker/Dockerfile.test_manual @@ -82,7 +82,8 @@ COPY ./tools/regtesting ./tools/regtesting COPY ./tools/manual ./tools/manual COPY ./tools/input_editing ./tools/input_editing COPY ./tools/docker/scripts/test_manual.sh . -RUN ./test_manual.sh 2>&1 | tee report.log +ARG ADD_EDIT_LINKS=yes +RUN ./test_manual.sh "${ADD_EDIT_LINKS}" 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)/' diff --git a/tools/docker/generate_dockerfiles.py b/tools/docker/generate_dockerfiles.py index 78d77bddbe..cc1f240040 100755 --- a/tools/docker/generate_dockerfiles.py +++ b/tools/docker/generate_dockerfiles.py @@ -216,7 +216,8 @@ def manual() -> str: COPY ./tools/manual ./tools/manual COPY ./tools/input_editing ./tools/input_editing COPY ./tools/docker/scripts/test_manual.sh . -RUN ./test_manual.sh 2>&1 | tee report.log +ARG ADD_EDIT_LINKS=yes +RUN ./test_manual.sh "${{ADD_EDIT_LINKS}}" 2>&1 | tee report.log """ + print_cached_report() ) diff --git a/tools/docker/scripts/test_manual.sh b/tools/docker/scripts/test_manual.sh index 22fc987a29..82c5649d3f 100755 --- a/tools/docker/scripts/test_manual.sh +++ b/tools/docker/scripts/test_manual.sh @@ -2,6 +2,13 @@ # author: Ole Schuett +if (($# != 1)); then + echo "Usage: test_manual.sh " + exit 1 +fi + +ADD_EDIT_LINKS=$1 + # shellcheck disable=SC1091 source /opt/cp2k-toolchain/install/setup @@ -42,7 +49,7 @@ set +e # disable error trapping for remainder of script set -e # abort if error is encountered sed -i 's/\x0/?/g' cp2k_input.xml # replace null bytes which would crash saxon SAXON="java -jar /usr/share/java/Saxon-HE.jar" - $SAXON -o:index.html ./cp2k_input.xml ${TOOLS}/manual/cp2k_input.xsl add_edit_links=yes + $SAXON -o:index.html ./cp2k_input.xml ${TOOLS}/manual/cp2k_input.xsl add_edit_links="${ADD_EDIT_LINKS}" $SAXON -o:cp2k.vim ./cp2k_input.xml ${TOOLS}/input_editing/vim/vim.xsl ) EXIT_CODE=$?