Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"--network=host"
],
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" },
"postAttachCommand": "git-secrets --register-aws; git-secrets --add-provider -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt",
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {
},
"customizations": {
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ build-all: build-base-image build-node-24-image build-node-24-python-3-10-image
build-regression-tests-image

build-image: guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard-IMAGE_TAG
workspace_folder="$${CONTAINER_NAME}"; \
case "$${CONTAINER_NAME}" in \
eps_*) workspace_folder="$$(printf '%s' "$${CONTAINER_NAME}" | tr '_' '-')" ;; \
esac; \
npx devcontainer build \
--workspace-folder ./src/$${BASE_FOLDER}/$${CONTAINER_NAME} \
--workspace-folder ./src/$${BASE_FOLDER}/$${workspace_folder} \
$(NO_CACHE_FLAG) \
--push false \
--output type=image,name="${CONTAINER_PREFIX}$${CONTAINER_NAME}:$${IMAGE_TAG}",push=false,compression=zstd \
Expand Down
1 change: 1 addition & 0 deletions src/base/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ENV CONTAINER_NAME=${CONTAINER_NAME}
ENV TARGETARCH=${TARGETARCH}

COPY .tool-versions.asdf ${SCRIPTS_DIR}/${CONTAINER_NAME}/.tool-versions.asdf
COPY --chmod=755 scripts/lifecycle/*.sh ${SCRIPTS_DIR}/
COPY --chmod=755 scripts/root_install.sh ${SCRIPTS_DIR}/${CONTAINER_NAME}/root_install.sh
COPY --chmod=755 Mk ${SCRIPTS_DIR}/Mk

Expand Down
3 changes: 3 additions & 0 deletions src/base/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"IMAGE_TAG": "${localEnv:IMAGE_TAG}"
}
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"version": "latest",
Expand Down
5 changes: 5 additions & 0 deletions src/base/.devcontainer/scripts/lifecycle/post_attach.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Script to run as devcontainer postAttachCommand
set -euo pipefail

# currently empty
11 changes: 11 additions & 0 deletions src/base/.devcontainer/scripts/lifecycle/post_create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Script to run as devcontainer postCreateCommand
set -euo pipefail

# Install git-secrets, register AWS patterns and NHS rules in an idempotent way
if ! git config --get-all secrets.patterns | grep -Fq AKIA; then
git-secrets --register-aws
fi
if ! git config --get-all secrets.providers | grep -Fxq "cat /usr/share/secrets-scanner/nhsd-rules-deny.txt"; then
git-secrets --add-provider -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt
fi
5 changes: 5 additions & 0 deletions src/base/.devcontainer/scripts/lifecycle/post_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Script to run as devcontainer postStartCommand
set -euo pipefail

# currently empty
3 changes: 3 additions & 0 deletions src/base_node/node_24/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

3 changes: 3 additions & 0 deletions src/projects/eps-data-extract/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

3 changes: 3 additions & 0 deletions src/projects/fhir_facade_api/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

3 changes: 3 additions & 0 deletions src/projects/regression_tests/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"context": "."
},
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
"features": {}
}

Loading