daddy/Makefile

51 lines
992 B
Makefile
Raw Normal View History

SHELL := /bin/bash
build: build-docker build-server
build-docker:
2020-06-15 14:58:59 +02:00
docker-compose build
generate:
cd internal && go run github.com/99designs/gqlgen generate
build-server:
CGO_ENABLED=0 go build -v -o ./bin/server ./cmd/server
2020-06-15 18:10:06 +02:00
deps: generate
cd client && npm install
go get ./...
2020-06-15 14:58:59 +02:00
up: build-docker
docker-compose up
2020-06-15 14:58:59 +02:00
watch:
go run github.com/cortesi/modd/cmd/modd
2020-06-15 14:58:59 +02:00
down:
docker-compose down -v --remove-orphans
db-shell:
docker-compose exec postgres psql -Udaddy
migrate: build-server
( set -o allexport && source .env && set +o allexport && bin/server -workdir "./cmd/server" -config ../../data/config.yml -migrate $(MIGRATE) )
migrate-latest:
$(MAKE) MIGRATE=latest migrate
migrate-up:
$(MAKE) MIGRATE=up migrate
migrate-down:
$(MAKE) MIGRATE=down migrate
test:
go test -v ./...
hydra-shell:
docker-compose exec hydra /bin/sh
clean: down
rm -rf client/node_modules bin data .env internal/graph/generated internal/graph/server.go
rm -rf vendor
go clean -modcache