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