8b60d33a3b71cd043a180d933c453067e51c20d4
[ci-management.git] / jjb / vpp / include-raw-vpp-docs.sh
1 #!/bin/bash
2 set -xe -o pipefail
3 [ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site/"
4 [ "$PROJECT_PATH" ] || PROJECT_PATH=io/fd/vpp
5 [ "$DOC_FILE" ] || DOC_FILE=vpp.docs.zip
6 [ "$DOC_DIR" ] || DOC_DIR=build-root/docs/html
7 if [ "${GERRIT_BRANCH}" == "stable/1609" ]; then
8   VERSION=16.09
9 else
10   echo "************************************"
11   echo "* ${GERRIT_BRANCH} does not publish docs  *"
12   echo "************************************"
13   exit
14 fi
15 MVN="/opt/apache/maven/bin/mvn"
16
17 sudo apt-get install -y zip
18
19 make doxygen
20 cd ${DOC_DIR}
21 zip -r ${DOC_FILE} *
22 cat pom.xml << EOF
23 <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">
24   <modelVersion>4.0.0</modelVersion>
25   <groupId>io.fd.vpp</groupId>
26   <artifactId>docs</artifactId>
27   <version>1.0.0</version>
28   <packaging>pom</packaging>
29   <build>
30     <plugins>
31       <plugin>
32         <groupId>org.apache.maven.plugins</groupId>
33         <artifactId>maven-deploy-plugin</artifactId>
34         <version>2.8.2</version>
35         <configuration>
36           <skip>true</skip>
37         </configuration>
38       </plugin>
39       <plugin>
40         <groupId>org.sonatype.plugins</groupId>
41         <artifactId>maven-upload-plugin</artifactId>
42         <version>0.0.1</version>
43         <executions>
44           <execution>
45             <id>publish-site</id>
46             <phase>deploy</phase>
47             <goals>
48               <goal>upload-file</goal>
49             </goals>
50             <configuration>
51               <serverId>opendaylight-log-archives</serverId>
52               <repositoryUrl>$DOCS_REPO_URL/content-compressed</repositoryUrl>
53               <file>${DOC_FILE}</file>
54               <repositoryPath>${PROJECT_PATH}/${VERSION}</repositoryPath>
55             </configuration>
56           </execution>
57         </executions>
58       </plugin>
59     </plugins>
60   </build>
61 </project>
62 EOF
63 ${MVN} deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}"
64 cd -
65