-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
45 lines (32 loc) · 859 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
40
41
42
43
44
45
include .env
APP_NAME = upstat
MIGRATIONS_DIR ?= $(PWD)/database/migrations/sqlite
ifeq ($(DB_type), postgres)
MIGRATIONS_DIR = $(PWD)/database/migrations/postgres
else ifeq ($(DB_type), sqlite)
MIGRATIONS_DIR = $(PWD)/database/migrations/sqlite
endif
export POSTGRES_DSN
dev:
air
build:
go build -o server main.go
clean:
rm -rf ./server
run: build
./server
swag:
go-swagger3 --module-path . --output ./docs/swagger.json --schema-without-pkg
critic:
gocritic check -enableAll ./...
security:
gosec ./...
migrate.create:
@read -p "Enter migration name: " name; \
goose -dir $(MIGRATIONS_DIR) create $$name sql
migrate.up:
goose -dir $(MIGRATIONS_DIR) postgres $(POSTGRES_DSN) up
migrate.down:
goose -dir $(MIGRATIONS_DIR) postgres $(POSTGRES_DSN) down
migrate.reset:
goose -dir $(MIGRATIONS_DIR) postgres $(POSTGRES_DSN) reset