2020-07-13 09:20:14 +02:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
2020-07-16 22:51:26 +02:00
|
|
|
build: build-server
|
2020-07-10 18:07:41 +02:00
|
|
|
|
2020-07-16 22:51:26 +02:00
|
|
|
docker:
|
2020-06-15 14:58:59 +02:00
|
|
|
docker-compose build
|
|
|
|
|
2020-07-13 09:20:14 +02:00
|
|
|
generate:
|
2020-07-16 09:28:27 +02:00
|
|
|
go generate ./...
|
2020-07-13 09:20:14 +02:00
|
|
|
|
2020-07-10 18:07:41 +02:00
|
|
|
build-server:
|
2020-07-13 09:20:14 +02:00
|
|
|
CGO_ENABLED=0 go build -v -o ./bin/server ./cmd/server
|
2020-06-15 18:10:06 +02:00
|
|
|
|
2020-07-13 15:07:55 +02:00
|
|
|
deps: generate
|
2020-07-10 18:07:41 +02:00
|
|
|
cd client && npm install
|
2020-07-13 12:01:20 +02:00
|
|
|
go get ./...
|
2020-06-15 14:58:59 +02:00
|
|
|
|
2020-07-16 22:31:02 +02:00
|
|
|
client-dist:
|
|
|
|
cd client && NODE_ENV=production npm run build
|
|
|
|
|
2020-07-10 18:07:41 +02:00
|
|
|
up: build-docker
|
|
|
|
docker-compose up
|
2020-06-15 14:58:59 +02:00
|
|
|
|
2020-07-10 18:07:41 +02:00
|
|
|
watch:
|
2020-07-13 12:01:20 +02:00
|
|
|
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:
|
2020-06-21 11:30:34 +02:00
|
|
|
docker-compose exec postgres psql -Udaddy
|
2020-06-18 09:34:22 +02:00
|
|
|
|
2020-07-13 09:20:14 +02:00
|
|
|
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
|
|
|
|
|
2020-07-10 18:07:41 +02:00
|
|
|
test:
|
|
|
|
go test -v ./...
|
|
|
|
|
2020-06-18 09:34:22 +02:00
|
|
|
hydra-shell:
|
2020-07-13 12:01:20 +02:00
|
|
|
docker-compose exec hydra /bin/sh
|
|
|
|
|
2020-07-16 22:31:02 +02:00
|
|
|
.PHONY: release
|
|
|
|
release:
|
|
|
|
./misc/script/release
|
|
|
|
|
2020-07-16 22:51:26 +02:00
|
|
|
clean:
|
2020-07-13 12:01:20 +02:00
|
|
|
rm -rf client/node_modules bin data .env internal/graph/generated internal/graph/server.go
|
|
|
|
rm -rf vendor
|
|
|
|
go clean -modcache
|