forked from VeryBigThings/elixir_common
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (33 loc) · 1.14 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
.PHONY: devstack devstack-build devstack-clean devstack-shell help
DEFAULT_GOAL: help
export LOCAL_USER_ID ?= $(shell id -u $$USER)
# -----------------------
# --- DOCKER DEVSTACK ---
# -----------------------
## Builds the development Docker image
devstack-build:
@docker-compose build
## Stops all development containers
devstack-clean:
@docker-compose down -v
## Starts all development containers in the foreground
devstack: devstack-build
@docker-compose up
## Spawns an interactive Bash shell in development web container
devstack-shell:
@docker exec -e COLUMNS="`tput cols`" -e LINES="`tput lines`" -u ${LOCAL_USER_ID} -it $$(docker-compose ps -q web) /bin/bash -c "reset -w && /bin/bash"
# ------------
# --- HELP ---
# ------------
## Shows the help menu
help:
@echo "Please use \`make <target>' where <target> is one of\n\n"
@awk '/^[a-zA-Z\-\_\/0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf "%-30s %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)