From 6dfd1b361f9cb3fc26fa7c5fecee18cd2982ad4d Mon Sep 17 00:00:00 2001 From: Travis Rhoden Date: Tue, 1 Sep 2015 14:44:32 -0700 Subject: [PATCH] Use $DIST for determining distro Makes takora job similar to ceph-deploy and mariner-installer Signed-off-by: Travis Rhoden --- takora/build/build | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/takora/build/build b/takora/build/build index 4fbac102..4edb1be9 100644 --- a/takora/build/build +++ b/takora/build/build @@ -3,19 +3,28 @@ echo "BRANCH: $BRANCH" cd $WORKSPACE/takora -. /etc/os-release +# FIXME A very naive way to just list the RPM $DIST that we currently support. +# We should be a bit more lenient to allow any rhel/centos/sles/suse +rpm_dists="rhel centos6.5 centos7 rhel6.5 rhel7 centos" +deb_dists="precise wheezy squeeze trusty" -DEBIAN=0 +# A helper to match an item in a list of items, like python's `if item in list` +listcontains() { + for word in $2; do + [[ $word = $1 ]] && return 0 + done + return 1 +} -if [ "$ID" == 'ubuntu' ] ; then +if listcontains $DIST "$deb_dists" ; then DEBIAN=1 -fi - -if [ $DEBIAN = 1 ] ; then dpkg-buildpackage -us -uc +elif listcontains $DIST "$rpm_dists" ; then + DEBIAN=0 + tito build --rpm else - # FIXME: is this the correct tito command? - tito rpm + echo "Can't determine build host type" + exit 1 fi if [ -n "$BRANCH" ]; then -- 2.39.5