forked from allisson/postmand
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
39 lines (29 loc) · 1.04 KB
/
justfile
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
set export
set dotenv-load
PLATFORM := if os() == "macos" { "darwin" } else { os() }
lint:
if [ ! -f ./bin/golangci-lint ] ; \
then \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2; \
fi;
./bin/golangci-lint run --fix
test:
go test -covermode=count -coverprofile=count.out -v ./...
mock:
@rm -rf mocks
mockery --all
download-golang-migrate-binary:
if [ ! -f ./migrate.{{PLATFORM}}-amd64 ] ; \
then \
curl -sfL https://github.com/golang-migrate/migrate/releases/download/v4.14.1/migrate.{{PLATFORM}}-amd64.tar.gz | tar -xvz; \
fi;
db-migrate: download-golang-migrate-binary
./migrate.{{PLATFORM}}-amd64 -source file://db/migrations -database $POSTMAND_DATABASE_URL up
db-test-migrate: download-golang-migrate-binary
./migrate.{{PLATFORM}}-amd64 -source file://db/migrations -database $POSTMAND_TEST_DATABASE_URL up
run-server:
go run cmd/postmand/main.go server
run-worker:
go run cmd/postmand/main.go worker
swag-init:
swag init -g cmd/postmand/main.go --parseDependency --parseDepth 2