summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-27 15:46:09 (GMT)
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-27 15:46:09 (GMT)
commitfee55ee33a4be2398224e345d4907e86b5acbb1f (patch)
treee147767c1bf6c9c66f65a77f5398d764a540b083
parent32446688366229cad3f7bacb93e3118cff36163f (diff)
parent946d6b530ebda661c4db0e28d8aba2570044941c (diff)
downloaddefinitions-fee55ee33a4be2398224e345d4907e86b5acbb1f.tar.gz
Merge branch 'baserock/sam/fix-build-system-deploy'
Reviewed-By: Richard Maw <richard.maw@codethink.co.uk> Reviewed-By: Paul Sherwood <paul.sherwood@codethink.co.uk>
-rw-r--r--distbuild.configure19
-rw-r--r--mason.configure48
2 files changed, 39 insertions, 28 deletions
diff --git a/distbuild.configure b/distbuild.configure
index d9b9fb8..062aaec 100644
--- a/distbuild.configure
+++ b/distbuild.configure
@@ -45,20 +45,21 @@ if [ -n "$DISTBUILD_GENERIC" ]; then
exit 0
fi
+# Set default values for these two options if they are unset, so that if the
+# user specifies no distbuild config at all the configure extension exits
+# without doing anything but does not raise an error.
+DISTBUILD_CONTROLLER=${DISTBUILD_CONTROLLER-False}
+DISTBUILD_WORKER=${DISTBUILD_WORKER-False}
+
+if [ "$DISTBUILD_CONTROLLER" = False -a "$DISTBUILD_WORKER" = False ]; then
+ exit 0
+fi
+
set -u
# Check that all the variables needed are present:
error_vars=false
-if [ "x$DISTBUILD_WORKER" = "x" ]; then
- echo "ERROR: DISTBUILD_WORKER needs to be defined."
- error_vars=true
-fi
-
-if [ "x$DISTBUILD_CONTROLLER" = "x" ]; then
- echo "ERROR: DISTBUILD_CONTROLLER needs to be defined."
- error_vars=true
-fi
if [ "x$TROVE_HOST" = "x" ]; then
echo "ERROR: TROVE_HOST needs to be defined."
diff --git a/mason.configure b/mason.configure
index d0abbf1..621d6a3 100644
--- a/mason.configure
+++ b/mason.configure
@@ -32,13 +32,41 @@
set -e
-ROOT="$1"
+##########################################################################
+# Check variables
+##########################################################################
+
+if [ -n "$MASON_GENERIC" ]; then
+ echo Not configuring Mason, it will be generic
+ exit 0
+fi
+
+if [ -z "$MASON_CLUSTER_MORPHOLOGY" -a \
+ -z "$MASON_DEFINITIONS_REF" -a \
+ -z "$MASON_DISTBUILD_ARCH" -a \
+ -z "$MASON_TEST_HOST" ]; then
+ # No Mason options defined, do nothing.
+ exit 0
+fi
+
+if [ -z "$ARTIFACT_CACHE_SERVER" -o \
+ -z "$CONTROLLERHOST" -o \
+ -z "$MASON_CLUSTER_MORPHOLOGY" -o \
+ -z "$MASON_DEFINITIONS_REF" -o \
+ -z "$MASON_DISTBUILD_ARCH" -o \
+ -z "$MASON_TEST_HOST" -o \
+ -z "$TROVE_HOST" -o \
+ -z "$TROVE_ID" ]; then
+ echo Some options required for Mason were defined, but not all.
+ exit 1
+fi
##########################################################################
# Copy Mason files into root filesystem
##########################################################################
+ROOT="$1"
mkdir -p "$ROOT"/usr/lib/mason
cp mason/mason.sh "$ROOT"/usr/lib/mason/mason.sh
@@ -78,24 +106,6 @@ ln -s ../mason-setup.service "$ROOT"/etc/systemd/system/multi-user.target.wants/
##########################################################################
-# Check variables
-##########################################################################
-
-if [ -n "$MASON_GENERIC" ]; then
- echo Not configuring Mason, it will be generic
- exit 0
-fi
-
-if [ "$ARTIFACT_CACHE_SERVER" = "" \
- -o "$MASON_CLUSTER_MORPHOLOGY" = "" \
- -o "$MASON_DEFINITIONS_REF" = "" \
- -o "$MASON_DISTBUILD_ARCH" = "" \
- -o "$MASON_TEST_HOST" = "" ]; then
- echo Not configuring as Mason, some options not defined
- exit 1
-fi
-
-##########################################################################
# Generate config variable shell snippet
##########################################################################