-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
103 lines (83 loc) · 2.35 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
#
# 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 := luismayta
REPOSITORY_DOMAIN:=github.com
REPOSITORY_OWNER:=${TEAM}
AWS_VAULT ?= ${TEAM}
PROJECT := zsh-notify
PYTHON_VERSION=3.8.0
NODE_VERSION=14.15.5
PYENV_NAME="${PROJECT}"
GIT_IGNORES:=python,node,go,zsh
GI:=gi
# 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.tpl.md
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
## Display help for all targets
.PHONY: help
help:
@echo '${MESSAGE} Makefile for ${PROJECT}'
@echo ''
@awk '/^.PHONY: / { \
msg = match(lastLine, /^## /); \
if (msg) { \
cmd = substr($$0, 9, 100); \
msg = substr(lastLine, 4, 1000); \
printf " ${GREEN}%-30s${RESET} %s\n", cmd, msg; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
## Create README.md by building it from README.yaml
.PHONY: readme
readme:
@gomplate --file $(README_TEMPLATE) \
--out $(README_FILE)
## setup dependences of project
.PHONY: setup
setup:
@echo "==> install packages..."
make python.setup
make python.precommit
@[ -e ".env" ] || cp -rf .env.example .env
make yarn.setup
make git.setup
@echo ${MESSAGE_HAPPY}
## setup environment of project
.PHONY: environment
environment:
@echo "==> loading virtualenv ${PYENV_NAME}..."
make python.environment
@echo ${MESSAGE_HAPPY}