-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (31 loc) · 1.02 KB
/
Copy pathMakefile
File metadata and controls
38 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# =============================================================================
# GitHub Integration Service — Makefile
# =============================================================================
.PHONY: up down down-clean migrate logs build
# Compose file and project name
COMPOSE := docker compose
PROJECT := github-integration
MIGRATION_FILE := migrations/001_initial_schema.sql
## up: start all services in detached mode
up:
$(COMPOSE) up -d
## down: stop and remove all containers (volumes are preserved)
down:
$(COMPOSE) down
## down-clean: stop and remove containers AND all data volumes (wipes postgres, redis, rabbitmq data)
down-clean:
$(COMPOSE) down -v
## build: (re)build the app image
build:
$(COMPOSE) build
## migrate: apply SQL migrations inside the running postgres container
migrate:
@echo "Applying migration: $(MIGRATION_FILE)"
$(COMPOSE) exec -T postgres psql \
-U postgres \
-d github_int \
-f /dev/stdin \
< $(MIGRATION_FILE)
## logs: tail app container logs
logs:
$(COMPOSE) logs -f app