aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-29 23:37:54 +0900
committernsfisis <nsfisis@gmail.com>2024-07-30 00:26:47 +0900
commit6d35f66e3502b61c0386f719d3a5f3caf0e109b6 (patch)
tree52df261d453e89619e1b1ad5f9918607136ea7f8 /Makefile
parentb7e2d4571b61f20a9f4a288f41ba0a30e488eda4 (diff)
downloadiosdc-japan-2024-albatross-6d35f66e3502b61c0386f719d3a5f3caf0e109b6.tar.gz
iosdc-japan-2024-albatross-6d35f66e3502b61c0386f719d3a5f3caf0e109b6.tar.zst
iosdc-japan-2024-albatross-6d35f66e3502b61c0386f719d3a5f3caf0e109b6.zip
feat: separate Makefile and compose.yaml for local/prod envs
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile52
1 files changed, 31 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index 07f682f..b15a2bb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,42 +1,52 @@
+DOCKER_COMPOSE := docker compose -f compose.local.yaml
+
.PHONY: build
build:
- docker compose build
+ ${DOCKER_COMPOSE} build
+ cd frontend; npm install
.PHONY: up
up:
- docker compose up -d
+ ${DOCKER_COMPOSE} up -d
+ cd frontend; npm run dev
.PHONY: down
down:
- docker compose down
-
-.PHONY: api-server-only-build
-api-server-only-build:
- docker compose build api-server-only
-
-.PHONY: api-server-only-up
-api-server-only-up:
- docker compose up -d api-server-only
+ ${DOCKER_COMPOSE} down
-.PHONY: api-server-only-down
-api-server-only-down:
- docker compose down api-server-only db
+.PHONY: logs
+logs:
+ ${DOCKER_COMPOSE} logs
.PHONY: psql
psql:
- docker compose exec db psql --user=postgres albatross
+ ${DOCKER_COMPOSE} up --wait db
+ ${DOCKER_COMPOSE} exec db psql --user=postgres albatross
+
+.PHONY: psql-query
+psql-query:
+ ${DOCKER_COMPOSE} up --wait db
+ ${DOCKER_COMPOSE} exec --no-TTY db psql --user=postgres albatross
.PHONY: sqldef-dryrun
sqldef-dryrun: down
- docker compose build db
- docker compose up -d db
- docker compose run --no-TTY tools psqldef --dry-run < ./backend/schema.sql
+ ${DOCKER_COMPOSE} build db
+ ${DOCKER_COMPOSE} up --wait db
+ ${DOCKER_COMPOSE} run --no-TTY tools psqldef --dry-run < ./backend/schema.sql
.PHONY: sqldef
sqldef: down
- docker compose build db
- docker compose up -d db
- docker compose run --no-TTY tools psqldef < ./backend/schema.sql
+ ${DOCKER_COMPOSE} build db
+ ${DOCKER_COMPOSE} up --wait db
+ ${DOCKER_COMPOSE} run --no-TTY tools psqldef < ./backend/schema.sql
+
+.PHONY: init
+init: build initdb
+
+.PHONY: initdb
+initdb:
+ make psql-query < ./backend/schema.sql
+ make psql-query < ./backend/fixtures/dev.sql
.PHONY: oapi-codegen
oapi-codegen: