Skip to content

Commit 3601100

Browse files
authored
Enable cloning at a specific release tag (#676)
* Enable cloning at a specific release tag * Re-enable BRANCH option * Rework logic to allow cloning HEAD for main * Enable better branch handling to separate library from installation repo
1 parent 9f62f07 commit 3601100

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

site/Makefile

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Define source and destination directories
2-
BRANCH ?= main
2+
LIBRARY_BRANCH ?= $(or $(BRANCH),main)
3+
INSTALLATION_BRANCH := main
34
SRC_ROOT := _source
45
SRC_DIR := $(SRC_ROOT)/validmind-library
56
DEST_DIR_NB := notebooks
@@ -40,11 +41,27 @@ clean:
4041
rm -rf $(SRC_DIR)
4142
rm -rf $(SRC_ROOT)
4243

43-
# Clone the source repository we need
44+
# Prompt for a branch or release tag and clone the repository
4445
clone:
45-
@echo "\nCloning source repos ..."
46-
git clone -b $(BRANCH) git@github.com:validmind/validmind-library.git $(SRC_DIR)
47-
git clone -b $(BRANCH) git@github.com:validmind/installation.git $(SRC_ROOT)/installation
46+
@if [ -n "$(LIBRARY_BRANCH)" ] && [ "$(LIBRARY_BRANCH)" != "main" ]; then \
47+
echo "\nWARNING: Cloning non-release files from $(LIBRARY_BRANCH) — DO NOT COMMIT"; \
48+
echo "\nCloning validmind-library repo from $(LIBRARY_BRANCH) ..."; \
49+
CHECKOUT="$(LIBRARY_BRANCH)"; \
50+
else \
51+
read -p "Enter release tag (example: v2.8.10, or HEAD for latest): " TAG; \
52+
if [ "$$TAG" = "HEAD" ]; then \
53+
echo "\nWARNING: Cloning latest non-release files — DO NOT COMMIT"; \
54+
echo "\nCloning validmind-library repo at HEAD ..."; \
55+
CHECKOUT="$(LIBRARY_BRANCH)"; \
56+
else \
57+
echo "\nCloning validmind-library repo at $$TAG ..."; \
58+
CHECKOUT="$$TAG"; \
59+
fi \
60+
fi; \
61+
git clone --depth 1 -b $$CHECKOUT git@github.com:validmind/validmind-library.git $(SRC_DIR)
62+
63+
@echo "\nCloning installation repo from $(INSTALLATION_BRANCH) ..."; \
64+
git clone --depth 1 -b $(INSTALLATION_BRANCH) git@github.com:validmind/installation.git $(SRC_ROOT)/installation
4865

4966
copy-installation:
5067
cp -r $(SRC_ROOT)/installation/site/installation installation

0 commit comments

Comments
 (0)