]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-build: add scripts to validate distro type 441/head
authorAndrew Schoen <aschoen@redhat.com>
Mon, 29 Aug 2016 15:34:22 +0000 (10:34 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Mon, 29 Aug 2016 15:34:22 +0000 (10:34 -0500)
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 <aschoen@redhat.com>
ceph-build/build/validate_deb [new file with mode: 0644]
ceph-build/build/validate_rpm [new file with mode: 0644]
ceph-build/config/definitions/ceph-build.yml

diff --git a/ceph-build/build/validate_deb b/ceph-build/build/validate_deb
new file mode 100644 (file)
index 0000000..0322b47
--- /dev/null
@@ -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 (file)
index 0000000..17b4148
--- /dev/null
@@ -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
index 4f7d09a23d8b29498bb1c94c5546588121bec290..07e8a567043a9ce85e73a20175f08686b357ac96 100644 (file)
@@ -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