include-raw-nsh_sfc-docs.sh revision c4b5febc
1#!/bin/bash
2set -xe -o pipefail
3[ "$PROJECT_NAME" ] || PROJECT_NAME="nsh_sfc"
4[ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site"
5[ "$PROJECT_PATH" ] || PROJECT_PATH=io/fd/${PROJECT_NAME}
6[ "$DOC_DIR" ] || DOC_DIR=build-root/docs/html
7[ "$SITE_DIR" ] || SITE_DIR=build-root/docs/deploy-site/
8[ "$RESOURCES_DIR" ] || RESOURCES_DIR=${SITE_DIR}/src/site/resources
9[ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
10[ "$VERSION" ] || VERSION=$(./nsh-plugin/packaging/scripts/version)
11
12make doxygen
13if [[ ${JOB_NAME} == *merge* ]]; then
14  mkdir -p $(dirname ${RESOURCES_DIR})
15  mv -f ${DOC_DIR} ${RESOURCES_DIR}
16  cd ${SITE_DIR}
17  find . -type f '(' -name '*.md5' -o -name '*.dot' -o -name '*.map' ')' -delete
18  cat > pom.xml << EOF
19  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20    <modelVersion>4.0.0</modelVersion>
21    <groupId>io.fd.${PROJECT_NAME}</groupId>
22    <artifactId>docs</artifactId>
23    <version>1.0.0</version>
24    <packaging>pom</packaging>
25
26    <properties>
27      <generateReports>false</generateReports>
28    </properties>
29
30    <build>
31      <extensions>
32        <extension>
33          <groupId>org.apache.maven.wagon</groupId>
34           <artifactId>wagon-webdav-jackrabbit</artifactId>
35           <version>2.9</version>
36        </extension>
37      </extensions>
38    </build>
39    <distributionManagement>
40      <site>
41        <id>fdio-site</id>
42        <url>dav:${DOCS_REPO_URL}/${PROJECT_PATH}/${VERSION}</url>
43      </site>
44    </distributionManagement>
45  </project>
46  EOF
47  ${MVN} site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C
48  cd -
49fi
50