Skip to content

Commit c869280

Browse files
authored
Add the _install-dependencies task and call it from make config (nhs-england-tools#144)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description This adds the `make _install-dependencies` task, which installs everything from the `.tool-versions` file. ## Context This avoids the need to add a new `make` task for each dependency, instead treating the `.tool-versions` file as canonical. Specifically it avoids the need for the user to add a `make _install-python` task in [the tutorial](nhs-england-tools#131). For discussion: do we still need `make _install-terraform` if we have this? I don't think we do. ## Type of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. --> - [ ] Refactoring (non-breaking change) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would change existing functionality) - [ ] Bug fix (non-breaking change which fixes an issue) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [ ] I am familiar with the [contributing guidelines](../docs/CONTRIBUTING.md) - [ ] I have followed the code style of the project - [ ] I have added tests to cover my changes - [ ] I have updated the documentation accordingly - [ ] This PR is a result of pair or mob programming --- ## Sensitive Information Declaration To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter. - [ ] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.
1 parent cc506de commit c869280

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ clean:: # Clean-up project resources (main) @Operations
2424

2525
config:: # Configure development environment (main) @Configuration
2626
# TODO: Use only 'make' targets that are specific to this project, e.g. you may not need to install Node.js
27-
make \
28-
terraform-install
27+
make _install-dependencies
2928

3029
# ==============================================================================
3130

scripts/init.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,15 @@ githooks-run: # Run git hooks configured in this repository @Operations
4141
--all-files
4242

4343
_install-dependency: # Install asdf dependency - mandatory: name=[listed in the '.tool-versions' file]; optional: version=[if not listed]
44+
echo ${name}
4445
asdf plugin add ${name} ||:
4546
asdf install ${name} $(or ${version},)
4647

48+
_install-dependencies: # Install all the dependencies listed in .tool-versions
49+
for plugin in $$(grep ^[a-z] .tool-versions | sed 's/[[:space:]].*//'); do
50+
make _install-dependency name="$${plugin}"
51+
done
52+
4753
clean:: # Remove all generated and temporary files (common) @Operations
4854
rm -rf \
4955
.scannerwork \
@@ -138,6 +144,7 @@ HELP_SCRIPT = \
138144
# ==============================================================================
139145

140146
${VERBOSE}.SILENT: \
147+
_install-dependencies \
141148
_install-dependency \
142149
clean \
143150
config \

0 commit comments

Comments
 (0)