Add helpers to Makefile
This commit is contained in:
parent
cd4b3224bb
commit
79dd2d4bb1
1 changed files with 27 additions and 0 deletions
27
Makefile
Normal file
27
Makefile
Normal file
|
@ -0,0 +1,27 @@
|
|||
GOCMD=go
|
||||
GOTEST=$(GOCMD) test
|
||||
GOGET=$(GOCMD) get
|
||||
GORUN=$(GOCMD) run
|
||||
MODD=modd
|
||||
|
||||
include .env
|
||||
|
||||
VARS:=$(shell sed -ne 's/ *\#.*$$//; /./ s/=.*$$// p' .env )
|
||||
$(foreach v,$(VARS),$(eval $(shell echo export $(v)="$($(v))")))
|
||||
|
||||
.PHONY: dev
|
||||
dev:
|
||||
@env
|
||||
$(MODD)
|
||||
|
||||
.PHONY: migrate
|
||||
migrate: .env
|
||||
$(GORUN) --tags=dev main.go migrate -u
|
||||
|
||||
.PHONY: migratedown
|
||||
migratedown: .env
|
||||
$(GORUN) --tags=dev main.go migrate --revision=0
|
||||
|
||||
.PHONY: generate
|
||||
generate:
|
||||
$(GOCMD) generate
|
Loading…
Reference in a new issue