-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
113 lines (92 loc) · 2.58 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#
# See ./docs/contributing.md
#
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 := hadenlabs
REPOSITORY_DOMAIN:=github.com
REPOSITORY_OWNER:=${TEAM}
AWS_VAULT ?= ${TEAM}
PROJECT := ansible-role-pureftpd
PROJECT_PORT := 3000
PYTHON_VERSION=3.8.0
NODE_VERSION=14.15.5
PYENV_NAME="${PROJECT}"
# Configuration.
SHELL ?=/bin/bash
ROOT_DIR=$(shell pwd)
MESSAGE:=🍺️
MESSAGE_HAPPY?:="Done! ${MESSAGE}, Now Happy Hacking"
SOURCE_DIR=$(ROOT_DIR)
PROVISION_DIR:=$(ROOT_DIR)/provision
DOCS_DIR:=$(ROOT_DIR)/docs
README_TEMPLATE:=$(PROVISION_DIR)/templates/README.md.gotmpl
export README_FILE ?= README.md
export README_YAML ?= provision/generators/README.yaml
export README_INCLUDES ?= $(file://$(shell pwd)/?type=text/plain)
FILE_README:=$(ROOT_DIR)/README.md
PATH_DOCKER_COMPOSE:=docker-compose.yml -f provision/docker-compose
DOCKER_SERVICE_DEV:=app
DOCKER_SERVICE_TEST:=app
docker-compose:=$(PIPENV_RUN) docker-compose
docker-test:=$(docker-compose) -f ${PATH_DOCKER_COMPOSE}/test.yml
docker-dev:=$(docker-compose) -f ${PATH_DOCKER_COMPOSE}/dev.yml
docker-test-run:=$(docker-test) run --rm ${DOCKER_SERVICE_TEST}
docker-dev-run:=$(docker-dev) run --rm --service-ports ${DOCKER_SERVICE_DEV}
docker-yarn-run:=$(docker-dev) run --rm --service-ports ${DOCKER_SERVICE_YARN}
include provision/make/*.mk
help:
@echo '${MESSAGE} Makefile for ${PROJECT}'
@echo ''
@echo 'Usage:'
@echo ' environment create environment with pyenv'
@echo ' readme build README'
@echo ' setup install requirements'
@echo ''
@make docker.help
@make docs.help
@make test.help
@make utils.help
@make python.help
@make yarn.help
## Create README.md by building it from README.yaml
readme:
@gomplate --file $(README_TEMPLATE) \
--out $(README_FILE)
setup:
@echo "=====> install packages..."
make python.setup
make python.precommit
@cp -rf provision/git/hooks/prepare-commit-msg .git/hooks/
@[ -e ".env" ] || cp -rf .env.example .env
make yarn.setup
@echo ${MESSAGE_HAPPY}
environment:
@echo "=====> loading virtualenv ${PYENV_NAME}..."
make python.environment
@echo ${MESSAGE_HAPPY}
.PHONY: clean
clean:
@rm -f ./dist.zip
@rm -fr ./vendor
# Show to-do items per file.
todo:
@grep \
--exclude-dir=vendor \
--exclude-dir=node_modules \
--exclude-dir=bin \
--exclude=Makefile \
--text \
--color \
-nRo -E ' TODO:.*|SkipNow|FIXMEE:.*' .
.PHONY: todo