-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (51 loc) · 1.36 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.SILENT:
COLOR_RESET = \033[0m
COLOR_GREEN = \033[32m
COLOR_YELLOW = \033[33m
PROJECT_NAME = `basename $(PWD)`
USER_UID = `id -u`
VERSION = `cat VERSION`
PORT = 8888
IMAGE = "tw/$(PROJECT_NAME):$(VERSION)"
.DEFAULT_GOAL = help
## Prints this help
help:
printf "${COLOR_YELLOW}\n${PROJECT_NAME}\n\n${COLOR_RESET}"
awk '/^[a-zA-Z\-\_0-9\. %]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf "${COLOR_GREEN}$$ make %s${COLOR_RESET} %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
printf "\n"
## Installs the project build environment
setup:
pip3 install -r requirements.local.txt
## Run tests in Docker
test_docker: setup
fab test
## Run tests in venv
test: setup
fab test:env=venv
## Start a jupyter notebook instance with the project
jupyter:
echo "Building version $(VERSION)"
docker run -it --rm \
-p $(PORT):8888 \
--user $(USER_UID) --group-add users \
-e USERNAME="jovyan" \
-e TZ=America/Sao_Paulo \
-v $(PWD):/home/jovyan \
jupyter/base-notebook
## Generate a new release and tag
release:
fab release
## Build sphinx documentation on local virtualenv
doc:
fab doc:env=virtualenv
## Build sphinx documentation on Docker
doc_docker:
fab doc:env=docker