|
1 | 1 | # Define source and destination directories |
2 | | -BRANCH ?= main |
| 2 | +LIBRARY_BRANCH ?= $(or $(BRANCH),main) |
| 3 | +INSTALLATION_BRANCH := main |
3 | 4 | SRC_ROOT := _source |
4 | 5 | SRC_DIR := $(SRC_ROOT)/validmind-library |
5 | 6 | DEST_DIR_NB := notebooks |
@@ -40,11 +41,27 @@ clean: |
40 | 41 | rm -rf $(SRC_DIR) |
41 | 42 | rm -rf $(SRC_ROOT) |
42 | 43 |
|
43 | | -# Clone the source repository we need |
| 44 | +# Prompt for a branch or release tag and clone the repository |
44 | 45 | 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 |
48 | 65 |
|
49 | 66 | copy-installation: |
50 | 67 | cp -r $(SRC_ROOT)/installation/site/installation installation |
|
0 commit comments