-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (61 loc) · 1.51 KB
/
Makefile
File metadata and controls
72 lines (61 loc) · 1.51 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# bumpup version here.
VERSION := 1.5
SPHINX_VERSION := 1.8.4
USER := makotow
# container image name and repository information
IMAGE_NAME := sphinx-docker
TAG := $(VERSION)-sphinx$(SPHINX_VERSION)
REGISTRY := $(USER)/$(IMAGE_NAME)
CONTAINER_PORT := 8000
CONTAINER_WORK_DIR := /docs/
# sphinx specific variable
DOC_DIR := docs
WORK_DIR := $(CURDIR)/$(DOC_DIR)
# sphinx autobuild parameters
SRC_DIR := source
OUTPUT_DIR := build/html
PORT := 8000
## Shortcuts
i: init
ab: auto-build-sphinx
b: build-sphinx
c: clean
## for sphinx operation
.PHONY: init
init:
docker run \
-v "$(WORK_DIR)":$(CONTAINER_WORK_DIR) \
--rm -it \
$(REGISTRY):$(TAG) \
sphinx-quickstart
.PHONY: auto-build-sphinx
auto-build-sphinx:
docker run -p $(PORT):$(CONTAINER_PORT) \
-v "$(WORK_DIR)":$(CONTAINER_WORK_DIR) \
--rm -it \
$(REGISTRY):$(TAG) \
sphinx-autobuild --host 0.0.0.0 $(SRC_DIR) $(OUTPUT_DIR)
### Dockerfile default command is build
.PHONY: build-sphinx
build-sphinx:
docker run \
-v "$(WORK_DIR)":$(CONTAINER_WORK_DIR) \
--rm -it \
$(REGISTRY):$(TAG)
.PHONY: clean
clean:
docker run \
-v "$(WORK_DIR)":$(CONTAINER_WORK_DIR) \
--rm -it \
$(REGISTRY):$(TAG) \
make clean
TOPIC_BRANCH = hot-fix-`date +%Y%m%d`
.PHONY: new-topic
new-topic:
git checkout -b ${TOPIC_BRANCH}
.PHONY: merge-upstream
merge-upstream:
git fetch upstream
git checkout master
git merge upstream/master --no-edit
git push origin master