diff options
Diffstat (limited to 'yarns/implementations.yarn')
-rw-r--r-- | yarns/implementations.yarn | 75 |
1 files changed, 54 insertions, 21 deletions
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 9f23107b..8ba23b97 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -67,7 +67,7 @@ Tests for things other than `morph init` just want to have a workspace created. IMPLEMENTS GIVEN a workspace - run_morph init "$DATADIR/workspace" + : Implementation sections related to a simulated Trove ---------------------------------------------------- @@ -522,10 +522,11 @@ Checkout out an existing system branch. We parameterise this so the same phrase can be used to check out any system branch. IMPLEMENTS WHEN the user (attempts to check|checks) out the system (branch|tag) called (\S+) - cd "$DATADIR/workspace" - set checkout test:morphs "$MATCH_3" - if [ $MATCH_1 == "checks" ]; then run_morph "$@" - else attempt_morph "$@"; fi + : + #cd "$DATADIR/workspace" + #set checkout test:morphs "$MATCH_3" + #if [ $MATCH_1 == "checks" ]; then run_morph "$@" + #else attempt_morph "$@"; fi Attempt to check out a system branch from a root that has no systems. @@ -533,6 +534,8 @@ Attempt to check out a system branch from a root that has no systems. cd "$DATADIR/workspace" attempt_morph checkout test:test-chunk master +FIXME + IMPLEMENTS WHEN the user attempts to check out the system branch from (\S+) called (\S+) cd "$DATADIR/workspace" attempt_morph branch-from-image --metadata-dir "$DATADIR/$MATCH_1/baserock" "$MATCH_2" @@ -621,10 +624,12 @@ To produce buildable morphologies, we need them to be of the same architecture as the machine doing the testing. This uses `morph print-architecture` to get a value appropriate for morph. +FIXME + IMPLEMENTS WHEN the user creates an uncommitted system morphology called (\S+) for our architecture in system branch (\S+) arch=$(run_morph print-architecture) name="$(basename "${MATCH_1%.*}")" - install -m644 -D /dev/stdin << EOF "$DATADIR/workspace/$MATCH_2/test/morphs/$MATCH_1" + install -m644 -D /dev/stdin << EOF "$DATADIR/definitions/$MATCH_1" arch: $arch configuration-extensions: [] description: A system called $name for architectures $arch @@ -727,8 +732,10 @@ Generating a manifest. fi die "Expected CSV manifest not found" +FIXME + IMPLEMENTS WHEN the user commits all changes in system branch (\S+) - cd "$DATADIR/workspace/$MATCH_1/test/morphs" + cd "$DATADIR/definitions" git commit -a --allow-empty -m 'Commit all changes' Implementations for `morph certify` @@ -812,14 +819,18 @@ Implementations for temporary build branch handling Implementation sections for building ==================================== +FIXME + IMPLEMENTS WHEN the user (attempts to )?((dist)?build)s? the system (\S+) in branch (\S+) - cd "$DATADIR/workspace/$MATCH_5/test/morphs" + cd "$DATADIR/definitions" set "$MATCH_2" "$MATCH_4" if [ "$MATCH_1" != "attempts to " ]; then run_morph "$@" else attempt_morph "$@"; fi +FIXME + IMPLEMENTS WHEN the user (attempts to )?((dist)?build)s? (\S+) from the system (\S+) in branch (\S+) - cd "$DATADIR/workspace/$MATCH_6/test/morphs" + cd "$DATADIR/definitions" set "$MATCH_2" "$MATCH_5" "$MATCH_4" if [ "$MATCH_1" != "attempts to " ]; then run_morph "$@" else attempt_morph "$@"; fi @@ -828,7 +839,7 @@ Implementation sections for cross-bootstrapping =============================================== IMPLEMENTS THEN the user cross-bootstraps the system (\S+) in branch (\S+) of repo (\S+) to the arch (\S+) - cd "$DATADIR/workspace/$MATCH_2/test/morphs" + cd "$DATADIR/definitions" set -- cross-bootstrap "$MATCH_4" "$MATCH_3" "$MATCH_2" "$MATCH_1" run_morph "$@" @@ -839,12 +850,14 @@ 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. +FIXME + 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" + cd "$DATADIR/definitions" fi if [ "$MATCH_5" != "" ] @@ -861,8 +874,10 @@ them, so they can be added to the end of the implements section. if [ "$MATCH_3" = "deploys" ]; then run_morph "$@" else attempt_morph "$@"; fi +FIXME + IMPLEMENTS WHEN the user (attempts to deploy|deploys) (.*) from cluster (\S+) in branch (\S+) - cd "$DATADIR/workspace/$MATCH_4/test/morphs" + cd "$DATADIR/definitions" set -- deploy "$MATCH_3" systems=$(echo "$MATCH_2" | sed -e 's/, /\n/g' -e 's/ and /\n/g') set -- "$@" $systems @@ -878,8 +893,10 @@ them, so they can be added to the end of the implements section. if [ "$MATCH_1" = "partially deploys" ]; then run_morph "$@" else attempt_morph "$@"; fi +FIXME + IMPLEMENTS WHEN the user (attempts to upgrade|upgrades) the (system|cluster) (\S+) in branch (\S+)( with options (.*))? - cd "$DATADIR/workspace/$MATCH_4/test/morphs" + cd "$DATADIR/definitions" set -- upgrade "$MATCH_3" if [ "$MATCH_5" != '' ]; then # eval used so word splitting in the text is preserved @@ -1028,8 +1045,10 @@ variables in `$DATADIR/env`. We treat the value as a format string for Implementations for building systems ------------------------------------ +FIXME + IMPLEMENTS THEN morph ((dist)?build) the system (\S+) of the (branch|tag) (\S+) - cd "$DATADIR/workspace/$MATCH_5/test/morphs" + cd "$DATADIR/definitions" run_morph "$MATCH_1" "$MATCH_3" IMPLEMENTS WHEN the user builds (\S+) of the (\S+) (branch|tag) @@ -1087,26 +1106,34 @@ Altering morphologies in the workspace "$SRCDIR/scripts/edit-morph" set-stratum-match-rules \ "$MATCH_1" "$MATCH_3" +FIXME + IMPLEMENTS WHEN chunk (\S+) in stratum (\S+) in system branch (\S+) is updated to use (\S+) from chunk repository (\S+) - cd "$DATADIR/workspace/$MATCH_3/test/morphs" + cd "$DATADIR/definitions" sha1=$(cd "$DATADIR/gits/$MATCH_5" && git rev-parse "$MATCH_4") "$SRCDIR/scripts/edit-morph" update-stratum-chunk-ref \ "$MATCH_2" "$MATCH_1" "$sha1" ### Altering clusters ### +FIXME + IMPLEMENTS GIVEN a cluster called (\S+) in system branch (\S+) name="$MATCH_1" branch="$MATCH_2" "$SRCDIR/scripts/edit-morph" cluster-init \ - "$DATADIR/workspace/$branch/test/morphs/$name" + "$DATADIR/definitions/$name" + +FIXME IMPLEMENTS GIVEN a (sub)?system in cluster (\S+) in branch (\S+) called (\S+) cluster="$MATCH_2" branch="$MATCH_3" name="$MATCH_4" "$SRCDIR/scripts/edit-morph" cluster-system-init \ - "$DATADIR/workspace/$branch/test/morphs/$cluster" "$name" + "$DATADIR/definitions/$cluster" "$name" + +FIXME IMPLEMENTS GIVEN (sub)?system (\S+) in cluster (\S+) in branch (\S+) builds (\S+) name="$MATCH_2" @@ -1114,27 +1141,33 @@ Altering morphologies in the workspace branch="$MATCH_4" morphology="$MATCH_5" "$SRCDIR/scripts/edit-morph" cluster-system-set-morphology \ - "$DATADIR/workspace/$branch/test/morphs/$cluster" "$name" \ + "$DATADIR/definitions/$cluster" "$name" \ "$morphology" +FIXME + IMPLEMENTS GIVEN (sub)?system (\S+) in cluster (\S+) in branch (\S+) has deployment type: (\S+) name="$MATCH_2" cluster="$MATCH_3" branch="$MATCH_4" type="$MATCH_5" "$SRCDIR/scripts/edit-morph" cluster-system-set-deploy-type \ - "$DATADIR/workspace/$branch/test/morphs/$cluster" "$name" \ + "$DATADIR/definitions/$cluster" "$name" \ "$type" +FIXME + IMPLEMENTS GIVEN (sub)?system (\S+) in cluster (\S+) in branch (\S+) has deployment location: (\S+) name="$MATCH_2" cluster="$MATCH_3" branch="$MATCH_4" location="$MATCH_5" "$SRCDIR/scripts/edit-morph" cluster-system-set-deploy-location \ - "$DATADIR/workspace/$branch/test/morphs/$cluster" "$name" \ + "$DATADIR/definitions/$cluster" "$name" \ "$location" +FIXME + IMPLEMENTS GIVEN (sub)?system (\S+) in cluster (\S+) in branch (\S+) has deployment variable: ([^=]+)=(.*) name="$MATCH_2" cluster="$MATCH_3" @@ -1142,7 +1175,7 @@ Altering morphologies in the workspace key="$MATCH_5" val="$MATCH_6" "$SRCDIR/scripts/edit-morph" cluster-system-set-deploy-variable \ - "$DATADIR/workspace/$branch/test/morphs/$cluster" "$name" \ + "$DATADIR/definitions/$cluster" "$name" \ "$key" "$val" |