summaryrefslogtreecommitdiffstats
path: root/docker/vpp/vpp-ubuntu20/files/pc_push
diff options
context:
space:
mode:
Diffstat (limited to 'docker/vpp/vpp-ubuntu20/files/pc_push')
-rw-r--r--docker/vpp/vpp-ubuntu20/files/pc_push39
1 files changed, 39 insertions, 0 deletions
diff --git a/docker/vpp/vpp-ubuntu20/files/pc_push b/docker/vpp/vpp-ubuntu20/files/pc_push
new file mode 100644
index 00000000..3fdc8d37
--- /dev/null
+++ b/docker/vpp/vpp-ubuntu20/files/pc_push
@@ -0,0 +1,39 @@
+#!/bin/bash
+# REPO is an Environment variable
+
+set -x
+
+echo "STARTING PACKAGECLOUD PUSH"
+
+sleep 10
+
+if [ -f /usr/bin/zypper ]; then
+ FACTER_OS="openSUSE"
+else
+ FACTER_OS=$(/usr/bin/facter operatingsystem)
+fi
+
+if [ -f ~/.packagecloud ]; then
+ case "$FACTER_OS" in
+ Ubuntu)
+ FACTER_LSBNAME=$(/usr/bin/facter lsbdistcodename)
+ DEBS=$(find . -type f -iname '*.deb')
+ package_cloud push "${REPO}/${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 "${REPO}/${STREAM}/el/${FACTER_OSMAJREL}/os/${FACTER_ARCH}/" ${RPMS}
+ ;;
+ openSUSE)
+ # Use /etc/os-release on openSUSE to get $VERSION
+ . /etc/os-release
+ RPMS=$(find . -type f -iregex '.*/.*\.\(s\)?rpm' | grep -v 'vpp-ext-deps')
+ VPP_EXT_RPMS=$(find . -type f -iregex '.*/.*\.\(s\)?rpm' | grep 'vpp-ext-deps')
+ package_cloud push "${REPO}/${STREAM}/opensuse/${VERSION}/" ${RPMS}
+ # This file may have already been uploaded. Don't error out if it exists.
+ package_cloud push "${REPO}/${STREAM}/opensuse/${VERSION}/" ${VPP_EXT_RPMS} --skip-errors
+ ;;
+ esac
+fi