|
10 | 10 | # See the License for the specific language governing permissions and |
11 | 11 | # limitations under the License. |
12 | 12 |
|
13 | | -# Include custom values from .cafenv. Repository root is assumed to be the working directory. |
| 13 | +# Include custom values from .lcafenv. Repository root is assumed to be the working directory. |
14 | 14 | # Including overriding values in this file is preferred over modifying the contents below. |
15 | | -CAF_ENV_FILE = .cafenv |
16 | | --include $(CAF_ENV_FILE) |
| 15 | +LCAF_ENV_FILE = .lcafenv |
| 16 | +-include $(LCAF_ENV_FILE) |
17 | 17 |
|
18 | 18 | # Source repository for repo manifests |
19 | | -REPO_MANIFESTS_URL ?= https://github.com/nexient-llc/common-automation-framework.git |
| 19 | +REPO_MANIFESTS_URL ?= https://github.com/launchbynttdata/launch-common-automation-framework.git |
20 | 20 | # Branch of source repository for repo manifests. Other tags not currently supported. |
21 | | -# TODO: replace with git tag when supported |
22 | | -REPO_BRANCH ?= main |
| 21 | +REPO_BRANCH ?= refs/tags/1.0.0 |
23 | 22 | # Path to seed manifest in repository referenced in REPO_MANIFESTS_URL |
24 | 23 | REPO_MANIFEST ?= manifests/terraform_modules/seed/manifest.xml |
25 | 24 |
|
26 | 25 | # Settings to pull in Nexient version of (google) repo utility that supports environment substitution: |
27 | | -REPO_URL ?= https://github.com/nexient-llc/git-repo.git |
| 26 | +REPO_URL ?= https://github.com/launchbynttdata/git-repo.git |
28 | 27 | # Branch of the repository referenced by REPO_URL to use |
29 | | -# TODO: replace with git tag when supported |
30 | 28 | REPO_REV ?= main |
31 | 29 | export REPO_REV REPO_URL |
32 | 30 |
|
33 | 31 | # Example variable to substituted after init, but before sync in repo manifests. |
34 | | -GITBASE ?= https://github.com/nexient-llc/ |
35 | | -# TODO: replace with git tag when supported |
| 32 | +GITBASE ?= https://github.com/launchbynttdata/ |
36 | 33 | GITREV ?= main |
37 | 34 | export GITBASE GITREV |
38 | 35 |
|
|
47 | 44 | COMPONENTS_DIR = components |
48 | 45 | -include $(COMPONENTS_DIR)/Makefile |
49 | 46 |
|
| 47 | +MODULE_DIR ?= ${COMPONENTS_DIR}/module |
| 48 | + |
| 49 | +PYTHON3_INSTALLED = $(shell which python3 > /dev/null 2>&1; echo $$?) |
| 50 | +MISE_INSTALLED = $(shell which mise > /dev/null 2>&1; echo $$?) |
| 51 | +ASDF_INSTALLED = $(shell which asdf > /dev/null 2>&1; echo $$?) |
| 52 | +REPO_INSTALLED = $(shell which repo > /dev/null 2>&1; echo $$?) |
| 53 | +GIT_USER_SET = $(shell git config --get user.name > /dev/null 2>&1; echo $$?) |
| 54 | +GIT_EMAIL_SET = $(shell git config --get user.email > /dev/null 2>&1; echo $$?) |
| 55 | + |
50 | 56 | .PHONY: configure-git-hooks |
51 | | -configure-git-hooks: |
| 57 | +configure-git-hooks: configure-dependencies |
| 58 | +ifeq ($(PYTHON3_INSTALLED), 0) |
52 | 59 | pre-commit install |
| 60 | +else |
| 61 | + $(error Missing python3, which is required for pre-commit. Install python3 and rerun.) |
| 62 | +endif |
53 | 63 |
|
54 | 64 | ifeq ($(IS_PIPELINE),true) |
55 | 65 | .PHONY: git-config |
@@ -77,14 +87,33 @@ endef |
77 | 87 | configure: git-auth |
78 | 88 | endif |
79 | 89 |
|
| 90 | +.PHONY: configure-dependencies |
| 91 | +configure-dependencies: |
| 92 | +ifeq ($(MISE_INSTALLED), 0) |
| 93 | + @echo "Installing dependencies using mise" |
| 94 | + @awk -F'[ #]' '$$NF ~ /https/ {system("mise plugin install " $$1 " " $$NF " --yes")} $$1 ~ /./ {system("mise install " $$1 " " $$2 " --yes")}' ./.tool-versions |
| 95 | +else ifeq ($(ASDF_INSTALLED), 0) |
| 96 | + @echo "Installing dependencies using asdf-vm" |
| 97 | + @awk -F'[ #]' '$$NF ~ /https/ {system("asdf plugin add " $$1 " " $$NF)} $$1 ~ /./ {system("asdf plugin add " $$1 "; asdf install " $$1 " " $$2)}' ./.tool-versions |
| 98 | +else |
| 99 | + $(error Missing supported dependency manager. Install asdf-vm (https://asdf-vm.com/) or mise (https://mise.jdx.dev/) and rerun) |
| 100 | +endif |
| 101 | + |
80 | 102 | .PHONY: configure |
81 | 103 | configure: configure-git-hooks |
82 | | - repo --color=never init --no-repo-verify \ |
| 104 | +ifneq ($(and $(GIT_USER_SET), $(GIT_EMAIL_SET)), 0) |
| 105 | + $(error Git identities are not set! Set your user.name and user.email using 'git config' and rerun) |
| 106 | +endif |
| 107 | +ifeq ($(REPO_INSTALLED), 0) |
| 108 | + echo n | repo --color=never init --no-repo-verify \ |
83 | 109 | -u "$(REPO_MANIFESTS_URL)" \ |
84 | 110 | -b "$(REPO_BRANCH)" \ |
85 | 111 | -m "$(REPO_MANIFEST)" |
86 | 112 | repo envsubst |
87 | 113 | repo sync |
| 114 | +else |
| 115 | + $(error Missing Repo, which is required for platform sync. Install Repo (https://gerrit.googlesource.com/git-repo) and rerun.) |
| 116 | +endif |
88 | 117 |
|
89 | 118 | # The first line finds and removes all the directories pulled in by repo |
90 | 119 | # The second line finds and removes all the broken symlinks from removing things |
|
0 commit comments