-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (51 loc) · 1.41 KB
/
Makefile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Variables for the project
# =========================
CONFERENCE ?= ep2025
DATA_DIR ?= ./data/public/$(CONFERENCE)/
# Variables for remote host
# =========================
VPS_USER ?= static_content_user
VPS_HOST ?= static.europython.eu
VPS_PATH ?= /home/$(VPS_USER)/content/static/programme/$(CONFERENCE)/releases
REMOTE_CMD=ssh $(VPS_USER)@$(VPS_HOST)
# Variables for deploy
# ====================
TIMESTAMP ?= $(shell date +%Y%m%d%H%M%S)
FORCE_DEPLOY ?= false
# Optional arguments
# ==================
EXCLUDE ?=
WARN_DUPES ?= false
# Convert EXCLUDE space-separated list to repeated --exclude flags
EXCLUDE_FLAGS = $(foreach item,$(EXCLUDE),--exclude $(item))
dev:
uv sync --dev
deps/upgrade:
uv lock --upgrade
deps/install:
uv sync
install: deps/install
download:
python -m src.download $(EXCLUDE_FLAGS)
transform:
ifeq ($(WARN_DUPES), true)
python -m src.transform $(EXCLUDE_FLAGS) --warn-dupes
else
python -m src.transform $(EXCLUDE_FLAGS)
endif
all: download transform
ifeq ($(FORCE_DEPLOY), true)
deploy: TARGET = $(VPS_PATH)/$(TIMESTAMP)
deploy:
@echo "\n\n**** Deploying branch '$(CONFERENCE)' to $(TARGET)...\n\n"
$(REMOTE_CMD) "mkdir -p $(TARGET)"
rsync -avz --delete $(DATA_DIR) $(VPS_USER)@$(VPS_HOST):$(TARGET)
$(REMOTE_CMD) "cd $(VPS_PATH) && ln -snf $(TIMESTAMP) current"
@echo "\n\n**** Deployment complete.\n\n"
endif
test:
uv run pytest
pre-commit:
pre-commit install
clean:
git clean -xdf