JVPP-22: introducing jvpp merge job 63/17463/5
authorMichal Cmarada <mcmarada@cisco.com>
Mon, 11 Feb 2019 12:48:18 +0000 (13:48 +0100)
committerMichal Cmarada <mcmarada@cisco.com>
Fri, 15 Feb 2019 09:19:10 +0000 (10:19 +0100)
Change-Id: I77627860800bed6568c964d713596d9a0bd18fc7
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
jjb/jvpp/include-raw-jvpp-build.sh [changed mode: 0644->0755]
jjb/jvpp/include-raw-jvpp-maven-push.sh [new file with mode: 0755]
jjb/jvpp/include-raw-jvpp-packetcloud-push.sh [new file with mode: 0755]
jjb/jvpp/jvpp.yaml

old mode 100644 (file)
new mode 100755 (executable)
diff --git a/jjb/jvpp/include-raw-jvpp-maven-push.sh b/jjb/jvpp/include-raw-jvpp-maven-push.sh
new file mode 100755 (executable)
index 0000000..6554a58
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/bash
+set -xe -o pipefail
+echo "*******************************************************************"
+echo "* STARTING PUSH OF JVPP PACKAGES TO REPOS"
+echo "* NOTHING THAT HAPPENS BELOW THIS POINT IS RELATED TO BUILD FAILURE"
+echo "*******************************************************************"
+
+[ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
+GROUP_ID="io.fd.${PROJECT}"
+BASEURL="${NEXUSPROXY}/content/repositories/fd.io."
+BASEREPOID='fdio-'
+
+if [ "${OS}" == "ubuntu1604" ]; then
+    # Find the files
+    JARS=$(find ./java -type f -iname '*.jar')
+    DEBS=$(find ./build-root/packages/ -type f -iname '*.deb')
+    for i in $JARS
+    do
+        push_jar "$i"
+    done
+
+    for i in $DEBS
+    do
+        push_deb "$i"
+    done
+elif [ "${OS}" == "ubuntu1804" ]; then
+    # Find the files
+    JARS=$(find ./java -type f -iname '*.jar')
+    DEBS=$(find ./build-root/packages/ -type f -iname '*.deb')
+    for i in $JARS
+    do
+        push_jar "$i"
+    done
+
+    for i in $DEBS
+    do
+        push_deb "$i"
+    done
+elif [ "${OS}" == "centos7" ]; then
+    # Find the files
+    RPMS=$(find ./build-root/packages/ -type f -iname '*.rpm')
+    SRPMS=$(find ./build-root/packages/ -type f -iname '*.srpm')
+    SRCRPMS=$(find ./build-root/packages/ -type f -name '*.src.rpm')
+    for i in $RPMS $SRPMS $SRCRPMS
+    do
+        push_rpm "$i"
+    done
+fi
+# vim: ts=4 sw=4 sts=4 et ft=sh :
diff --git a/jjb/jvpp/include-raw-jvpp-packetcloud-push.sh b/jjb/jvpp/include-raw-jvpp-packetcloud-push.sh
new file mode 100755 (executable)
index 0000000..2917606
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+# PCIO_CO is a Jenkins Global Environment variable
+
+set -x
+
+echo "STARTING JVPP PACKAGECLOUD PUSH"
+
+sleep 10
+
+FACTER_OS=$(/usr/bin/facter operatingsystem)
+
+if [ -f ~/.packagecloud ]; then
+    case "$FACTER_OS" in
+      Ubuntu)
+        FACTER_LSBNAME=$(/usr/bin/facter lsbdistcodename)
+        DEBS=$(find ./build-root/packages/ -type f -iname '*.deb')
+        package_cloud push "${PCIO_CO}/${STREAM}/ubuntu/${FACTER_LSBNAME}/main/" ${DEBS}
+      ;;
+      CentOS)
+        FACTER_OSMAJREL=$(/usr/bin/facter operatingsystemmajrelease)
+        FACTER_ARCH=$(/usr/bin/facter architecture)
+        RPMS=$(find ./build-root/packages/ -type f -iregex '.*/.*\.\(s\)?rpm')
+        package_cloud push "${PCIO_CO}/${STREAM}/el/${FACTER_OSMAJREL}/os/${FACTER_ARCH}/" ${RPMS}
+      ;;
+    esac
+fi
index 1a99ed2..a526bd1 100644 (file)
@@ -3,6 +3,7 @@
     name: jvpp
     jobs:
       - 'jvpp-verify-{stream}-{os}'
+      - 'jvpp-merge-{stream}-{os}'
     project: 'jvpp'
     os:
       - ubuntu1604:
           fingerprint: false
           only-if-success: true
           default-excludes: false
+      - fdio-infra-shiplogs:
+          maven-version: 'mvn33-new'
+          archive-artifacts: '/tmp/jvpp-failed-unittests/*/* **/core'
       - naginator:
           rerun-unstable-builds: false
           max-failed-builds: 2
           fixed-delay: 90
       - email-notification:
           email-prefix: '[jvpp]'
+
+- job-template:
+    name: 'jvpp-merge-{stream}-{os}'
+
+    project-type: freestyle
+    node: '{os}-us'
+
+    build-discarder:
+      daysToKeep: '{build-days-to-keep}'
+      numToKeep: 100
+      artifactDaysToKeep: '{build-artifact-days-to-keep}'
+      artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+      - gerrit-parameter:
+          branch: '{branch}'
+      - os-parameter:
+          os: '{os}'
+      - maven-project-parameter:
+          maven: 'mvn33-new'
+      - maven-exec:
+          maven-version: 'mvn33-new'
+      - stream-parameter:
+          stream: '{stream}'
+      - repo-name-parameter:
+          repo-name: '{repo-stream-part}.{repo-os-part}'
+
+    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-merged:
+          name: '{project}'
+          branch: '{branch}'
+      - reverse:
+          jobs: 'vpp-merge-{stream}-{os}'
+          result: 'success'
+
+    builders:
+      - config-file-provider:
+          files:
+            - file-id: '.packagecloud'
+              target: '/root'
+      - config-file-provider:
+          files:
+            - file-id: 'packagecloud_api'
+              target: '/root'
+      - maven-target:
+          maven-version: 'mvn33-new'
+          goals: '--version'
+          settings: 'vpp-settings'
+          settings-type: cfp
+          global-settings: 'global-settings'
+          global-settings-type: cfp
+      - shell:
+          !include-raw-escape:
+          - ../scripts/setup_jvpp_dev_env.sh
+          - include-raw-jvpp-build.sh
+      - provide-maven-settings:
+          settings-file: 'jvpp-settings'
+          global-settings-file: 'global-settings'
+      - shell:
+          !include-raw-escape:
+          - ./include-raw-jvpp-packetcloud-push.sh
+      - shell:
+          !include-raw-escape:
+          - ../scripts/maven_push_functions.sh
+          - include-raw-jvpp-maven-push.sh
+
+    publishers:
+      - archive:
+          artifacts: >
+            **/build-root/packages/*.rpm,
+            **/build-root/packages/*.deb
+          allow-empty: 'true'
+          fingerprint: false
+          only-if-success: true
+          default-excludes: false
+      - fdio-infra-shiplogs:
+          maven-version: 'mvn33-new'
+      - naginator:
+          rerun-unstable-builds: false
+          max-failed-builds: 1
+          fixed-delay: 90
+      - email-notification:
+          email-prefix: '[jvpp]'