From b38f447af715147812333a08ebdd90f8d65d3c74 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Tue, 17 Nov 2015 20:48:58 +0100 Subject: [PATCH] add makefile to build and install files This adds a makefile to build and install the files. This can be used for an easier deployment on the page. --- Makefile | 26 ++++++++++++++++++++++++++ README.md | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..32afb09 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +# install http files into this directory +HTTPDIR=/tmp/zblog +# give all files to this owner after copy +OWNER != id -u +# give all files to this group after copy +GROUP != id -g +# set this mode on all directories +DIRMODE = 554 +# set this mode on all files +FILEMODE = 444 + +.PHONY: clean install + +all: clean build + +build: + hugo + +clean: + -rm -r public/* + +install: build + cp -r public/ $(HTTPDIR)/ + find $(HTTPDIR) ! -path $(HTTPDIR) -type d -exec chmod $(DIRMODE) {} + + find $(HTTPDIR) ! -path $(HTTPDIR) -type f -exec chmod $(FILEMODE) {} + + chown -R $(OWNER):$(GROUP) $(HTTPDIR)/ diff --git a/README.md b/README.md index 47b8630..918f443 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,29 @@ documentation The documentation on the markdown format can be found on the [blackfriday](https://github.com/russross/blackfriday) project page. + +building and installation +------------------------- + +To build and install the website, use the following commands: + +``` +make clean install +``` + +The website is built automatically into the *public/* directory. + +You can also add a number of variables, to modify the installation process. + +``` +# install http files into this directory +HTTPDIR=/tmp/zblog +# give all files to this owner after copy +OWNER != id -u +# give all files to this group after copy +GROUP != id -g +# set this mode on all directories +DIRMODE = 554 +# set this mode on all files +FILEMODE = 444 +```