summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-03-26 18:59:01 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-03-29 16:55:50 +0000
commita7f12476d4e7b2025a60be58027b67b9e551f31b (patch)
tree8a5de760ab7281368d11a25c659780d3aea3539f /yarns
parent9404317020ff0455cbfd3ca7976d546af823759b (diff)
downloadmorph-a7f12476d4e7b2025a60be58027b67b9e551f31b.tar.gz
Add support for definitions version 8
This code is a rework from changes done by: - Tiago Gomes <tiago.gomes@codethink.co.uk> https://storyboard.baserock.org/#!/story/86 Change-Id: I3475c2bcb648a272fee33bc878a521f79d4e6581
Diffstat (limited to 'yarns')
-rw-r--r--yarns/building.yarn8
-rw-r--r--yarns/implementations.yarn56
2 files changed, 63 insertions, 1 deletions
diff --git a/yarns/building.yarn b/yarns/building.yarn
index 9284f7cf..1b981490 100644
--- a/yarns/building.yarn
+++ b/yarns/building.yarn
@@ -89,6 +89,14 @@ Morph Building Tests
AND there are 2 artifacts named core-runtime in the cache
FINALLY the git server is shut down
+ SCENARIO test recursive submodules overriding urls
+ GIVEN a git server
+ GIVEN a chunk with recursive submodules
+ WHEN the user clones definitions
+ WHEN the user attempts to build the system systems/test-system.morph in branch master
+ THEN morph succeeded
+ FINALLY the git server is shut down
+
System integrations
-------------------
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index 06380e7f..186fe316 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -45,6 +45,60 @@ locally, which we'll tell Morph to access using `file:` URLs. Specifically,
we'll create a repository to hold system and stratum morphologies, and
another to hold a chunk.
+ IMPLEMENTS GIVEN a chunk with recursive submodules
+ mkdir "$DATADIR/gits/grandchild-chunk"
+ cd "$DATADIR/gits/grandchild-chunk"
+ git init .
+ touch grandchild-file
+ git add .
+ git commit -m "Initial commit"
+
+ mkdir "$DATADIR/gits/child-chunk"
+ cd "$DATADIR/gits/child-chunk"
+ git init .
+ touch child-file
+ git add .
+ git commit -m "Initial commit"
+ git submodule add -b master file://$DATADIR/gits/grandchild-chunk
+ sed -i -e 's#file://$DATADIR/gits/granchild-chunk#fake/location#' .gitmodules
+ git add .
+ git commit -m "Initial submodule"
+
+ mkdir "$DATADIR/gits/chunk-with-submodules"
+ cd "$DATADIR/gits/chunk-with-submodules"
+ git init .
+ git add .
+ git commit --allow-empty -m "Initial commit"
+ git submodule add -b master file://$DATADIR/gits/child-chunk
+ sed -i -e 's#file://$DATADIR/gits/child-chunk#fake/location#' .gitmodules
+ git add .
+ git commit -m "Add submodule"
+
+ cd "$DATADIR/gits/definitions"
+ echo "version: 8" > VERSION
+ cat << EOF >> strata/core.morph
+ - name: chunk-with-submodules
+ morph: chunk-with-submodules.morph
+ repo: test:chunk-with-submodules
+ ref: master
+ submodules:
+ grandchild-chunk:
+ url: file://$DATADIR/gits/grandchild-chunk
+ child-chunk:
+ url: file://$DATADIR/gits/child-chunk
+ EOF
+
+ cat << EOF >> chunk-with-submodules.morph
+ name: chunk-with-submodules
+ kind: chunk
+ build-system: manual
+ build-commands:
+ - file exists child-chunk/child-file
+ - file exists child-chunk/grandchild-chunk/grandchild-file
+ EOF
+ git add .
+ git commit -m "Add moar stuff"
+
IMPLEMENTS GIVEN a git server
# Create a directory for all the git repositories.
@@ -216,7 +270,7 @@ another to hold a chunk.
mkdir "$DATADIR/gits/definitions"
cd "$DATADIR/gits/definitions"
git init .
- echo 'version: 7' > VERSION
+ echo 'version: 8' > VERSION
install -m644 -D /dev/stdin << EOF "DEFAULTS"
# This is a simplified version of the DEFAULTS file supplied with the