From: Andrew Schoen Date: Mon, 29 Aug 2016 15:34:22 +0000 (-0500) Subject: ceph-build: add scripts to validate distro type X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F441%2Fhead;p=ceph-build.git ceph-build: add scripts to validate distro type This will make sure a build script fails early if it will not work on the distro being built for. Doing this early avoids duplicate calls to the build_utils and setup scripts. Signed-off-by: Andrew Schoen --- diff --git a/ceph-build/build/validate_deb b/ceph-build/build/validate_deb new file mode 100644 index 00000000..0322b47a --- /dev/null +++ b/ceph-build/build/validate_deb @@ -0,0 +1,7 @@ +#!/bin/bash +set -ex + +# Only do actual work when we are a DEB distro +if test -f /etc/redhat-release ; then + exit 0 +fi diff --git a/ceph-build/build/validate_rpm b/ceph-build/build/validate_rpm new file mode 100644 index 00000000..17b41482 --- /dev/null +++ b/ceph-build/build/validate_rpm @@ -0,0 +1,7 @@ +#!/bin/bash +set -ex + +# only do work if we are a RPM distro +if [[ ! -f /etc/redhat-release && ! -f /usr/bin/zypper ]] ; then + exit 0 +fi diff --git a/ceph-build/config/definitions/ceph-build.yml b/ceph-build/config/definitions/ceph-build.yml index 4f7d09a2..07e8a567 100644 --- a/ceph-build/config/definitions/ceph-build.yml +++ b/ceph-build/config/definitions/ceph-build.yml @@ -59,6 +59,7 @@ # debian build scripts - shell: !include-raw: + - ../../build/validate_deb - ../../../scripts/build_utils.sh - ../../build/setup - ../../build/setup_pbuilder @@ -66,6 +67,7 @@ # rpm build scripts - shell: !include-raw: + - ../../build/validate_rpm - ../../../scripts/build_utils.sh - ../../build/setup - ../../build/build_rpm