-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (39 loc) · 1 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
UID=$(shell id -u)
GID=$(shell id -g)
APP_SERVICE=myapp
TCP_SERVER_MOCK=tcp_server
DUMMY_API=dummy_api
init: erase cache-folders build git-hooks start
erase:
docker compose down -v
build:
docker compose build --no-cache && \
docker compose pull
start:
docker compose up -d
stop:
docker compose stop
bash:
docker compose run --rm -u ${UID}:${GID} ${APP_SERVICE} sh
logs:
docker compose logs -f ${APP_SERVICE}
git-hooks:
cp -r ./git_hooks/* .git/hooks
tcp-server-logs:
docker compose logs -f ${TCP_SERVER_MOCK}
api-dummy-logs:
docker compose logs -f ${DUMMY_API}
cache-folders:
mkdir -p ~/.go-cache && chown ${UID}:${GID} ~/.go-cache
curl:
curl -X POST http://localhost:8080/send \
-H "Content-Type: application/json" \
-d '{"message": "someText"}'
curl-api:
curl -X POST http://localhost:8081/dummy-api
send-tcp-mock:
echo "someText" | nc localhost 9000
run-loop:
./loop.sh
test:
docker compose exec -u ${UID}:${GID} ${APP_SERVICE} sh -c "XDG_CACHE_HOME=/tmp/.cache go test ./..."