Add python-pyparsing and correct version
[ci-management.git] / jjb / vpp / include-raw-vpp-docs.sh
index 4f60b01..e721d38 100644 (file)
@@ -1,65 +1,50 @@
 #!/bin/bash
 set -xe -o pipefail
-[ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site/"
+[ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site"
 [ "$PROJECT_PATH" ] || PROJECT_PATH=io/fd/vpp
 [ "$DOC_FILE" ] || DOC_FILE=vpp.docs.zip
 [ "$DOC_DIR" ] || DOC_DIR=build-root/docs/html
-if [ "${GERRIT_BRANCH}" == "stable/1609" ]; then
-  VERSION=16.09
-else
-  echo "************************************"
-  echo "* ${GERRIT_BRANCH} does not publish docs  *"
-  echo "************************************"
-  exit
-fi
-MVN="/opt/apache/maven/bin/mvn"
+[ "$SITE_DIR" ] || SITE_DIR=build-root/docs/deploy-site/
+[ "$RESOURCES_DIR" ] || RESOURCES_DIR=${SITE_DIR}/src/site/resources
+[ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
 
-sudo apt-get install -y zip
+[ "$VERSION" ] || VERSION=$(./build-root/scripts/version rpm-version)
+
+sudo apt-get -y install python-pyparsing
 
 make doxygen
-cd ${DOC_DIR}
-zip ${DOC_FILE} .
-cat pom.xml << EOF
+mkdir -p $(dirname ${RESOURCES_DIR})
+mv -f ${DOC_DIR} ${RESOURCES_DIR}
+cd ${SITE_DIR}
+find . -type f '(' -name '*.md5' -o -name '*.dot' -o -name '*.map' ')' -delete
+cat > pom.xml << EOF
 <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">
   <modelVersion>4.0.0</modelVersion>
   <groupId>io.fd.vpp</groupId>
   <artifactId>docs</artifactId>
   <version>1.0.0</version>
   <packaging>pom</packaging>
+
+  <properties>
+    <generateReports>false</generateReports>
+  </properties>
+
   <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.8.2</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.sonatype.plugins</groupId>
-        <artifactId>maven-upload-plugin</artifactId>
-        <version>0.0.1</version>
-        <executions>
-          <execution>
-            <id>publish-site</id>
-            <phase>deploy</phase>
-            <goals>
-              <goal>upload-file</goal>
-            </goals>
-            <configuration>
-              <serverId>opendaylight-log-archives</serverId>
-              <repositoryUrl>$DOCS_REPO_URL/content-compressed</repositoryUrl>
-              <file>${DOC_FILE}</file>
-              <repositoryPath>${PROJECT_PATH}/${VERSION}</repositoryPath>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.wagon</groupId>
+         <artifactId>wagon-webdav-jackrabbit</artifactId>
+         <version>2.9</version>
+      </extension>
+    </extensions>
   </build>
+  <distributionManagement>
+    <site>
+      <id>fdio-site</id>
+      <url>dav:${DOCS_REPO_URL}/site/${PROJECT_PATH}/${VERSION}</url>
+    </site>
+  </distributionManagement>
 </project>
 EOF
-${MVN} deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}"
+${MVN} site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C
 cd -
-