-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile
42 lines (34 loc) · 864 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
PATH_THIS:=$(realpath $(dir $(lastword ${MAKEFILE_LIST})))
DIR:=$(PATH_THIS)
include base.env
VARS:=$(shell sed -ne 's/ *\#.*$$//; /./ s/=.*$$// p' base.env )
$(foreach v,$(VARS),$(eval $(shell echo export $(v)="$($(v))")))
include .env
VARS:=$(shell sed -ne 's/ *\#.*$$//; /./ s/=.*$$// p' .env )
$(foreach v,$(VARS),$(eval $(shell echo export $(v)="$($(v))")))
help:
@echo " server"
@echo " Run server"
@echo " migrate"
@echo " Run migrations"
@echo " test"
@echo " Run tests"
@echo " swagger"
@echo " Generate Swagger documentation"
.PHONY: server
server:
@cd $(DIR) \
&& echo $$DB_URL \
&& gin -i run server
.PHONY: migrate
migrate:
@cd $(DIR) \
&& gorm-goose up
.PHONY: test
test:
@cd $(DIR) \
&& go test ./...
.PHONY: swagger
swagger:
@cd $(DIR) \
&& swagger generate spec -o doc/swagger.json