Skip to content

Commit 3996aa1

Browse files
Merge pull request #37 from NHSDigital/chore/ensure-lambda-always-built-if-needed-but-not-otherwise
Ensure the lambda is rebuilt if, and only if, it needs to be.
2 parents ca4c399 + 6eeca66 commit 3996aa1

File tree

3 files changed

+273
-246
lines changed

3 files changed

+273
-246
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# ==============================================================================
44
include scripts/init.mk
55

6+
MAKE_DIR := $(abspath $(shell pwd))
7+
68
#Installs dependencies using poetry.
79
install-python:
810
poetry install
@@ -39,13 +41,15 @@ publish: clean
3941
#Files to loop over in release
4042
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. tests"
4143

42-
4344
# Example CI/CD targets are: dependencies, build, publish, deploy, clean, etc.
4445

4546
dependencies: # Install dependencies needed to build and test the project @Pipeline
4647
scripts/dependencies.sh
4748

48-
build: # Build lambda in dist
49+
.PHONY: build
50+
build: dist/lambda.zip # Build lambda.zip in dist/
51+
52+
dist/lambda.zip: $(MAKE_DIR)/pyproject.toml $(MAKE_DIR)/poetry.lock $(shell find src -type f)
4953
poetry build-lambda -vv
5054

5155
deploy: # Deploy the project artefact to the target environment @Pipeline

0 commit comments

Comments
 (0)