fixes for cicn documentations: 89/10789/3
authorLuca Muscariello <lumuscar+fdio@cisco.com>
Fri, 23 Feb 2018 15:29:57 +0000 (16:29 +0100)
committerLuca Muscariello <lumuscar+fdio@cisco.com>
Fri, 23 Feb 2018 20:58:36 +0000 (20:58 +0000)
- LongBow: removing JJB dependency tree for docs which is useless
           as it triggers the whole job dependency graph
- Libparc: added documentation to be availeble at docs.fd.io

Change-Id: I052ae76cdf6507e0dbeb8811c00ce6501708380e
Signed-off-by: Luca Muscariello <lumuscar+fdio@cisco.com>
jjb/cicn/cicn.yaml
jjb/cicn/include-raw-cicn-libparc-docs.sh [new file with mode: 0644]

index c7252a8..a5e0243 100644 (file)
@@ -24,8 +24,8 @@
     jobs:
         - 'cicn-libparc-verify-{stream}-{os}'
         - 'cicn-libparc-merge-{stream}-{os}'
-        - 'cicn-libparc-docs-verify-{stream}'
-        - 'cicn-libparc-docs-merge-{stream}'
+        - 'cicn-libparc-docs-verify-{stream}'
+        - 'cicn-libparc-docs-merge-{stream}'
     project: 'cicn'
     os:
         - ubuntu1604:
             build-timeout: '{build-timeout}'
 
     triggers:
+        - reverse:
+            jobs: 'cicn-longbow-merge-{stream}-ubuntu1604'
+            result: 'success'
         - gerrit-trigger-patch-merged:
             name: '{project}'
             branch: '{branch}'
         - fdio-infra-shiplogs:
             maven-version: 'mvn33-new'
 
+- job-template:
+    name: 'cicn-libparc-docs-merge-{stream}'
+
+    project-type: freestyle
+    node: ubuntu1604-basebuild-8c-32g
+    concurrent: true
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
+        - os-parameter:
+            os: 'ubuntu1604'
+        - maven-exec:
+            maven-version: 'mvn33-new'
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: 'jenkins-gerrit-credentials'
+            refspec: ''
+            choosing-strategy: 'default'
+
+    wrappers:
+        - fdio-infra-wrappers:
+            build-timeout: '{build-timeout}'
+
+    triggers:
+        - gerrit:
+            server-name: 'Primary'
+            trigger-on:
+                - comment-added-contains-event:
+                    comment-contains-value: 'run-docs'
+            projects:
+              - project-compare-type: 'ANT'
+                project-pattern: '{project}'
+                branches:
+                  - branch-compare-type: 'ANT'
+                    branch-pattern: '**/{branch}'
+            skip-vote:
+                successful: true
+                failed: true
+                unstable: true
+                notbuilt: true
+
+    builders:
+        - maven-target:
+            maven-version: 'mvn33-new'
+            goals: '--version'
+            settings: 'vpp-settings'
+            settings-type: cfp
+            global-settings: 'global-settings'
+            global-settings-type: cfp
+        - provide-maven-settings:
+            settings-file: 'cicn-settings'
+            global-settings-file: 'global-settings'
+        - shell:
+            !include-raw-escape:
+                - include-raw-cicn-libparc-docs.sh
+    publishers:
+        - archive:
+            artifacts: 'libparc/build/documentation/*.tar'
+            allow-empty: 'true'
+            fingerprint: false
+            only-if-success: true
+            default-excludes: false
+        - fdio-infra-shiplogs:
+            maven-version: 'mvn33-new'
+
+- job-template:
+    name: 'cicn-libparc-docs-verify-{stream}'
+
+    project-type: freestyle
+    node: ubuntu1604-basebuild-8c-32g
+    concurrent: true
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
+        - os-parameter:
+            os: 'ubuntu1604'
+        - maven-exec:
+            maven-version: 'mvn33-new'
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: 'jenkins-gerrit-credentials'
+            refspec: ''
+            choosing-strategy: 'default'
+
+    wrappers:
+        - fdio-infra-wrappers:
+            build-timeout: '{build-timeout}'
+
+    triggers:
+        - gerrit-trigger-patch-submitted:
+            name: '{project}'
+            branch: '{branch}'
+
+    builders:
+        - maven-target:
+            maven-version: 'mvn33-new'
+            goals: '--version'
+            settings: 'vpp-settings'
+            settings-type: cfp
+            global-settings: 'global-settings'
+            global-settings-type: cfp
+        - provide-maven-settings:
+            settings-file: 'cicn-settings'
+            global-settings-file: 'global-settings'
+        - shell:
+            !include-raw-escape:
+                - include-raw-cicn-libparc-docs.sh
+    publishers:
+        - archive:
+            artifacts: 'libparc/build/documentation/*.tar'
+            allow-empty: 'true'
+            fingerprint: false
+            only-if-success: true
+            default-excludes: false
+        - fdio-infra-shiplogs:
+            maven-version: 'mvn33-new'
+
+
 - job-template:
     name: 'cicn-libccnx-common-merge-{stream}-{os}'
 
diff --git a/jjb/cicn/include-raw-cicn-libparc-docs.sh b/jjb/cicn/include-raw-cicn-libparc-docs.sh
new file mode 100644 (file)
index 0000000..50f0ee5
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash
+set -xe -o pipefail
+
+update_cmake_repo() {
+    cat /etc/resolv.conf
+    echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
+    cat /etc/resolv.conf
+
+    CMAKE_INSTALL_SCRIPT_URL="https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.sh"
+    CMAKE_INSTALL_SCRIPT="/tmp/install_cmake.sh"
+    curl ${CMAKE_INSTALL_SCRIPT_URL} > ${CMAKE_INSTALL_SCRIPT}
+
+    sudo mkdir -p /opt/cmake
+    sudo bash ${CMAKE_INSTALL_SCRIPT} --skip-license --prefix=/opt/cmake
+    export PATH=/opt/cmake/bin:$PATH
+}
+
+cd libparc
+
+[ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site"
+[ "$PROJECT_PATH" ] || PROJECT_PATH="io/fd/cicn/libparc"
+[ "$DOC_FILE" ] || DOC_FILE="cicn.libparc.docs.zip"
+[ "$DOC_DIR" ] || DOC_DIR="build/documentation/generated-documentation/html"
+[ "$SITE_DIR" ] || SITE_DIR="build/documentation/deploy-site/"
+[ "$RESOURCES_DIR" ] || RESOURCES_DIR=${SITE_DIR}/src/site/resources
+[ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
+[ "$VERSION" ] || VERSION=$(bash scripts/version rpm-version)
+
+echo "Current directory: $(pwd)"
+
+update_cmake_repo
+mkdir -p build
+pushd build
+cmake ..
+make documentation
+popd
+
+if [[ ${JOB_NAME} == *merge* ]]; then
+  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>
+      <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}/${PROJECT_PATH}/${VERSION}</url>
+      </site>
+    </distributionManagement>
+  </project>
+EOF
+  ${MVN} site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C
+  cd -
+fi