diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-05-23 16:28:21 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-06-18 14:46:59 +0000 |
commit | 64c96a31d0d7c59d37703edaa08e85b452eb7f22 (patch) | |
tree | 297139ef3710ee4ebfec7b83ae5d31113fc984e2 /yarns/implementations.yarn | |
parent | f435d78d61491e2acd3107a78eba289977938b38 (diff) | |
download | morph-64c96a31d0d7c59d37703edaa08e85b452eb7f22.tar.gz |
Add yarn tests for new deployment functionalitybaserock/adamcoldrick/deploy-specific-systems-v5
Diffstat (limited to 'yarns/implementations.yarn')
-rw-r--r-- | yarns/implementations.yarn | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 66d47bfd..b5b6a253 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -657,6 +657,14 @@ 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 deploy|deploys) (.*) from cluster (\S+) in branch (\S+) + cd "$DATADIR/workspace/$MATCH_4" + 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 "$@" + 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" @@ -694,6 +702,14 @@ The file contents is used as a `printf`(1) format string. IMPLEMENTS GIVEN a file called (\S+) containing "(.*)" printf "$MATCH_2" > "$DATADIR/$MATCH_1" +Remove a file +------------- + + IMPLEMENTS GIVEN the file(s)? (.*) (is|are) removed + cd "$DATADIR" + files=$(echo "$MATCH_2" | sed -e 's/, /\n/g' -e 's/ and /\n/g') + rm $files + Set attributes on a file or directory ------------------------------------- @@ -712,6 +728,9 @@ Check attributes of a file on the filesystem IMPLEMENTS THEN file (\S+) exists test -e "$DATADIR/$MATCH_1" + IMPLEMENTS THEN file (\S+) does not exist + test ! -e "$DATADIR/$MATCH_1" + IMPLEMENTS THEN file (\S+) has permissions (\S+) stat -c %A "$DATADIR/$MATCH_1" | grep -Fx -e "$MATCH_2" |