|
4 | 4 | VPS_USER ?= static_content_user |
5 | 5 | VPS_HOST ?= static.europython.eu |
6 | 6 | VPS_PROD_PATH ?= /home/static_content_user/content/europython_websites/ep2025 |
7 | | -VPS_PREVIEW_PATH ?= /home/static_content_user/content/previews/ |
| 7 | +VPS_PREVIEW_PATH ?= /home/static_content_user/content/previews |
8 | 8 | REMOTE_CMD=ssh $(VPS_USER)@$(VPS_HOST) |
9 | 9 |
|
10 | 10 | # Variables for build/deploy |
@@ -47,22 +47,24 @@ build: |
47 | 47 | # NOTE: also let's find a better way to do this :D |
48 | 48 | find ./dist/_astro/ -iname '*.jpg' -delete |
49 | 49 |
|
| 50 | +preview: RELEASES_DIR = $(VPS_PREVIEW_PATH)/$(SAFE_BRANCH)/releases |
| 51 | +preview: TARGET = $(RELEASES_DIR)/$(TIMESTAMP) |
| 52 | +preview: |
| 53 | + echo $(TARGET) |
| 54 | + @echo "\n\n**** Deploying preview of a branch '$(BRANCH)' (safe: $(SAFE_BRANCH)) to $(TARGET)...\n\n" |
| 55 | + $(REMOTE_CMD) "mkdir -p $(TARGET)" |
| 56 | + rsync -avz --delete ./dist/ $(VPS_USER)@$(VPS_HOST):$(TARGET)/ |
| 57 | + $(REMOTE_CMD) "cd $(RELEASES_DIR) && ln -snf $(TIMESTAMP) current" |
| 58 | + @echo "\n\n**** Preview complete.\n\n" |
| 59 | + |
| 60 | + |
50 | 61 | ifeq ($(FORCE_DEPLOY), true) |
| 62 | +deploy: RELEASES_DIR = $(VPS_PROD_PATH)/$(SAFE_BRANCH)/releases |
| 63 | +deploy: TARGET = $(RELEASES_DIR)/$(TIMESTAMP) |
51 | 64 | deploy: |
52 | | - RELEASES_DIR := $(VPS_PROD_PATH)/releases |
53 | | - TARGET := $(RELEASES_DIR)/$(TIMESTAMP) |
54 | 65 | @echo "\n\n**** Deploying branch '$(BRANCH)' (safe: $(SAFE_BRANCH)) to $(TARGET)...\n\n" |
55 | 66 | $(REMOTE_CMD) "mkdir -p $(TARGET)" |
56 | 67 | rsync -avz --delete ./dist/ $(VPS_USER)@$(VPS_HOST):$(TARGET)/ |
57 | 68 | $(REMOTE_CMD) "cd $(RELEASES_DIR) && ln -snf $(TIMESTAMP) current" |
58 | 69 | @echo "\n\n**** Deployment complete.\n\n" |
59 | 70 | endif |
60 | | - |
61 | | -preview: |
62 | | - RELEASES_DIR := $(VPS_PREVIEW_PATH)/$(SAFE_BRANCH)/releases |
63 | | - TARGET := $(RELEASES_DIR)/$(TIMESTAMP) |
64 | | - @echo "\n\n**** Deploying preview of a branch '$(BRANCH)' (safe: $(SAFE_BRANCH)) to $(TARGET)...\n\n" |
65 | | - $(REMOTE_CMD) "mkdir -p $(TARGET)" |
66 | | - rsync -avz --delete ./dist/ $(VPS_USER)@$(VPS_HOST):$(TARGET)/ |
67 | | - $(REMOTE_CMD) "cd $(RELEASES_DIR) && ln -snf $(TIMESTAMP) current" |
68 | | - @echo "\n\n**** Preview complete.\n\n" |
|
0 commit comments