-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (27 loc) · 866 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
COMPOSE_TEST_FILE="${PWD}/docker-compose-test.yaml"
fmt:
COMPOSE_FILE=${COMPOSE_TEST_FILE} docker compose run --rm --remove-orphans api-test go fmt
.PHONY:fmt
lint: fmt
COMPOSE_FILE=${COMPOSE_TEST_FILE} docker compose run --rm --remove-orphans api-test golangci-lint run -v
.PHONY:lint
build:
docker build . -t "url-short:latest"
.PHONY:build
build/test:
docker build . -t "url-short:test" --target tester
.PHONY:build/test
run:
docker compose up -d
.PHONY:run
stop:
docker compose down
.PHONY:stop
test:
COMPOSE_FILE=${COMPOSE_TEST_FILE} docker compose up -d
COMPOSE_FILE=${COMPOSE_TEST_FILE} docker compose run --rm --remove-orphans api-test go test -cover ./...
COMPOSE_FILE=${COMPOSE_TEST_FILE} docker compose down
.PHONY:test
migrate:
goose -dir sql/schema postgres "postgres://url_short:password@localhost:5002/url_short" up
.PHONY:migrate