-
Notifications
You must be signed in to change notification settings - Fork 446
/
Copy pathMakefile
49 lines (40 loc) · 1.55 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
# This is a Makefile template!
.SILENT:
.DEFAULT_GOAL := help
#If your app is written in golang, add the following lines to set GOPATH
GO ?= go
GOROOT ?= $(shell $(GO) env GOROOT)
GOPATH ?= $(shell $(GO) env GOPATH)
GOBIN ?= $(GOPATH)/bin
COLOR_RESET = \033[0m
COLOR_COMMAND = \033[36m
COLOR_YELLOW = \033[33m
COLOR_GREEN = \033[32m
COLOR_RED = \033[31m
PROJECT := #Add your project's name here!
PORT := #The port your app uses! If possible, make sure the port matches the app's topic number. As an example, if your app fits in the A6 category, it would be great if your port were 10006! :)
SLEEPUNTILAPPSTARTS := 45
## Installs a development environment using docker-compose
install: compose msg
## Run project using docker-compose
compose: compose-down
docker-compose -f deployments/docker-compose.yml up -d --build --force-recreate
compose-down:
docker-compose -f deployments/docker-compose.yml down -v --remove-orphans
## Prints initialization message after compose phase - You can find that the check-init.sh script is also in the docs folder.
msg:
chmod +x deployments/check-init.sh
./deployments/check-init.sh
## Prints help message
help:
printf "\n${COLOR_YELLOW}${PROJECT}\n------\n${COLOR_RESET}"
awk '/^[a-zA-Z\-\_0-9\.%]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf "${COLOR_COMMAND}$$ make %s${COLOR_RESET} %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST) | sort
printf "\n"