summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorRichard Ipsum <richardipsum@fastmail.co.uk>2014-11-22 16:14:30 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2015-01-23 10:55:18 +0000
commita44c4b0e3cae671663c4d99b6d89d6a2f12add35 (patch)
tree7f6607efa0bbe84183d9f6241f27b5728cab0a7d /yarns
parentabdffd583d9696c8740bbcec689aedb77750016b (diff)
downloadmorph-a44c4b0e3cae671663c4d99b6d89d6a2f12add35.tar.gz
Add yarns to test deploying with relative paths
Diffstat (limited to 'yarns')
-rw-r--r--yarns/deployment.yarn27
-rw-r--r--yarns/implementations.yarn37
2 files changed, 58 insertions, 6 deletions
diff --git a/yarns/deployment.yarn b/yarns/deployment.yarn
index 0782c7c1..31406cc0 100644
--- a/yarns/deployment.yarn
+++ b/yarns/deployment.yarn
@@ -24,6 +24,33 @@ Morph Deployment Tests
THEN morph succeeded
FINALLY the git server is shut down
+ SCENARIO deploying a cluster using a relative path
+ GIVEN a workspace
+ AND a git server
+ WHEN the user checks out the system branch called master
+ AND the user builds the system systems/test-system.morph in branch master
+ AND from directory workspace/master/test/morphs/clusters the user attempts to deploy the cluster test-cluster.morph in branch master
+ THEN morph succeeded
+ FINALLY the git server is shut down
+
+ SCENARIO deploying a cluster using a relative path (second variant)
+ GIVEN a workspace
+ AND a git server
+ WHEN the user checks out the system branch called master
+ AND the user builds the system systems/test-system.morph in branch master
+ AND from directory workspace/master/test/morphs/clusters the user attempts to deploy the cluster ../clusters/test-cluster.morph in branch master
+ THEN morph succeeded
+ FINALLY the git server is shut down
+
+ SCENARIO deploying a cluster using an absolute path
+ GIVEN a workspace
+ AND a git server
+ WHEN the user checks out the system branch called master
+ AND the user builds the system systems/test-system.morph in branch master
+ AND from directory workspace/master/test/morphs/clusters the user attempts to deploy the cluster using the absolute path to test-cluster.morph in branch master
+ THEN morph succeeded
+ FINALLY the git server is shut down
+
Some deployment types support upgrades, but some do not and Morph needs to make
this clear.
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index f73e3c64..83ff03c6 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -247,6 +247,19 @@ another to hold a chunk.
morph: strata/core.morph
EOF
+ mkdir "$DATADIR/gits/morphs/clusters"
+ cd "$DATADIR/gits/morphs"
+ install -m644 -D /dev/stdin << EOF "clusters/test-cluster.morph"
+ name: test-cluster
+ kind: cluster
+ systems:
+ - morph: systems/test-system.morph
+ deploy:
+ test-system:
+ type: tar
+ location: test.tar
+ EOF
+
install -m644 -D /dev/stdin << EOF "strata/build-essential.morph"
name: build-essential
kind: stratum
@@ -723,14 +736,26 @@ Defaults are set in the cluster morphology, so we can deploy without
setting any extra parameters, but we also need to be able to override
them, so they can be added to the end of the implements section.
- IMPLEMENTS WHEN the user (attempts to deploy|deploys) the (system|cluster) (\S+) in branch (\S+)( with options (.*))?
- cd "$DATADIR/workspace/$MATCH_4"
- set -- deploy "$MATCH_3"
- if [ "$MATCH_5" != '' ]; then
+ IMPLEMENTS WHEN (from directory (\S+) )?the user (attempts to deploy|deploys) the (system|cluster) (using the absolute path to )?(\S+) in branch (\S+)( with options (.*))?
+ if [ "$MATCH_1" != "" ]
+ then
+ cd "$DATADIR/$MATCH_2"
+ else
+ cd "$DATADIR/workspace/$MATCH_7/test/morphs"
+ fi
+
+ if [ "$MATCH_5" != "" ]
+ then
+ set -- deploy "$(pwd)/$MATCH_6"
+ else
+ set -- deploy "$MATCH_6"
+ fi
+
+ if [ "$MATCH_8" != '' ]; then
# eval used so word splitting in the text is preserved
- eval set -- '"$@"' $MATCH_6
+ eval set -- '"$@"' $MATCH_9
fi
- if [ $MATCH_1 == "deploys" ]; then run_morph "$@"
+ if [ $MATCH_3 == "deploys" ]; then run_morph "$@"
else attempt_morph "$@"; fi
IMPLEMENTS WHEN the user (attempts to deploy|deploys) (.*) from cluster (\S+) in branch (\S+)