-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (39 loc) · 1.29 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.SILENT :
# Compose files
COMPOSE_FILES?=-f docker-compose.yml
# Deployment directory
DEPLOY_DIR?=/var/www/html/keeper.nunux.org/doc
# Deployment base URL
DEPLOY_BASE_URL:=https://keeper.nunux.org/doc/
# Include common Make tasks
root_dir:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
makefiles:=$(root_dir)/makefiles
include $(makefiles)/help.Makefile
include $(makefiles)/docker/compose.Makefile
all: help
# Get Docker binaries version
infos:
echo "Using $(shell docker --version)"
echo "Using $(shell docker-compose --version)"
.PHONY: infos
## Run the container in foreground
start:
echo "Running container..."
docker-compose $(COMPOSE_FILES) up --no-deps --no-build --abort-on-container-exit --exit-code-from doc doc
.PHONY: start
## Install as a service (needs root privileges)
install:
echo "Install generated files at deployment location..."
rm -rf $(root_dir)/themes/docdock
git init
git submodule add https://github.com/vjeantet/hugo-theme-docdock.git themes/docdock
git submodule init
git submodule update
mkdir -p $(DEPLOY_DIR)
docker run --rm \
-v $(root_dir):/usr/share/blog \
-v $(DEPLOY_DIR):/usr/share/nginx/html \
-w /usr/share/blog \
registry.gitlab.com/pages/hugo \
hugo -d /usr/share/nginx/html/ -b $(DEPLOY_BASE_URL) --cleanDestinationDir
.PHONY: install