Fix package_cloud push of vpp-ext-deps
[ci-management.git] / jjb / scripts / vpp / make-test-docs.sh
1 #!/bin/bash
2
3 # Copyright (c) 2020 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:
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15
16 echo "---> jjb/scripts/vpp/make-test-docs.sh"
17
18 set -xe -o pipefail
19 [ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site"
20 [ "$PROJECT_PATH" ] || PROJECT_PATH=io/fd/vpp
21 [ "$DOC_DIR" ] || DOC_DIR=build-root/build-test/doc/html
22 [ "$SITE_DIR" ] || SITE_DIR=build-root/docs/deploy-site
23 [ "$RESOURCES_DIR" ] || RESOURCES_DIR=${SITE_DIR}/src/site/resources/vpp_make_test
24 [ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
25 [ "$VERSION" ] || VERSION=$(./build-root/scripts/version rpm-version)
26
27 make test-doc
28
29 if [[ ${JOB_NAME} == *merge* ]]; then
30   mkdir -p ${RESOURCES_DIR}
31   mv -f ${DOC_DIR} ${RESOURCES_DIR}
32   cd ${SITE_DIR}
33
34   cat > pom.xml << EOF
35   <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">
36     <modelVersion>4.0.0</modelVersion>
37     <groupId>io.fd.vpp</groupId>
38     <artifactId>docs</artifactId>
39     <version>1.0.0</version>
40     <packaging>pom</packaging>
41
42     <properties>
43       <generateReports>false</generateReports>
44     </properties>
45
46     <build>
47       <extensions>
48         <extension>
49           <groupId>org.apache.maven.wagon</groupId>
50            <artifactId>wagon-webdav-jackrabbit</artifactId>
51            <version>2.10</version>
52         </extension>
53       </extensions>
54     </build>
55     <distributionManagement>
56       <site>
57         <id>fdio-site</id>
58         <url>dav:${DOCS_REPO_URL}/${PROJECT_PATH}/${VERSION}</url>
59       </site>
60     </distributionManagement>
61   </project>
62 EOF
63   ${MVN} -B site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C
64   cd -
65 fi