generated from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (49 loc) · 2.05 KB
/
Makefile
File metadata and controls
68 lines (49 loc) · 2.05 KB
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
# This file is for you! Edit it to implement your own hooks (make targets) into
# the project as automated steps to be executed on locally and in the CD pipeline
# ==============================================================================
include scripts/init.mk
MAKE_DIR := $(abspath $(shell pwd))
#Installs dependencies using poetry.
install-python:
poetry install
#Configures Git Hooks, which are scripts that run given a specified event.
.git/hooks/pre-commit:
cp scripts/pre-commit .git/hooks/pre-commit
#Condensed Target to run all targets above.
install: install-python .git/hooks/pre-commit
#Run the linting script (specified in package.json). Used to check the syntax and formatting of files.
lint:
poetry run ruff format . --check
poetry run ruff check .
poetry run pyright
format: ## Format and fix code
poetry run ruff format .
poetry run ruff check . --fix-only
format_lint: format lint
vulture:
poetry run vulture
#Files to loop over in release
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. tests"
# Example CI/CD targets are: dependencies, build, publish, deploy, clean, etc.
dependencies: # Install dependencies needed to build and test the project @Pipeline
scripts/dependencies.sh
check-licenses:
scripts/check_python_licenses.sh
.PHONY: build
build: dist/lambda.zip # Build lambda.zip in dist/
dist/lambda.zip: $(MAKE_DIR)/pyproject.toml $(MAKE_DIR)/poetry.lock $(shell find src -type f)
poetry build-lambda -vv && poetry run clean-lambda
deploy: # Deploy the project artefact to the target environment @Pipeline
# TODO: Implement the artefact deployment step
config:: # Configure development environment (main) @Configuration
# TODO: Use only 'make' targets that are specific to this project, e.g. you may not need to install Node.js
make _install-dependencies
precommit: test-unit build test-integration lint vulture ## Pre-commit tasks
python -m this
# ==============================================================================
${VERBOSE}.SILENT: \
build \
clean \
config \
dependencies \
deploy \