diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2014-08-28 14:00:52 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2014-08-28 14:00:52 +0000 |
commit | 9c0011417081326ebb72d9ed02fcbbc456946dc4 (patch) | |
tree | 5ea1ba505bb50ee616567f74551aadb2b51fa0d3 /yarns/implementations.yarn | |
parent | 8c9aea626d1308a876d145d379ac5f23905fa9b4 (diff) | |
parent | 1edbc9f5c08daafb3e13131dfc8df656b2a02edc (diff) | |
download | morph-9c0011417081326ebb72d9ed02fcbbc456946dc4.tar.gz |
Merge branch 'baserock/richardmaw/yarn-git-daemon'
Reviewed-by: Lars Wirzenius (git-daemon)
Reviewed-by: Sam Thursfield (yarn fixup)
Diffstat (limited to 'yarns/implementations.yarn')
-rw-r--r-- | yarns/implementations.yarn | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index d2e72ccf..422c2eea 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -258,12 +258,25 @@ another to hold a chunk. run_in "$DATADIR/gits/morphs" git commit -m Initial. run_in "$DATADIR/gits/morphs" git tag -a "test-tag" -m "Tagging test-tag" + # Start a git daemon to serve our git repositories + port_file="$DATADIR/git-daemon-port" + pid_file="$DATADIR/git-daemon-pid" + mkfifo "$port_file" + # git-daemon needs --foo=bar style arguments so we do that for consistency + start-stop-daemon --start --pidfile="$pid_file" --background \ + --make-pidfile --verbose \ + --startas="$SRCDIR/scripts/git-daemon-wrap" -- \ + --port-file="$port_file" \ + --export-all --verbose --base-path="$DATADIR/gits" \ + --enable=receive-pack #allow push + GIT_DAEMON_PORT="$(cat "$port_file")" + # Create the Morph configuration file so we can access the repos # using test:foo URL aliases. cat << EOF > "$DATADIR/morph.conf" [config] - repo-alias = test=file://$DATADIR/gits/%s#file://$DATADIR/gits/%s + repo-alias = test=git://127.0.0.1:$GIT_DAEMON_PORT/%s#git://127.0.0.1:$GIT_DAEMON_PORT/%s cachedir = $DATADIR/cache tempdir = $DATADIR/tmp trove-host= [] @@ -272,6 +285,15 @@ another to hold a chunk. mkdir "$DATADIR/cache" mkdir "$DATADIR/tmp" +Some resources are cleaned up by yarn, forked processes aren't one of +these, so need to shut down the git daemon after we finish. + + IMPLEMENTS FINALLY the git server is shut down + pid_file="$DATADIR/git-daemon-pid" + if [ -e "$pid_file" ]; then + start-stop-daemon --stop --pidfile "$pid_file" --oknodo + fi + We need a consistent value for the architecture in some tests, so we have a morphology using the test architecture. @@ -383,7 +405,8 @@ Attempt to branch a system branch from a root that had no systems. Pushing all changes in a system branch checkout to the git server. IMPLEMENTS WHEN the user pushes the system branch called (\S+) to the git server - run_in "$DATADIR/workspace/$MATCH_1/" morph foreach -- sh -c 'git push -u origin HEAD 2>&1' + cd "$DATADIR/workspace/$MATCH_1/" + run_morph foreach -- sh -c 'git push -u origin HEAD 2>&1' Report workspace path. |