Use os-release for opensuse info 57/15057/1
authorEric Ball <eball@linuxfoundation.org>
Thu, 27 Sep 2018 19:39:58 +0000 (12:39 -0700)
committerEric Ball <eball@linuxfoundation.org>
Sat, 29 Sep 2018 01:52:16 +0000 (18:52 -0700)
Puppet, and therefore facter, are not officially supported on
OpenSUSE, and currently not available for OpenSUSE 15. Using the
os-release file to get the version info should be a viable
alternative.

Change-Id: Id4787d9b836a783792e5e5ae3b895e87b95f08cf
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
jjb/scripts/packagecloud_push.sh
jjb/vpp/vpp-opensuse.yaml

index c38d03b..c37ac55 100644 (file)
@@ -8,11 +8,11 @@ echo "STARTING PACKAGECLOUD PUSH"
 sleep 10
 
 if [ -f /usr/bin/zypper ]; then
-  echo "Since zypper exists, us it to install facter"
-  zypper -n install facter
+    FACTER_OS="openSUSE"
+else
+    FACTER_OS=$(/usr/bin/facter operatingsystem)
 fi
 
-FACTER_OS=$(/usr/bin/facter operatingsystem)
 if [ -f ~/.packagecloud ]; then
     case "$FACTER_OS" in
       Ubuntu)
@@ -26,10 +26,11 @@ if [ -f ~/.packagecloud ]; then
         RPMS=$(find . -type f -iregex '.*/.*\.\(s\)?rpm')
         package_cloud push "${PCIO_CO}/${STREAM}/el/${FACTER_OSMAJREL}/os/${FACTER_ARCH}/" ${RPMS}
       ;;
-      OpenSuSE)
-        FACTER_OSREL=$(/usr/bin/facter operatingsystemrelease)
+      openSUSE)
+        # Use /etc/os-release on openSUSE to get $VERSION
+        . /etc/os-release
         RPMS=$(find . -type f -iregex '.*/.*\.\(s\)?rpm')
-        package_cloud push "${PCIO_CO}/${STREAM}/opensuse/${FACTER_OSREL}/" ${RPMS}
+        package_cloud push "${PCIO_CO}/${STREAM}/opensuse/${VERSION}/" ${RPMS}
       ;;
     esac
 fi
index 2681455..47a69bf 100644 (file)
         - config-file-provider:
             files:
               - file-id: '.packagecloud'
-                target: '/home/jenkins'
+                target: '/root'
         - config-file-provider:
             files:
               - file-id: 'packagecloud_api'
-                target: '/home/jenkins'
+                target: '/root'
         - maven-target:
             maven-version: 'mvn33-new'
             goals: '--version'