From 051c086b2456484c879aadc12d7ba911250316d4 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Tue, 30 Mar 2021 01:42:06 +0200 Subject: Add deployment Makefile and git hooks Signed-off-by: Denis 'GNUtoo' Carikli --- Makefile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..660f109 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +.PHONY: all apache2.tar apache2.tar.xz + +DESTDIR ?= /var/www/git.replicant.us + +all: help install-sources + +help: + @echo "Available commands:" + @echo "make help This command" + @echo "make install-sources: Install the source code to to a web root" + @echo " directory for AGPLv3+ compliance" + @echo "make install-hooks: Deploys a git hook to automatically instal the" + @echo " source code on git checkout" + +install-hooks: hooks/post-checkout + install $< -m 770 -t .git/hooks + +install-sources: apache2.tar.xz + @if [ -d $(DESTDIR) ] ; then \ + echo "Shipping the corresponding source code to $(DESTDIR)/$<" ; \ + install $< -t $(DESTDIR) ; \ + fi + +apache2.tar: + rm -f $@ + git archive HEAD \ + --format tar \ + --prefix=apache2/ \ + -o $@ + +apache2.tar.xz: apache2.tar + rm -f $@ + xz -9e --verbose $< -- cgit v1.2.3