-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
80 lines (70 loc) · 2.26 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#
# See ./CONTRIBUTING.rst
#
OS := $(shell uname)
.PHONY: help build up requirements clean lint test help
.DEFAULT_GOAL := help
PROJECT := luca
PROJECT_PORT := 8000
PYTHON_VERSION=3.6.4
PYENV_NAME="${PROJECT}"
# Configuration.
SHELL := /bin/bash
ROOT_DIR=$(shell pwd)
MESSAGE:=🍺️
MESSAGE_HAPPY:="${MESSAGE} Happy Coding"
SOURCE_DIR=$(ROOT_DIR)/
REQUIREMENTS_DIR=$(ROOT_DIR)/requirements
PROVISION_DIR:=$(ROOT_DIR)/provision
FILE_README:=$(ROOT_DIR)/README.rst
KEYS_DIR:="${HOME}/.ssh"
PATH_DOCKER_COMPOSE:=provision/docker-compose
pip_install := pip install -r
docker-compose:=docker-compose -f docker-compose.yml
include extras/make/*.mk
help:
@echo '${MESSAGE} Makefile for ${PROJECT}'
@echo ''
@echo 'Usage:'
@echo ' stage create stage with pyenv'
@echo ' clean remove files of build'
@echo ' setup install requirements'
@echo ''
@make alias.help
@make docker.help
@make docs.help
@make flask.help
@make test.help
@make package.help
@make terraform.help
@make terragrunt.help
@make zappa.help
clean:
@echo "$(TAG)"Cleaning up"$(END)"
ifneq (Darwin,$(OS))
@sudo rm -rf .tox *.egg *.egg-info dist build .coverage .eggs .mypy_cache
@sudo rm -rf docs/build
@sudo find . -name '__pycache__' -delete -print -o -name '*.pyc' -delete -print -o -name '*.pyo' -delete -print -o -name '*~' -delete -print -o -name '*.tmp' -delete -print
else
@rm -rf .tox *.egg *.egg-info dist build .coverage .eggs .mypy_cache
@rm -rf docs/build
@find . -name '__pycache__' -delete -print -o -name '*.pyc' -delete -print -o -name '*.pyo' -delete -print -o -name '*~' -delete -print -o -name '*.tmp' -delete -print
endif
@echo
setup: clean
$(pip_install) "${REQUIREMENTS_DIR}/setup.txt"
@if [ -e "${REQUIREMENTS_DIR}/private.txt" ]; then \
$(pip_install) "${REQUIREMENTS_DIR}/private.txt"; \
fi
pre-commit install
cp -rf .hooks/prepare-commit-msg .git/hooks/
@if [ ! -e ".env" ]; then \
cp -rf .env-sample .env;\
fi
environment: clean
@if [ -e "$(HOME)/.pyenv" ]; then \
eval "$(pyenv init -)"; \
eval "$(pyenv virtualenv-init -)"; \
fi
pyenv virtualenv "${PYTHON_VERSION}" "${PYENV_NAME}" >> /dev/null 2>&1 || echo $(MESSAGE_HAPPY)
pyenv activate "${PYENV_NAME}" >> /dev/null 2>&1 || echo $(MESSAGE_HAPPY)