From dbbfd7148a548eb21677913483e7d79698e03d2c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 2 Dec 2024 14:17:39 +0800 Subject: Rename product to website & track the post-commit and put the hooks in its own folder. --- hooks/post-commit | 12 ++++++++++++ hooks/post-receive | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 hooks/post-commit create mode 100755 hooks/post-receive (limited to 'hooks') diff --git a/hooks/post-commit b/hooks/post-commit new file mode 100755 index 0000000..ca4d55a --- /dev/null +++ b/hooks/post-commit @@ -0,0 +1,12 @@ +#!/bin/sh + +pass=0 +cd $PWD \ + && scp hooks/post-receive \ + megapahit.net:/usr/local/git/pub/website.git/hooks/ \ + && pass=1 + +if [ $pass = 0 ] +then + exit 1 +fi diff --git a/hooks/post-receive b/hooks/post-receive new file mode 100755 index 0000000..d84579e --- /dev/null +++ b/hooks/post-receive @@ -0,0 +1,13 @@ +#!/bin/sh + +product=website +repo=/usr/local/git/pub/$product.git +web=~www/apache24/data + +unset GIT_DIR +cd $HOME/$product \ + && git pull \ + && git --git-dir=$repo --work-tree=$web checkout -f master -- \ + index.html \ + 7.1.11.53043.html \ + && git --git-dir=$repo push -- cgit v1.2.3