chore: add build to makefile

pull/20/head
Gabe Farrell 6 months ago
parent bfef2c59fb
commit d6c24511c8

@ -1,19 +1,10 @@
.PHONY: all test clean client .PHONY: all test clean client
db.up: postgres.schemadump:
GOOSE_MIGRATION_DIR=db/migrations GOOSE_DRIVER=postgres GOOSE_DBSTRING=postgres://postgres:secret@localhost:5432 goose up
db.down:
GOOSE_MIGRATION_DIR=db/migrations GOOSE_DRIVER=postgres GOOSE_DBSTRING=postgres://postgres:secret@localhost:5432 goose down
db.reset:
GOOSE_MIGRATION_DIR=db/migrations GOOSE_DRIVER=postgres GOOSE_DBSTRING=postgres://postgres:secret@localhost:5432 goose down-to 0
db.schemadump:
docker run --rm --network=host --env PGPASSWORD=secret -v "./db:/tmp/dump" \ docker run --rm --network=host --env PGPASSWORD=secret -v "./db:/tmp/dump" \
postgres pg_dump \ postgres pg_dump \
--schema-only \ --schema-only \
--host=192.168.0.153 \ --host=localhost \
--port=5432 \ --port=5432 \
--username=postgres \ --username=postgres \
-v --dbname="koitodb" -f "/tmp/dump/schema.sql" -v --dbname="koitodb" -f "/tmp/dump/schema.sql"
@ -27,15 +18,15 @@ postgres.start:
postgres.stop: postgres.stop:
docker stop koito-db docker stop koito-db
postgres.rm:
docker rm bamsort-db
api.debug: api.debug:
KOITO_ALLOWED_HOSTS=* KOITO_LOG_LEVEL=debug KOITO_CONFIG_DIR=test_config_dir KOITO_DATABASE_URL=postgres://postgres:secret@192.168.0.153:5432/koitodb?sslmode=disable go run cmd/api/main.go KOITO_ALLOWED_HOSTS=* KOITO_LOG_LEVEL=debug KOITO_CONFIG_DIR=test_config_dir KOITO_DATABASE_URL=postgres://postgres:secret@localhost:5432?sslmode=disable go run cmd/api/main.go
api.test: api.test:
go test ./... -timeout 60s go test ./... -timeout 60s
api.build:
CGO_ENABLED=1 go build -ldflags='-s -w' -o koito ./cmd/api/main.go
client.dev: client.dev:
cd client && yarn run dev cd client && yarn run dev
@ -45,4 +36,6 @@ docs.dev:
client.build: client.build:
cd client && yarn run build cd client && yarn run build
test: api.test test: api.test
build: api.build client.build
Loading…
Cancel
Save