summaryrefslogtreecommitdiff
path: root/yarns/implementations.yarn
diff options
context:
space:
mode:
Diffstat (limited to 'yarns/implementations.yarn')
-rw-r--r--yarns/implementations.yarn61
1 files changed, 47 insertions, 14 deletions
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index e1ae271f..8b43286f 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
@@ -703,7 +716,7 @@ Implementation sections for building
====================================
IMPLEMENTS WHEN the user (attempts to )?((dist)?build)s? the system (\S+) in branch (\S+)
- cd "$DATADIR/workspace/$MATCH_5"
+ cd "$DATADIR/workspace/$MATCH_5/test/morphs"
set "$MATCH_2" "$MATCH_4"
if [ "$MATCH_1" != "attempts to " ]; then run_morph "$@"
else attempt_morph "$@"; fi
@@ -712,7 +725,7 @@ Implementation sections for cross-bootstraping
==============================================
IMPLEMENTS THEN the user cross-bootstraps the system (\S+) in branch (\S+) of repo (\S+) to the arch (\S+)
- cd "$DATADIR/workspace/$MATCH_2"
+ cd "$DATADIR/workspace/$MATCH_2/test/morphs"
set -- cross-bootstrap "$MATCH_4" "$MATCH_3" "$MATCH_2" "$MATCH_1"
run_morph "$@"
@@ -723,32 +736,44 @@ 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+)
- cd "$DATADIR/workspace/$MATCH_4"
+ 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')
set -- "$@" $systems
- if [ $MATCH_1 == "deploys" ]; then run_morph "$@"
+ 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"
+ cd "$DATADIR/workspace/$MATCH_4/test/morphs"
set -- 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 "$@"
+ if [ "$MATCH_1" = "upgrades" ]; then run_morph "$@"
else attempt_morph "$@"; fi
Implementations sections for reading error messages
@@ -892,13 +917,21 @@ Implementations for building systems
------------------------------------
IMPLEMENTS THEN morph ((dist)?build) the system (\S+) of the (branch|tag) (\S+)
- cd "$DATADIR/workspace/$MATCH_5"
+ cd "$DATADIR/workspace/$MATCH_5/test/morphs"
run_morph "$MATCH_1" "$MATCH_3"
IMPLEMENTS WHEN the user builds (\S+) of the (\S+) (branch|tag)
- cd "$DATADIR/workspace/$MATCH_2"
+ cd "$DATADIR/workspace/$MATCH_2/test/morphs"
run_morph build "$MATCH_1"
+ IMPLEMENTS WHEN from the directory (\S+) the user attempts to morph build the system (\S+)
+ cd "$DATADIR/$MATCH_1"
+ attempt_morph build "$MATCH_2"
+
+ IMPLEMENTS WHEN from the directory (\S+) the user attempts to morph build the system using the absolute path to (\S+)
+ cd "$DATADIR/$MATCH_1"
+ attempt_morph build "$(pwd)/$MATCH_2"
+
Implementations for tarball inspection
--------------------------------------