Browse Source

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.
Gibheer 3 years ago
parent
commit
b38f447af7
2 changed files with 52 additions and 0 deletions
  1. 26
    0
      Makefile
  2. 26
    0
      README.md

+ 26
- 0
Makefile View File

@@ -0,0 +1,26 @@
1
+# install http files into this directory
2
+HTTPDIR=/tmp/zblog
3
+# give all files to this owner after copy
4
+OWNER != id -u
5
+# give all files to this group after copy
6
+GROUP != id -g
7
+# set this mode on all directories
8
+DIRMODE = 554
9
+# set this mode on all files
10
+FILEMODE = 444
11
+
12
+.PHONY: clean install
13
+
14
+all: clean build
15
+
16
+build:
17
+	hugo
18
+
19
+clean:
20
+	-rm -r public/*
21
+
22
+install: build
23
+	cp -r public/ $(HTTPDIR)/
24
+	find $(HTTPDIR) ! -path $(HTTPDIR) -type d -exec chmod $(DIRMODE) {} +
25
+	find $(HTTPDIR) ! -path $(HTTPDIR) -type f -exec chmod $(FILEMODE) {} +
26
+	chown -R $(OWNER):$(GROUP) $(HTTPDIR)/

+ 26
- 0
README.md View File

@@ -24,3 +24,29 @@ documentation
24 24
 
25 25
 The documentation on the markdown format can be found on the [blackfriday](https://github.com/russross/blackfriday)
26 26
 project page.
27
+
28
+building and installation
29
+-------------------------
30
+
31
+To build and install the website, use the following commands:
32
+
33
+```
34
+make clean install
35
+```
36
+
37
+The website is built automatically into the *public/* directory.
38
+
39
+You can also add a number of variables, to modify the installation process.
40
+
41
+```
42
+# install http files into this directory
43
+HTTPDIR=/tmp/zblog
44
+# give all files to this owner after copy
45
+OWNER != id -u
46
+# give all files to this group after copy
47
+GROUP != id -g
48
+# set this mode on all directories
49
+DIRMODE = 554
50
+# set this mode on all files
51
+FILEMODE = 444
52
+```