summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-02-17 17:27:04 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-03-04 14:47:24 +0000
commitc09cfa3ec95933d3c8bb52d46e5edf6808513145 (patch)
tree123b6e11124a7b8139d9391e7fb69ec70a22c38b /yarns
parentd806c844ac54fe48c13bd5beb2a4c01f993aa251 (diff)
downloadmorph-c09cfa3ec95933d3c8bb52d46e5edf6808513145.tar.gz
deploy: Add upgrading to deployment.yarn
Diffstat (limited to 'yarns')
-rw-r--r--yarns/deployment.yarn30
-rw-r--r--yarns/implementations.yarn10
2 files changed, 39 insertions, 1 deletions
diff --git a/yarns/deployment.yarn b/yarns/deployment.yarn
index 855ecc52..f98d2751 100644
--- a/yarns/deployment.yarn
+++ b/yarns/deployment.yarn
@@ -9,7 +9,7 @@ Morph Deployment Tests
THEN morph failed
AND the deploy error message includes the string "morph deploy is only supported for cluster morphologies"
- SCENARIO deploying a cluster morphology
+ SCENARIO deploying a cluster morphology as a tarfile
GIVEN a workspace
AND a git server
WHEN the user checks out the system branch called master
@@ -17,3 +17,31 @@ Morph Deployment Tests
WHEN the user builds the system test-system in branch master
AND the user attempts to deploy the cluster test-cluster in branch master with options system.location=test.tar
THEN morph succeeded
+
+Some deployment types support upgrades, but some do not and Morph needs to make
+this clear.
+
+ SCENARIO attempting to upgrade a tarfile deployment
+ GIVEN a workspace
+ AND a git server
+ WHEN the user checks out the system branch called master
+ GIVEN a cluster called test-cluster for deploying only the test-system system as type tar in system branch master
+ WHEN the user builds the system test-system in branch master
+ AND the user attempts to upgrade the cluster test-cluster in branch master with options system.location=test.tar
+ THEN morph failed
+
+The rawdisk write extension supports both initial deployment and subsequent
+upgrades. Note that the rawdisk upgrade code needs bringing up to date to use
+the new Baserock OS version manager tool. Also, the test deploys an identical
+base OS as an upgrade. While pointless, this is permitted and does exercise
+the same code paths as a real upgrade.
+
+ SCENARIO deploying a cluster morphology as rawdisk and then upgrading it
+ GIVEN a workspace
+ AND a git server
+ WHEN the user checks out the system branch called master
+ GIVEN a cluster called test-cluster for deploying only the test-system system as type rawdisk in system branch master
+ WHEN the user builds the system test-system in branch master
+ AND the user attempts to deploy the cluster test-cluster in branch master with options system.location=test.img system.DISK_SIZE=10M system.VERSION_LABEL=test1
+ AND the user attempts to upgrade the cluster test-cluster in branch master with options system.location=test.img system.VERSION_LABEL=test2
+ THEN morph succeeded
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index ccebabca..1e1b2fd5 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -663,6 +663,16 @@ them, so they can be added to the end of the implements section.
if [ $MATCH_1 == "deploys" ]; then run_morph "$@"
else attempt_morph "$@"; fi
+ IMPLEMENTS WHEN the user (attempts to upgrade|upgrades) the (system|cluster) (\S+) in branch (\S+)( with options (.*))?
+ cd "$DATADIR/workspace/$MATCH_4"
+ set -- deploy --upgrade "$MATCH_3"
+ if [ "$MATCH_5" != '' ]; then
+ # eval used so word splitting in the text is preserved
+ eval set -- '"$@"' $MATCH_6
+ fi
+ if [ $MATCH_1 == "upgrades" ]; then run_morph "$@"
+ else attempt_morph "$@"; fi
+
To successfully deploy systems, we need a cluster morphology. Since the
common case is to just have one system, we generate a stub morphology
with only the minimal information.