-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 886 Bytes
/
Makefile
File metadata and controls
39 lines (28 loc) · 886 Bytes
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
39
# --- CONFIGURATION ---
SERVER := $(DISTRIBUTE_SERVER)
REGISTRY := $(DISTRIBUTE_REGISTRY)
REMOTE_DIR := $(DISTRIBUTE_REMOTE_DIR)
ARCH := $(DISTRIBUTE_ARCH)
BUILD_CMD := docker buildx build --platform linux/$(ARCH) --target runner --push
.PHONY: all deploy update debug logs build-distributor
all: deploy
# -----------------
# BUILD
# -----------------
build-distributor:
@echo "Building distributor..."
$(BUILD_CMD) -f api/Dockerfile -t $(REGISTRY)/distributor:latest .
# -----------------
# DEPLOYMENT
# -----------------
deploy: build-distributor update
update:
@echo "Updating remote stack..."
ssh $(SERVER) "cd $(REMOTE_DIR) && docker compose pull && docker compose up -d --remove-orphans"
logs:
ssh $(SERVER) "cd $(REMOTE_DIR) && docker compose logs -f --tail=100"
# -----------------
# DEVELOPMENT
# -----------------
debug:
cd api && docker compose up --build