skeleton/Makefile

28 lines
512 B
Makefile
Raw Normal View History

2019-07-26 11:21:33 +02:00
GOCMD=go
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GORUN=$(GOCMD) run
MODD=modd
include .env
2020-07-19 11:52:26 +02:00
# make all these env vars available for executed processes
2019-07-26 11:21:33 +02:00
VARS:=$(shell sed -ne 's/ *\#.*$$//; /./ s/=.*$$// p' .env )
$(foreach v,$(VARS),$(eval $(shell echo export $(v)="$($(v))")))
.PHONY: dev
dev:
$(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