-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (34 loc) · 1.08 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
include .env
CONTAINER = app
DOCKER_COMPOSE_EXISTS := $(shell command -v docker-compose 2> /dev/null)
.PHONY: start stop ps simulate ssh ssh-redis run build deps test
start:
@echo "starting application environment. will start in daemon mode. run 'make ps' for container status"
@docker-compose up -d
stop:
@docker-compose stop
ps:
@docker-compose ps
simulate:
@echo "requesting as client, from outside of container."
@source .env; go run cmd/simulation/main.go 5 ${RIDER_API_KEY} ${CLIENT_API_KEY} ${APP_URL}
ssh:
@docker-compose exec $(CONTAINER) bash
run:
@CompileDaemon -build='make build' -graceful-kill -command='./build/app'
build:
@echo "running build for development."
@CGO_ENABLED=0 go build -o build/app -v cmd/pkg/main.go
ssh-redis:
@echo "make sure to authenticate using AUTH default $REDIS_PASSWORD"
@docker compose exec redis redis-cli
deps:
${call app_container, mod vendor}
test:
${call app_container, test -v ./pkg/handler/}
#---- docker enviroment ----
ifdef DOCKER_COMPOSE_EXISTS
define app_container
@docker-compose exec ${CONTAINER} go ${1}
endef
endif