cp2k/tools/docker/scripts/test_manual.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

67 lines
1.7 KiB
Bash
Raw Permalink Normal View History

2018-11-08 13:56:15 +01:00
#!/bin/bash -e
# author: Ole Schuett
# shellcheck disable=SC1091
source /opt/cp2k-toolchain/install/setup
echo -e "\n========== Installing Dependencies =========="
apt-get update -qq
2023-08-01 12:17:57 +02:00
apt-get install -qq --no-install-recommends \
default-jre-headless \
libsaxonhe-java \
python3 \
2024-04-30 21:46:47 +02:00
python3-pip \
python3-venv
rm -rf /var/lib/apt/lists/*
2024-04-30 21:46:47 +02:00
# Create and activate a virtual environment for Python packages.
python3 -m venv /opt/venv
export PATH="/opt/venv/bin:$PATH"
# install python packages
2024-06-30 21:54:37 +02:00
pip3 install -r /opt/cp2k/docs/requirements.txt
2023-06-06 22:20:50 +02:00
2018-11-08 13:56:15 +01:00
echo -e "\n========== Generating Manual =========="
mkdir -p /workspace/artifacts/manual
cd /workspace/artifacts/manual
2026-04-18 21:57:16 +02:00
/opt/cp2k/build/bin/cp2k.pdbg --version
/opt/cp2k/build/bin/cp2k.pdbg --xml
2018-11-08 13:56:15 +01:00
set +e # disable error trapping for remainder of script
2023-06-06 22:20:50 +02:00
(
set -e # abort if error is encountered
/opt/cp2k/docs/generate_input_reference.py ./cp2k_input.xml
2023-06-06 22:20:50 +02:00
echo ""
2023-07-31 12:49:21 +02:00
sphinx-build /opt/cp2k/docs/ /workspace/artifacts/manual -W -n --keep-going --jobs 16
2023-09-10 16:32:04 +02:00
/opt/cp2k/docs/fix_github_links.py /workspace/artifacts/manual
rm -rf /workspace/artifacts/manual/.doctrees
2023-06-06 22:20:50 +02:00
)
EXIT_CODE=$?
2021-02-17 17:02:43 +01:00
if ((EXIT_CODE)); then
2023-06-06 22:20:50 +02:00
echo -e "\nSummary: Sphinx build failed"
echo -e "Status: FAILED\n"
2023-06-06 22:20:50 +02:00
exit
2018-11-08 13:56:15 +01:00
fi
2023-08-01 12:17:57 +02:00
echo -e "\n========== Generating VIM Plugin =========="
(
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:cp2k.vim ./cp2k_input.xml /opt/cp2k/tools/input_editing/vim/vim.xsl
)
EXIT_CODE=$?
if ((EXIT_CODE)); then
echo -e "\nSummary: Saxon run failed."
echo -e "Status: FAILED\n"
exit
fi
2023-06-06 22:20:50 +02:00
echo -e "\nSummary: Manual generation works fine."
echo -e "Status: OK\n"
2018-11-08 13:56:15 +01:00
#EOF