forked from nhs-england-tools/terraform-aws-opennext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.mk
80 lines (68 loc) · 2.31 KB
/
init.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# This file is part of the repository template project. Please, DO NOT edit this file.
nodejs-install: # Install Node.js
make _install-dependency name="nodejs" version="18.17.0"
make _install-dependency name="yarn"
python-install: # Install Python
make _install-dependency name="python"
make _install-dependency name="poetry"
terraform-install: # Install Terraform
make _install-dependency name="terraform"
githooks-install: # Install git hooks configured in this repository
make _install-dependency name="pre-commit"
pre-commit install \
--config ./scripts/config/.pre-commit.yaml \
--install-hooks
githooks-run: # Run git hooks configured in this repository
pre-commit run \
--config ./scripts/config/.pre-commit.yaml \
--all-files
asdf-install: # Install asdf from https://asdf-vm.com/
if [ -d "${HOME}/.asdf" ]; then
( cd "${HOME}/.asdf"; git pull )
else
git clone --depth=1 https://github.com/asdf-vm/asdf.git "${HOME}/.asdf" ||:
fi
asdf plugin update --all
_install-dependency: # Install asdf dependency - mandatory: name=[listed in the `./.tool-versions` file]; optional: version=[if not listed]
asdf plugin add ${name} ||:
asdf install ${name} $(or ${version},)
clean:: # Remove all generated and temporary files
rm -rf \
docs/diagrams/.*.bkp \
docs/diagrams/.*.dtmp \
cve-scan*.json \
sbom-spdx*.json
help: # List Makefile targets
awk 'BEGIN {FS = ":.*?# "} /^[ a-zA-Z0-9_-]+:.*? # / {printf "\033[36m%-41s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
list-variables: # List all the variables available to make
$(foreach v, $(sort $(.VARIABLES)),
$(if $(filter-out default automatic, $(origin $v)),
$(if $(and $(patsubst %_PASSWORD,,$v), $(patsubst %_PASS,,$v), $(patsubst %_KEY,,$v), $(patsubst %_SECRET,,$v)),
$(info $v=$($v) ($(value $v)) [$(flavor $v),$(origin $v)]),
$(info $v=****** (******) [$(flavor $v),$(origin $v)])
)
)
)
.DEFAULT_GOAL := help
.EXPORT_ALL_VARIABLES:
.NOTPARALLEL:
.ONESHELL:
.PHONY: *
MAKEFLAGS := --no-print-director
SHELL := /bin/bash
ifeq (true, $(shell [[ "$(VERBOSE)" =~ ^(true|yes|y|on|1|TRUE|YES|Y|ON)$$ ]] && echo true))
.SHELLFLAGS := -cex
else
.SHELLFLAGS := -ce
endif
.SILENT: \
_install-dependency \
asdf-install \
clean \
githooks-install \
githooks-run \
help \
list-variables \
nodejs-install \
python-install \
terraform-install