summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2015-03-23 16:00:23 (GMT)
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2015-03-23 16:12:33 (GMT)
commit46c37a048a49a513e1fd4ce89b2f5851694a3aa3 (patch)
tree549edbaca5b3c1055d10d6ff9ff9591de97f4489
parentf8c24c7e2b7b1e61b85e96d7985eae5ffa4b8de2 (diff)
downloadmorph-baserock/adamcoldrick/partial-deploy.tar.gz
Add a test for partial deploymentbaserock/adamcoldrick/partial-deploy
-rw-r--r--yarns/deployment.yarn22
-rw-r--r--yarns/implementations.yarn33
2 files changed, 54 insertions, 1 deletions
diff --git a/yarns/deployment.yarn b/yarns/deployment.yarn
index 6ec8c0a..85bb2c9 100644
--- a/yarns/deployment.yarn
+++ b/yarns/deployment.yarn
@@ -301,6 +301,28 @@ deployment.
THEN morph failed
FINALLY the git server is shut down
+Deploying only part of a system
+-------------------------------
+
+It is possible to only deploy one or more strata or chunks from a system
+when deploying to a tarball or sysroot.
+
+ SCENARIO partially deploying a system
+ 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 the user attempts to partially deploy tar from cluster clusters/partial-test-cluster.morph in branch master
+ THEN morph succeeded
+ WHEN the user attempts to partially deploy sysroot from cluster clusters/partial-test-cluster.morph in branch master
+ THEN morph succeeded
+
+However, it is not possible to do this when the deployment type is
+something other than tarball or sysroot.
+
+ WHEN the user attempts to partially deploy rawdisk from cluster clusters/partial-test-cluster.morph in branch master
+ THEN morph failed
+
Deploying branch-from-image produced systems
============================================
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index 3277075..13d06ca 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -332,6 +332,29 @@ another to hold a chunk.
- copy files
EOF
+ install -m644 -D /dev/stdin << EOF "clusters/partial-test-cluster.morph"
+ name: partial-test-cluster
+ kind: cluster
+ systems:
+ - morph: systems/test-system.morph
+ deploy:
+ tar:
+ type: tar
+ location: test.tar
+ partial-deploy-components:
+ - strata/build-essential.morph
+ sysroot:
+ type: sysroot
+ location: test.sysroot
+ partial-deploy-components:
+ - strata/build-essential.morph
+ rawdisk:
+ type: rawdisk
+ location: test.img
+ partial-deploy-components:
+ - strata/build-essential.morph
+ EOF
+
git add .
git commit -m Initial.
git tag -a "test-tag" -m "Tagging test-tag"
@@ -440,7 +463,6 @@ You need an architecture to build a system, we don't default to the host archite
run_in "$DATADIR/gits/morphs" git add "$MATCH_1"
run_in "$DATADIR/gits/morphs" git commit -m "Added $MATCH_1."
-
Implementation sections for system branch operations
----------------------------------------------------
@@ -782,6 +804,15 @@ 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 partially deploy|partially deploys) (.*) from cluster (\S+) in branch (\S+)
+ cd "$DATADIR/workspace/$MATCH_4/test/morphs"
+ set -- deploy "$MATCH_3"
+ systems=$(echo "$MATCH_2" | sed -e 's/, /\n/g' -e 's/ and /\n/g')
+ echo "partial=True" >> "$DATADIR/morph.conf"
+ set -- "$@" $systems
+ 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/test/morphs"
set -- upgrade "$MATCH_3"