forked from luismayta/challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (62 loc) · 2.05 KB
/
Makefile
File metadata and controls
73 lines (62 loc) · 2.05 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
73
#
# See ./CONTRIBUTING.rst
#
OS := $(shell uname)
.PHONY: help
.DEFAULT_GOAL := help
HAS_PIP := $(shell command -v pip;)
HAS_PIPENV := $(shell command -v pipenv;)
ifdef HAS_PIPENV
PIPENV_RUN:=pipenv run
PIPENV_INSTALL:=pipenv install
else
PIPENV_RUN:=
PIPENV_INSTALL:=
endif
TEAM:=equipindustry
PROJECT := challenge
PROJECT_PORT := 8000
PYTHON_VERSION=3.8.0
PYENV_NAME="${PROJECT}"
# Configuration.
SHELL ?=/bin/bash
ROOT_DIR=$(shell pwd)
MESSAGE:=🍺️
MESSAGE_HAPPY:="Done! ${MESSAGE}, Now Happy Hacking"
SOURCE_DIR=$(ROOT_DIR)/
FRONTEND_DIR=$(ROOT_DIR)/frontend
FILE_README:=$(ROOT_DIR)/README.rst
include provision/make/*.mk
help:
@echo '${MESSAGE} Makefile for ${PROJECT}'
@echo ''
@echo 'Usage:'
@echo ' environment create environment with pyenv'
@echo ' clean remove files of build'
@echo ' setup install requirements'
@echo ''
@make backend.help
@make docs.help
clean:
@echo "=====> clean files unnecessary for ${TEAM}..."
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 "=====> end clean files unnecessary for ${TEAM}..."
setup: clean
@echo "=====> install packages..."
$(PIPENV_INSTALL) --dev --skip-lock
$(PIPENV_RUN) pre-commit install && pre-commit install -t pre-push
@cp -rf provision/git/hooks/prepare-commit-msg .git/hooks/
@[[ -e ".env" ]] || cp -rf .env.example .env
@echo ${MESSAGE_HAPPY}
environment: clean
@echo "=====> loading virtualenv ${PYENV_NAME}..."
@pipenv --venv || $(PIPENV_INSTALL) --skip-lock --python=${PYTHON_VERSION}
@echo ${MESSAGE_HAPPY}