Configure VPP to publish to packagecloud.io 28/5928/26
authorVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
Wed, 29 Mar 2017 18:08:25 +0000 (13:08 -0500)
committerVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
Mon, 17 Apr 2017 17:58:40 +0000 (12:58 -0500)
Added a packagecloud_push script to push artifacts to the
packagecloud.io repository

Added the stream-parameter and packagecloud_push script to the VPP merge
job to allow artifacts to be published to packagecloud repositories in
addition to Nexus repositories

Change-Id: I9076ee35a6d330579ba72aa19a455b3d7a22e7f5
Signed-off-by: Vanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
jjb/scripts/packagecloud_push.sh [new file with mode: 0644]
jjb/vpp/include-raw-vpp-packagecloud-push.sh [deleted file]
jjb/vpp/vpp.yaml

diff --git a/jjb/scripts/packagecloud_push.sh b/jjb/scripts/packagecloud_push.sh
new file mode 100644 (file)
index 0000000..805cf12
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# PCIO_CO is a Jenkins Global Environment variable
+
+FACTER_OS=$(/usr/bin/facter operatingsystem)
+
+case "$FACTER_OS" in
+  Ubuntu)
+    FACTER_LSBNAME=$(/usr/bin/facter lsbdistcodename)
+    DEBS=$(find . -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 . -type f -iregex '.*/.*\.\(s\)?rpm')
+    package_cloud push "${PCIO_CO}/${STREAM}/el/${FACTER_OSMAJREL}/os/${FACTER_ARCH}/" ${RPMS}
+  ;;
+esac
diff --git a/jjb/vpp/include-raw-vpp-packagecloud-push.sh b/jjb/vpp/include-raw-vpp-packagecloud-push.sh
deleted file mode 100644 (file)
index 8908d09..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-if [ "${OS}" == "ubuntu1404" ]; then
-    DEBS=$(find . -type f -iname '*.deb')
-    package_cloud push fdio/test/ubuntu/trusty/main ${DEBS}
-elif [ "${OS}" == "ubuntu1604" ]; then
-    DEBS=$(find . -type f -iname '*.deb')
-    package_cloud push fdio/test/ubuntu/xenial/main ${DEBS}
-elif [ "${OS}" == "centos7" ]; then
-    # Find the files
-    RPMS=$(find . -type f -iname '*.rpm')
-    SRPMS=$(find . -type f -iname '*.srpm')
-    SRCRPMS=$(find . -type f -name '*.src.rpm')
-    package_cloud push fdio/test/el/7/os/x86_64/ ${RPMS} ${SRPMS} ${SRCRPMS}
-fi
\ No newline at end of file
index 36e12c0..22c6196 100644 (file)
             maven: 'mvn33-new'
         - maven-exec:
             maven-version: 'mvn33-new'
+        - stream-parameter:
+            stream: '{stream}'
         - repo-name-parameter:
             repo-name: '{repo-stream-part}.{repo-os-part}'
 
             !include-raw-escape:
                 - ../scripts/maven_push_functions.sh
                 - include-raw-vpp-maven-push.sh
+        - shell:
+            !include-raw-escape:
+                - ../scripts/packagecloud_push.sh
+
     publishers:
         - archive:
             artifacts: 'build-root/*.rpm,build-root/*.deb,dpdk/*.rpm,dpdk/*.deb'
             branch: '{branch}'
         - os-parameter:
             os: '{os}'
+        - stream-parameter:
+            stream: '{stream}'
         - repo-name-parameter:
             repo-name: '{repo-stream-part}.{repo-os-part}'
 
                 - include-raw-vpp-build.sh
         - shell:
             !include-raw-escape:
-                - include-raw-vpp-packagecloud-push.sh
+                - ../scripts/packagecloud_push.sh
 
     publishers:
         - archive:
             default-excludes: false
         - fdio-infra-shiplogs:
             maven-version: 'mvn33-new'
-