3 # Copyright (c) 2021 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 echo "---> jjb/scripts/vpp/sphinx-docs.sh"
20 line="*************************************************************************"
21 # Don't build anything if this is a merge job being run when
22 # the git HEAD id is not the same as the Gerrit New Revision id.
23 if [[ ${JOB_NAME} == *merge* ]] && [ -n "${GERRIT_NEWREV:-}" ] &&
24 [ "$GERRIT_NEWREV" != "$GIT_COMMIT" ] ; then
25 echo -e "\n$line\nSkipping sphinx docs build. A newer patch has been merged.\n$line\n"
29 DOCS_REPO_URL=${DOCS_REPO_URL:-"https://nexus.fd.io/content/sites/site"}
30 PROJECT_PATH=${PROJECT_PATH:-"io/fd/vpp"}
31 DOC_FILE=${DOC_FILE:-"vpp.docs.zip"}
32 DOC_DIR=${DOC_DIR:-"./docs/_build/html"}
33 SITE_DIR=${SITE_DIR:-"build-root/docs/deploy-site"}
34 RESOURCES_DIR=${RESOURCES_DIR:-"${SITE_DIR}/src/site/resources"}
35 MVN=${MVN:-"/opt/apache/maven/bin/mvn"}
36 VERSION=${VERSION:-"$(./build-root/scripts/version rpm-version)"}
39 CONFIRM=-y FORCE=--force-yes make docs
41 if [[ ${JOB_NAME} == *merge* ]]; then
42 mkdir -p $(dirname ${RESOURCES_DIR})
43 mv -f ${DOC_DIR} ${RESOURCES_DIR}
46 <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">
47 <modelVersion>4.0.0</modelVersion>
48 <groupId>io.fd.vpp</groupId>
49 <artifactId>docs</artifactId>
50 <version>1.0.0</version>
51 <packaging>pom</packaging>
54 <generateReports>false</generateReports>
60 <groupId>org.apache.maven.wagon</groupId>
61 <artifactId>wagon-webdav-jackrabbit</artifactId>
62 <version>2.10</version>
66 <distributionManagement>
69 <url>dav:${DOCS_REPO_URL}/${PROJECT_PATH}/v${VERSION}</url>
71 </distributionManagement>
74 ${MVN} -B site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C