-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (55 loc) · 2.49 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#/*****************************************************************************************************************/
NAME=observerly-nova
#/*****************************************************************************************************************/
run: buff diff migrate
NOVA_DSN="root:pass@tcp(127.0.0.1:3306)/observerly?charset=utf8mb4&parseTime=True&loc=Local" go run cmd/api/main.go
#/*****************************************************************************************************************/
buff:
buf generate
#/*****************************************************************************************************************/
migrate:
atlas schema apply \
--url "mysql://user:password@db:3306/observerly" \
--to "file://migrations" \
--dev-url "mysql://user:password@db:3306/observerly" \
--auto-approve
#/*****************************************************************************************************************/
clean:
atlas schema clean \
--url "mysql://user:password@db:3306/observerly"
#/*****************************************************************************************************************/
diff: clean
atlas migrate diff --env gorm
#/*****************************************************************************************************************/
populate:
@echo "Populating the database..."
#/*****************************************************************************************************************/
test:
@echo "Testing..."
go test -v ./...
@echo "Testing complete."
#/*****************************************************************************************************************/
# Format the application code
format:
@echo "Formatting..."
@go fmt ./...
@echo "Formatting complete."
#/*****************************************************************************************************************/
# Vet the application code
vet:
@echo "Vetting..."
@go vet ./...
@echo "Vetting complete."
#/*****************************************************************************************************************/
# Lint the application code
lint:
@echo "Linting..."
@staticcheck ./...
@echo "Linting complete."
#/*****************************************************************************************************************/
# Run GoCritic
critic:
@echo "Running Critic..."
@gocritic check ./...
@echo "Critic complete."
#/*****************************************************************************************************************/