-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
66 lines (52 loc) · 1.52 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
.SILENT:
.DEFAULT_GOAL := help
COLOR_RESET = \033[0m
COLOR_COMMAND = \033[36m
COLOR_YELLOW = \033[33m
COLOR_GREEN = \033[32m
COLOR_RED = \033[31m
PROJECT := huskyCI-dashboard
## Builds static files from react app.
build:
yarn build
## Creates a container image based on most recent dashboard code
build-container:
docker build . -t huskyci/dashboard:latest
## Checks for vulnerabilities using audit command.
check-sec:
yarn audit
## Creates environment variable for local development.
generate-local-env:
chmod +x generate-local-env.sh
./generate-local-env.sh
## Shows this 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"
## Installs locally using install command.
install: generate-local-env
yarn install -f
## Push dashboard container to hub.docker
push-container:
chmod +x push-container.sh
./push-container.sh
## Runs locally using start command.
run:
yarn start
## Builds and starts dashboard add using huskyci/dashboard container
run-container: build-container start-container
## Runs a full test into project.
test:
yarn test
## Starts huskyci/dashboard container
start-container:
docker run -p 8080:80 huskyci/dashboard