#!/bin/bash set -xe -o pipefail [ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site" [ "$PROJECT_PATH" ] || PROJECT_PATH=io/fd/csit [ "$DOC_FILE" ] || DOC_FILE=csit.docs.tar.gz [ "$DOC_DIR" ] || DOC_DIR=resources/tools/doc_gen [ "$SITE_DIR" ] || SITE_DIR=${DOC_DIR}/_build [ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn" cd ${DOC_DIR} chmod +x ./run_doc.sh ./run_doc.sh retval=$? if [ ${retval} -ne "0" ]; then echo "Documentation generation failed!" exit ${retval} fi if [[ ${JOB_NAME} == *merge* ]]; then cd ${SITE_DIR} cat > pom.xml << EOF 4.0.0 io.fd.csit docs 1.0.0 pom false org.apache.maven.wagon wagon-webdav-jackrabbit 2.9 fdio-site dav:${DOCS_REPO_URL}/${PROJECT_PATH}/${STREAM} EOF ${MVN} site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C cd - fi