Make packagecloud push conditional on existence of ~/.packagecloud 15/6215/1
authorEd Warnicke <eaw@cisco.com>
Mon, 17 Apr 2017 20:48:06 +0000 (13:48 -0700)
committerEd Warnicke <eaw@cisco.com>
Mon, 17 Apr 2017 20:48:06 +0000 (13:48 -0700)
Change-Id: I34d88bfd6f4c55c00d354aae13536a8e3eb8e613
Signed-off-by: Ed Warnicke <eaw@cisco.com>
jjb/scripts/packagecloud_push.sh

index 805cf12..af004a3 100644 (file)
@@ -3,17 +3,18 @@
 # 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
+if [ -f ~/.packagecloud ]; then
+    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
+fi