From f4ea587cbeb79f8cfd8a04685f0a7f0e1cdd6298 Mon Sep 17 00:00:00 2001 From: Luca Muscariello Date: Fri, 23 Feb 2018 16:29:57 +0100 Subject: [PATCH] fixes for cicn documentations: - 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 --- jjb/cicn/cicn.yaml | 145 +++++++++++++++++++++++++++++- jjb/cicn/include-raw-cicn-libparc-docs.sh | 74 +++++++++++++++ 2 files changed, 217 insertions(+), 2 deletions(-) create mode 100644 jjb/cicn/include-raw-cicn-libparc-docs.sh diff --git a/jjb/cicn/cicn.yaml b/jjb/cicn/cicn.yaml index c7252a864..a5e0243fb 100644 --- a/jjb/cicn/cicn.yaml +++ b/jjb/cicn/cicn.yaml @@ -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: @@ -561,6 +561,9 @@ build-timeout: '{build-timeout}' triggers: + - reverse: + jobs: 'cicn-longbow-merge-{stream}-ubuntu1604' + result: 'success' - gerrit-trigger-patch-merged: name: '{project}' branch: '{branch}' @@ -647,6 +650,144 @@ - 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 index 000000000..50f0ee530 --- /dev/null +++ b/jjb/cicn/include-raw-cicn-libparc-docs.sh @@ -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 + + 4.0.0 + io.fd.vpp + docs + 1.0.0 + pom + + + false + + + + + + org.apache.maven.wagon + wagon-webdav-jackrabbit + 2.9 + + + + + + fdio-site + dav:${DOCS_REPO_URL}/${PROJECT_PATH}/${VERSION} + + + +EOF + ${MVN} site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C + cd - +fi -- 2.16.6