From 946bc4b8690d29964a2f20484e9af7556d19e258 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 8 Dec 2016 20:48:02 +0100 Subject: Update git-deploy --- provider/posts/blog/git-deploy.md | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/provider/posts/blog/git-deploy.md b/provider/posts/blog/git-deploy.md index af4d29b..ddda12f 100644 --- a/provider/posts/blog/git-deploy.md +++ b/provider/posts/blog/git-deploy.md @@ -30,21 +30,20 @@ done $touchedMaster || exit 0 -exec &>(logger --id=$$ -p daemon.info -t dirty-haskell) - -tmpDir=$(mktemp -d) -delTmpDir() { - cd / - rm -rvf ${tmpDir} -} - -trap delTmpDir EXIT - -git clone --branch master --depth 1 --single-branch . ${tmpDir} - -cd ${tmpDir} -nix-shell --run "dirty-haskell build" -nix-shell --run "dirty-haskell deploy" +{ + tmpDir=$(mktemp -d) + delTmpDir() { + cd / + rm -rf ${tmpDir} + } + + trap delTmpDir EXIT + + git clone --branch master --depth 1 --single-branch file://$(pwd) ${tmpDir} + + cd ${tmpDir} + nix-shell --run "dirty-haskell build && dirty-haskell deploy" +} 2>&1 | stdbuf -o 0 tr '\r' '\n' | logger --id=$$ -p daemon.info -t dirty-haskell ~~~ The script checks if the master branch was moved to a new commit or otherwise @@ -52,6 +51,10 @@ touched and, if so, clones a copy of the repo to a temporary directory and runs hakyll´s deploy command in it, which is set to rsync the compiled version to a folder where it´ll be picked up by nginx. +## Update ## + +It works. + [hakyll]: https://jaspervdj.be/hakyll/ [rsync]: https://git.samba.org/rsync.git [gitolite]: http://gitolite.com -- cgit v1.2.3