]> gitweb.fluxo.info Git - puppet-bootstrap.git/commitdiff
Adds git hooks for push-to-deploy
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 20 Aug 2015 12:41:35 +0000 (09:41 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 20 Aug 2015 12:41:35 +0000 (09:41 -0300)
Makefile
bin/post-receive [new file with mode: 0755]
bin/post-update [new file with mode: 0755]

index b86991867fddfceca0c71997e45208f54aeef49a..71eb0e17503c79c6d2a901f3b736d01cdccb9264 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -57,3 +57,11 @@ clean:
        rm -rf ssl
        rm -rf modules
        git checkout modules
+
+post_update:
+       git config receive.denyCurrentBranch ignore
+       cd .git/hooks && ln -sf ../../bin/post-update
+
+post_receive:
+       git config receive.denyCurrentBranch ignore
+       cd .git/hooks && ln -sf ../../bin/post-receive
diff --git a/bin/post-receive b/bin/post-receive
new file mode 100755 (executable)
index 0000000..996189d
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+cd ..
+unset GIT_DIR
+
+git checkout -f
+git submodule update --init --recursive
diff --git a/bin/post-update b/bin/post-update
new file mode 100755 (executable)
index 0000000..48a6a16
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+cd ..
+unset GIT_DIR
+
+if [ -d ".git/annex" ]; then
+  git annex sync
+else
+  git reset HEAD
+  git checkout -f
+fi
+
+git submodule update --init --recursive
+
+cd -
+exec git update-server-info