diff --git a/CI/create_documentation.sh b/CI/create_documentation.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c5db1279ddaaf0cb8c61074e4e2e0d3e762b449 --- /dev/null +++ b/CI/create_documentation.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# reset status +echo "failure" > status.txt + +# create webpage folder +BRANCH_NAME=$( echo -e "${CI_COMMIT_REF_NAME////_}") +mkdir -p webpage/ +mkdir -p webpage/recent +for w in master develop +do + if [[ "${CI_COMMIT_REF_NAME}" == "$w" ]]; then + mkdir -p "webpage/${BRANCH_NAME}" + fi +done + +cd docs || { + echo "no docs to build available"; + echo "incomplete" > status.txt; + echo "no docs to build avail" > incomplete.txt; + exit 0; } + +echo "${CI_COMMIT_TAG}" +make clean +make html +IS_FAILED=$? + +# copy results +cp -r ./_build/html/* "../webpage/${BRANCH_NAME}/." +cp -r ./_build/html/* ../webpage/recent/. +if [[ "${CI_COMMIT_REF_NAME}" = "master" ]]; then + cp -r ./_build/html/* ../webpage/. +fi +cd .. + +# report if job was successful +if [[ ${IS_FAILED} == 0 ]]; then + echo "success" + echo "success" > status.txt + echo "build" > success.txt + exit 0 +else + echo "failed" + exit 1 +fi