-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (29 loc) · 784 Bytes
/
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
MAKEFLAGS += --silent
BASEDIR = $(shell git rev-parse --show-toplevel)
OPTIONS ?= --build --remove-orphans --force-recreate
DB ?= db
APP ?= app
.PHONY: all docker healthcheck test clean
all: docker test
docker:
docker-compose up $(OPTIONS) -d
%:
docker-compose up $(OPTIONS) $@ -d
docker-compose ps -a
healthcheck:
docker inspect $(APP) --format "{{ (index (.State.Health.Log) 0).Output }}"
test:
# dotnet test
while ! \
[[ "$$(docker inspect --format "{{json .State.Health }}" $(DB) | jq -r ".Status")" == "healthy" ]];\
do \
echo "waiting $(DB) ..."; \
sleep 1; \
done
sleep 1
[ -f ${BASEDIR}/tests/test.sh ] && ${BASEDIR}/tests/test.sh
clean:
dotnet clean
rm -rf ${BASEDIR}/{bin,obj}
docker-compose down --remove-orphans -v --rmi local
-include .env