From d6c24511c80df5bf55de1e483e69f4e8a16eae25 Mon Sep 17 00:00:00 2001 From: Gabe Farrell Date: Thu, 12 Jun 2025 21:04:00 -0400 Subject: [PATCH] chore: add build to makefile --- Makefile | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 119f70e..5d5212a 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,10 @@ .PHONY: all test clean client -db.up: - 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: +postgres.schemadump: docker run --rm --network=host --env PGPASSWORD=secret -v "./db:/tmp/dump" \ postgres pg_dump \ --schema-only \ - --host=192.168.0.153 \ + --host=localhost \ --port=5432 \ --username=postgres \ -v --dbname="koitodb" -f "/tmp/dump/schema.sql" @@ -27,15 +18,15 @@ postgres.start: postgres.stop: docker stop koito-db -postgres.rm: - docker rm bamsort-db - 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: go test ./... -timeout 60s +api.build: + CGO_ENABLED=1 go build -ldflags='-s -w' -o koito ./cmd/api/main.go + client.dev: cd client && yarn run dev @@ -45,4 +36,6 @@ docs.dev: client.build: cd client && yarn run build -test: api.test \ No newline at end of file +test: api.test + +build: api.build client.build \ No newline at end of file