aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-03-30 01:42:06 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-06-08 00:39:01 +0200
commit051c086b2456484c879aadc12d7ba911250316d4 (patch)
treef4302721360f2eebd75a256905a8430de7383c4e
parent2294ad6623663c6d6c1424731d4cb7f84dfed91a (diff)
downloadetc_apache2-051c086b2456484c879aadc12d7ba911250316d4.tar.gz
etc_apache2-051c086b2456484c879aadc12d7ba911250316d4.tar.bz2
etc_apache2-051c086b2456484c879aadc12d7ba911250316d4.zip
Add deployment Makefile and git hooks
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--.gitignore4
-rw-r--r--Makefile33
-rwxr-xr-xhooks/post-checkout2
3 files changed, 39 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 40001cb..2c2a3cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,10 @@
/magic
/ports.conf
+# Ignore generated files
+/apache2.tar
+/apache2.tar.xz
+
# begin section managed by etckeeper (do not edit this section by hand)
# new and old versions of conffiles, stored by dpkg
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 $<
diff --git a/hooks/post-checkout b/hooks/post-checkout
new file mode 100755
index 0000000..2bc70e9
--- /dev/null
+++ b/hooks/post-checkout
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make