diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-07-29 23:37:54 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-07-30 00:26:47 +0900 |
| commit | 6d35f66e3502b61c0386f719d3a5f3caf0e109b6 (patch) | |
| tree | 52df261d453e89619e1b1ad5f9918607136ea7f8 /Makefile | |
| parent | b7e2d4571b61f20a9f4a288f41ba0a30e488eda4 (diff) | |
| download | phperkaigi-2025-albatross-6d35f66e3502b61c0386f719d3a5f3caf0e109b6.tar.gz phperkaigi-2025-albatross-6d35f66e3502b61c0386f719d3a5f3caf0e109b6.tar.zst phperkaigi-2025-albatross-6d35f66e3502b61c0386f719d3a5f3caf0e109b6.zip | |
feat: separate Makefile and compose.yaml for local/prod envs
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 52 |
1 files changed, 31 insertions, 21 deletions
@@ -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: |
