Add the trending job 68/11168/1
authorTibor Frank <tifrank@cisco.com>
Thu, 15 Mar 2018 14:25:13 +0000 (15:25 +0100)
committerTibor Frank <tifrank@cisco.com>
Thu, 15 Mar 2018 14:25:13 +0000 (15:25 +0100)
Change-Id: I49ab44eed3326fd0b3490d70900c93a07ff9b394
Signed-off-by: Tibor Frank <tifrank@cisco.com>
jjb/csit/csit.yaml
jjb/csit/include-raw-csit-cpta.sh [new file with mode: 0644]

index cbbea9c..4ed4c92 100644 (file)
@@ -29,6 +29,7 @@
         - 'csit-docs-merge-{stream_timed}'
         - 'csit-docs-verify-{stream}'
         - 'csit-report-merge-{stream}'
+        - 'csit-trending-daily-master'
         - 'csit-vpp-perf-trend-daily-master'
         - 'csit-vpp-perf-trend-semi-weekly-master'
         - 'csit-vpp-perf-check-{stream}'
         - fdio-infra-shiplogs:
             maven-version: 'mvn33-new'
 
+- job-template:
+    name: 'csit-trending-daily-master'
+
+    project-type: freestyle
+    node: 'ubuntu1604-basebuild-8c-32g'
+    concurrent: false
+
+    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}'
+        - maven-exec:
+            maven-version: 'mvn33-new'
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: 'jenkins-gerrit-credentials'
+            refspec: '$GERRIT_REFSPEC'
+            choosing-strategy: 'default'
+
+    wrappers:
+        - fdio-infra-wrappers-non-activity-timeout:
+            build-timeout: '{build-timeout}'
+
+    triggers:
+        - reverse:
+            jobs: 'csit-vpp-perf-mrr-daily-master'
+            result: 'success'
+        - gerrit:
+            server-name: 'Primary'
+            trigger-on:
+                - comment-added-contains-event:
+                    comment-contains-value: 'run-trending'
+            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: 'csit-settings'
+            settings-type: cfp
+            global-settings: 'global-settings'
+            global-settings-type: cfp
+        - provide-maven-settings:
+            settings-file: 'csit-settings'
+            global-settings-file: 'global-settings'
+        - shell:
+            !include-raw-escape: include-raw-csit-cpta.sh
+
+    publishers:
+        - fdio-infra-shiplogs:
+            maven-version: 'mvn33-new'
+
 - job-template:
     name: 'csit-vpp-perf-trend-daily-master'
 
diff --git a/jjb/csit/include-raw-csit-cpta.sh b/jjb/csit/include-raw-csit-cpta.sh
new file mode 100644 (file)
index 0000000..db37feb
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+set -xe -o pipefail
+
+[ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site"
+[ "$PROJECT_PATH" ] || PROJECT_PATH=io/fd/csit
+[ "$DOC_DIR" ] || DOC_DIR=resources/tools/presentation
+[ "$BUILD_DIR" ] || BUILD_DIR=${DOC_DIR}/_build
+[ "$SITE_DIR" ] || SITE_DIR=build-root/docs/deploy-site
+[ "$RESOURCES_DIR" ] || RESOURCES_DIR=${SITE_DIR}/src/site/resources/trending
+[ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
+
+cd ${DOC_DIR}
+chmod +x ./run_cpta.sh
+./run_cpta.sh
+retval=$?
+
+cd ${WORKSPACE}
+
+mkdir -p ${RESOURCES_DIR}
+mv -f ${BUILD_DIR}/* ${RESOURCES_DIR}
+cd ${SITE_DIR}
+
+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.csit</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}/${GERRIT_BRANCH}</url>
+        </site>
+    </distributionManagement>
+</project>
+EOF
+
+${MVN} site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C
+
+cd -
+
+
+if [ ${retval} -ne "0" ]; then
+  echo "FAIL"
+fi
+exit ${retval}
\ No newline at end of file