From e8c82f364f09fc9b760906c42ba5fb56a21c112f Mon Sep 17 00:00:00 2001 From: lukas leufen <l.leufen@fz-juelich.de> Date: Tue, 21 Apr 2020 13:32:48 +0200 Subject: [PATCH] add create documentation sh --- CI/create_documentation.sh | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 CI/create_documentation.sh diff --git a/CI/create_documentation.sh b/CI/create_documentation.sh new file mode 100644 index 00000000..2c5db127 --- /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 -- GitLab