-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
47 lines (33 loc) · 955 Bytes
/
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
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help
NODE_ENV ?= development
export NODE_ENV
APP_VOLUME=${PWD}:/app
NODE_IMAGE=node:lts-alpine
USERID=$(shell id -u)
DOCKER_RUN = docker run \
--volume "${APP_VOLUME}" \
--workdir /app \
--env NODE_ENV \
--user ${USERID}:${USERID} \
--rm \
--tty \
--interactive
DOCKER_RUN_NODE = ${DOCKER_RUN} \
${NODE_IMAGE}
install: ## install dependencies
${DOCKER_RUN_NODE} yarn install
upgrade-interactive: ## upgrade-interactive dependencies
${DOCKER_RUN_NODE} yarn upgrade-interactive
lint: ## scss and js linter
${DOCKER_RUN_NODE} yarn lint
build: ## build
${DOCKER_RUN_NODE} yarn build
build-watch: ## build with watch
${DOCKER_RUN_NODE} yarn start
test: ## run test
${DOCKER_RUN_NODE} yarn test
test--watch: ## run test
${DOCKER_RUN_NODE} yarn test:watch