Skip to content

Commit a6a4777

Browse files
CCM-14149: Update Docker Image Boilerplate (#95)
* CCM-14149: Update Docker Image Boilerplate * CCM-14149: Update Docker Image Boilerplate
1 parent c56a91d commit a6a4777

4 files changed

Lines changed: 206 additions & 77 deletions

File tree

.trivyignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CVE-2026-26996 # https://avd.aquasec.com/nvd/cve-2026-26996 - minimatch - used by several dependencies, most notably eslint. Fix version has introduced breaking changes. Ticket to backport fixes: https://nhsd-jira.digital.nhs.uk/browse/CCM-14784
Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,43 @@
11
# # This script is run before the Terraform apply command.
22
# # It ensures all Node.js dependencies are installed, generates any required dependencies,
33
# # and builds all Lambda functions in the workspace before Terraform provisions infrastructure.
4+
# pre.sh runs in the same shell as terraform.sh, not in a subshell
5+
# any variables set or changed, any change of directory will persist once this script exits and returns control to terraform.sh
6+
# REGION=$1
7+
# ENVIRONMENT=$2
8+
# ACTION=$3
49

5-
# npm ci
10+
# # Helper function for error handling
11+
# run_or_fail() {
12+
# "$@"
13+
# if [ $? -ne 0 ]; then
14+
# echo "$* failed!" >&2
15+
# exit 1
16+
# fi
17+
# }
618

7-
# npm run generate-dependencies --workspaces --if-present
19+
# echo "Running app pre.sh"
20+
# echo "REGION=$REGION"
21+
# echo "ENVIRONMENT=$ENVIRONMENT"
22+
# echo "ACTION=$ACTION"
823

9-
# npm run lambda-build --workspaces --if-present
24+
## Required logic for building and pushing Lambda container images to ECR before Terraform provisions infrastructure.
25+
# GIT_TAG="$(git describe --tags --exact-match 2>/dev/null || true)"
26+
# if [ -n "${GIT_TAG}" ]; then
27+
# RELEASE_VERSION="${GIT_TAG#v}"
28+
# export TF_VAR_container_image_tag_suffix="release-${RELEASE_VERSION}-$(git rev-parse --short HEAD)"
29+
# echo "On tag: $GIT_TAG, image tag suffixes will be: release-${RELEASE_VERSION}-$(git rev-parse --short HEAD)"
30+
# else
31+
# export TF_VAR_container_image_tag_suffix="sha-$(git rev-parse --short HEAD)"
32+
# echo "Not on a tag, image tag suffix will be: sha-$(git rev-parse --short HEAD)"
33+
# fi
34+
35+
# # change to monorepo root
36+
# cd $(git rev-parse --show-toplevel)
37+
38+
# run_or_fail npm ci
39+
# run_or_fail npm run generate-dependencies --workspaces --if-present
40+
# run_or_fail npm run lambda-build --workspaces --if-present
41+
42+
# # revert back to original directory
43+
# cd -

0 commit comments

Comments
 (0)