#!/bin/bash set -xe -o pipefail update_cmake_repo() { cat /etc/resolv.conf echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf cat /etc/resolv.conf CMAKE_INSTALL_SCRIPT_URL="https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.sh" CMAKE_INSTALL_SCRIPT="/tmp/install_cmake.sh" curl ${CMAKE_INSTALL_SCRIPT_URL} > ${CMAKE_INSTALL_SCRIPT} sudo mkdir -p /opt/cmake sudo bash ${CMAKE_INSTALL_SCRIPT} --skip-license --prefix=/opt/cmake export PATH=/opt/cmake/bin:$PATH } cd libparc [ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site" [ "$PROJECT_PATH" ] || PROJECT_PATH="io/fd/cicn/libparc" [ "$DOC_FILE" ] || DOC_FILE="cicn.libparc.docs.zip" [ "$DOC_DIR" ] || DOC_DIR="build/documentation/generated-documentation/html" [ "$SITE_DIR" ] || SITE_DIR="build/documentation/deploy-site/" [ "$RESOURCES_DIR" ] || RESOURCES_DIR=${SITE_DIR}/src/site/resources [ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn" [ "$VERSION" ] || VERSION=$(bash scripts/version rpm-version) echo "Current directory: $(pwd)" update_cmake_repo mkdir -p build pushd build cmake -DDOC_ONLY=ON .. make documentation popd if [[ ${JOB_NAME} == *merge* ]]; then mkdir -p $(dirname ${RESOURCES_DIR}) mv -f ${DOC_DIR} ${RESOURCES_DIR} cd ${SITE_DIR} find . -type f '(' -name '*.md5' -o -name '*.dot' -o -name '*.map' ')' -delete cat > pom.xml << EOF 4.0.0 io.fd.vpp docs 1.0.0 pom false org.apache.maven.wagon wagon-webdav-jackrabbit 3.3.3 fdio-site dav:${DOCS_REPO_URL}/${PROJECT_PATH}/${VERSION} EOF ${MVN} site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C cd - fi