-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (41 loc) · 1.4 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
SHELL := /bin/bash
.DEFAULT_GOAL := help
###########################
# VARIABLES
###########################
BUILD_ENV := NONE
###########################
# MAPPINGS
###########################
DOCKER_COMPOSE_NONE :=
DOCKER_COMPOSE_COMPOSE := docker-compose run dev
DOCKER_COMPOSE := $(DOCKER_COMPOSE_$(BUILD_ENV))
###########################
# TARGETS
###########################
.PHONY: help
help: ## help target to show available commands with information
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: build
build: ## build vue.js app => /dist
yarn && yarn run build
.PHONY: start
start: ## start vue.js app
yarn && yarn run start
.PHONY: information
information: ## echo some build information
@echo 'set build env to $(BUILD_ENV) and DOCKER_COMPOSE to $(DOCKER_COMPOSE)'
@echo 'use make -e BUILD_ENV=COMPOSE <target> for using docker-compose build environment'
.PHONY: markdownlint
markdownlint: information ## Validate markdown files
$(DOCKER_COMPOSE) npx markdownlint .github/ --ignore node_modules
$(DOCKER_COMPOSE) npx markdownlint . --ignore node_modules
.PHONY: bootstrap
bootstrap: ## Build Container
@if [ $(BUILD_ENV) = "COMPOSE" ]; then\
docker-compose build;\
fi
$(DOCKER_COMPOSE) npm ci
.PHONY: shell
shell: ## Open shell with dev dependencies installed in zsh
docker-compose run dev zsh