-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
46 lines (36 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
include scripts/help.mk
version ?= latest
image = rafaelbmateus/go-transactions:$(version)
docker = docker run --rm $(image)
compose = docker-compose
.PHONY: build
build: ##@development build image docker base
docker build -f build/Dockerfile . -t $(image)
.PHONY: lint
lint: build ##@lint static analysis code base
$(docker) golangci-lint run
.PHONY: test
test: build ##@test run all tests
$(docker) go test ./...
.PHONY: bash
bash: ##@development Start a bash session within the container
$(compose) run --rm app /bin/bash
.PHONY: start
start: ##@development start development environment in background
$(compose) up --build -d
.PHONY: restart
restart: ##@development Restart development environment [service="svc1 svc2..."]
$(compose) restart
.PHONY: stop
stop: ##@test Stop development environment
$(compose) down -v --remove-orphans
.PHONY: clean
clean: ##@development Clean the development environment
rm -rf public;
$(compose) down \
--remove-orphans \
--volumes
tail ?= 100
.PHONY: logs
logs: ##@development Follow development logs
$(compose) logs -f --tail=$(tail) $(service)