summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-10-10 13:58:01 (GMT)
committerRichard Maw <richard.maw@codethink.co.uk>2014-10-10 13:58:01 (GMT)
commit96d928656047809ab48d3882119557f76db6c033 (patch)
treef7f306fca6bc64acde8a43f260d7e3b97cff711a
parentdde99f1b5d2fc24375863fde1211f749d99b3b3a (diff)
parent76a9ee333741f3834bd8fe03e490aeba724fef96 (diff)
downloaddefinitions-96d928656047809ab48d3882119557f76db6c033.tar.gz
Merge remote-tracking branch 'origin/baserock/ps/cycle-refuses-to-delete-TEST-system'
Reviewed-by: Richard Maw (+2)
-rwxr-xr-xscripts/cycle.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/cycle.sh b/scripts/cycle.sh
index 8fab43b..0198c1f 100755
--- a/scripts/cycle.sh
+++ b/scripts/cycle.sh
@@ -29,15 +29,22 @@ if [ -z "$1" ] || [ -z "$2" ] ; then
exit 1
fi
+if system-version-manager get-running | grep -q '^TEST$'; then
+ echo "You are currently running the TEST system."
+ echo "Maybe you want to boot into a different system version?"
+ exit 1
+fi
+
set -e
set -v
-morph gc
-morph build $1
system-version-manager set-default factory
-if [ `system-version-manager list | grep ^TEST$` ]; then
+if system-version-manager list | grep -q '^TEST$'; then
system-version-manager remove TEST
fi
-sed -i "s|^- morph: .*$|- morph: $1|" $2
-morph deploy --upgrade $2 self.HOSTNAME=$(hostname) self.VERSION_LABEL=TEST
+morph gc
+morph build "$1"
+
+sed -i "s|^- morph: .*$|- morph: $1|" "$2"
+morph deploy --upgrade "$2" self.HOSTNAME=$(hostname) self.VERSION_LABEL=TEST