From 69a7c2fe791c76c7001e5556ad458b4057793551 Mon Sep 17 00:00:00 2001 From: aidenvaines-cgi Date: Tue, 14 Jul 2026 11:40:02 +0100 Subject: [PATCH] CCM-18536 fixing ASDF packages --- docs/Gemfile.lock | 3 +-- src/jekyll-devcontainer/.gitignore | 1 - src/jekyll-devcontainer/Makefile | 6 +---- .../src/.devcontainer/Dockerfile | 12 ---------- .../src/.devcontainer/devcontainer-lock.json | 10 ++++++++ .../src/.devcontainer/devcontainer.json | 8 ++++++- .../src/.devcontainer/nhsnotify/install.sh | 11 --------- .../nhsnotify/postcreatecommand.sh | 24 +++++++++---------- 8 files changed, 30 insertions(+), 45 deletions(-) delete mode 100644 src/jekyll-devcontainer/.gitignore diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index d5eadbe..2fa5cf0 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -15,8 +15,7 @@ GEM eventmachine (1.2.7) ffi (1.16.3) forwardable-extended (2.6.0) - google-protobuf (3.25.5-arm64-darwin) - google-protobuf (3.25.5-x86_64-linux) + google-protobuf (3.25.8) http_parser.rb (0.8.0) i18n (1.14.5) concurrent-ruby (~> 1.0) diff --git a/src/jekyll-devcontainer/.gitignore b/src/jekyll-devcontainer/.gitignore deleted file mode 100644 index 752bb32..0000000 --- a/src/jekyll-devcontainer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -src/.devcontainer/.tool-versions diff --git a/src/jekyll-devcontainer/Makefile b/src/jekyll-devcontainer/Makefile index 2ad3465..bda56ee 100644 --- a/src/jekyll-devcontainer/Makefile +++ b/src/jekyll-devcontainer/Makefile @@ -2,12 +2,10 @@ IMAGE ?= ghcr.io/nhsdigital/nhs-notify-web-cms build: $(MAKE) -C ../../ version - cp ../../.tool-versions ./src/.devcontainer/.tool-versions ver=$$(head -n 1 ../../.version 2> /dev/null || echo unknown); \ verb=$$(echo $$ver | sed 's/+.*//'); \ echo "version: $$verb"; \ - BUILDKIT_PROGRESS=plain npx --yes @devcontainers/cli build --workspace-folder ./src --image-name "${IMAGE}:$$verb"; \ - rm -f ./src/.devcontainer/.tool-versions + BUILDKIT_PROGRESS=plain npx --yes @devcontainers/cli build --workspace-folder ./src --image-name "${IMAGE}:$$verb" publish: ver=$$(head -n 1 ../../.version 2> /dev/null || echo unknown); \ @@ -18,9 +16,7 @@ publish: docker push "${IMAGE}:latest" debug: - cp ../../.tool-versions ./src/.devcontainer/.tool-versions npx --yes @devcontainers/cli up --workspace-folder ./src npx --yes @devcontainers/cli exec --workspace-folder ./src ls -la ./.devcontainer npx --yes @devcontainers/cli exec --workspace-folder ./src cat ./.devcontainer/packages.txt npx --yes @devcontainers/cli exec --workspace-folder ./src ./.devcontainer/check.sh - rm -f ./src/.devcontainer/.tool-versions diff --git a/src/jekyll-devcontainer/src/.devcontainer/Dockerfile b/src/jekyll-devcontainer/src/.devcontainer/Dockerfile index 3e2c6b1..5426e06 100644 --- a/src/jekyll-devcontainer/src/.devcontainer/Dockerfile +++ b/src/jekyll-devcontainer/src/.devcontainer/Dockerfile @@ -1,18 +1,6 @@ FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/jekyll:3.4-bookworm LABEL org.opencontainers.image.source=https://github.com/NHSDigital/nhs-notify-web-cms -ENV ASDF_DIR=/.asdf -ENV ASDF_DATA_DIR=/.asdf -ENV PATH=${ASDF_DIR}/bin:${ASDF_DIR}/shims:${PATH} - COPY packages.txt packages.txt -COPY .tool-versions .tool-versions - RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive xargs apt-get -yq install < packages.txt - -RUN git clone https://github.com/asdf-vm/asdf.git ${ASDF_DIR} --branch v0.18.0 \ - && awk '/^[a-zA-Z0-9_-]+[[:space:]]+/{print $1}' .tool-versions | while read -r plugin; do ${ASDF_DIR}/bin/asdf plugin add "$plugin" || true; done \ - && ${ASDF_DIR}/bin/asdf install \ - && ${ASDF_DIR}/bin/asdf reshim \ - && rm -f .tool-versions diff --git a/src/jekyll-devcontainer/src/.devcontainer/devcontainer-lock.json b/src/jekyll-devcontainer/src/.devcontainer/devcontainer-lock.json index a38c863..e8a5451 100644 --- a/src/jekyll-devcontainer/src/.devcontainer/devcontainer-lock.json +++ b/src/jekyll-devcontainer/src/.devcontainer/devcontainer-lock.json @@ -1,5 +1,10 @@ { "features": { + "ghcr.io/devcontainers-extra/features/asdf-package:1": { + "version": "1.0.10", + "resolved": "ghcr.io/devcontainers-extra/features/asdf-package@sha256:109f8d310417ee982eb6fb89bfe027a0353f2b9aea010a3019d6efd3f7ffc284", + "integrity": "sha256:109f8d310417ee982eb6fb89bfe027a0353f2b9aea010a3019d6efd3f7ffc284" + }, "ghcr.io/devcontainers/features/aws-cli:1": { "version": "1.1.4", "resolved": "ghcr.io/devcontainers/features/aws-cli@sha256:1f93c8315b7a6d76982ebb2269f8b0d50413fc0f965c032edf4aee0caceb73ef", @@ -24,6 +29,11 @@ "version": "1.7.1", "resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6", "integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6" + }, + "ghcr.io/devcontainers/features/python:1": { + "version": "1.8.0", + "resolved": "ghcr.io/devcontainers/features/python@sha256:fbcad6955caeecc5ad3f7886baf652e25cba5225a6c4c2287c536de2e5607511", + "integrity": "sha256:fbcad6955caeecc5ad3f7886baf652e25cba5225a6c4c2287c536de2e5607511" } } } diff --git a/src/jekyll-devcontainer/src/.devcontainer/devcontainer.json b/src/jekyll-devcontainer/src/.devcontainer/devcontainer.json index ab0bd35..b5e6a9e 100644 --- a/src/jekyll-devcontainer/src/.devcontainer/devcontainer.json +++ b/src/jekyll-devcontainer/src/.devcontainer/devcontainer.json @@ -94,7 +94,13 @@ "ghcr.io/devcontainers/features/node:1": { "nodeGypDependencies": true, "nvmVersion": "latest", - "version": "lts" + "version": "22.22.0" + }, + "ghcr.io/devcontainers/features/python:1": { + "version": "3.13.2" + }, + "ghcr.io/devcontainers-extra/features/asdf-package:1": { + "version": "0.18.0" } }, "forwardPorts": [ diff --git a/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/install.sh b/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/install.sh index 3cec590..05d7e5d 100755 --- a/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/install.sh +++ b/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/install.sh @@ -3,17 +3,6 @@ cp ./postcreatecommand.sh /postcreatecommand.sh cp ~/.zshrc /.zshrc -if [[ ! -d /.asdf ]]; then - git clone https://github.com/asdf-vm/asdf.git /.asdf --branch v0.18.0 -fi - -# Remove any existing home-based asdf init lines to avoid switching to /home/vscode/.asdf. -sed -i "/\. '\$HOME\/.asdf\/completions\/asdf.bash'/d" /.zshrc -sed -i '/\. \/\.asdf\/completions\/asdf.bash/d' /.zshrc - -grep -qxF 'export ASDF_DIR=/.asdf' /.zshrc || echo 'export ASDF_DIR=/.asdf' >> /.zshrc -grep -qxF 'export ASDF_DATA_DIR=/.asdf' /.zshrc || echo 'export ASDF_DATA_DIR=/.asdf' >> /.zshrc -grep -qxF 'export PATH=/.asdf/bin:/.asdf/shims:$PATH' /.zshrc || echo 'export PATH=/.asdf/bin:/.asdf/shims:$PATH' >> /.zshrc sed -i "/plugins=/c\plugins=(git ssh-agent sudo terraform dirhistory zsh-autosuggestions)" /.zshrc cat /.zshrc diff --git a/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/postcreatecommand.sh b/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/postcreatecommand.sh index 5b30b79..ac7fe67 100755 --- a/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/postcreatecommand.sh +++ b/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/postcreatecommand.sh @@ -7,19 +7,17 @@ ls -la ${ZSH_CUSTOM:-~/.oh-my-zsh/custom} cat ~/.zshrc source ~/.zshrc -export ASDF_DIR=/.asdf -export ASDF_DATA_DIR=/.asdf -export PATH="$ASDF_DIR/shims:$ASDF_DIR/bin:$PATH" -ASDF_BIN="$ASDF_DIR/bin/asdf" +repo_root="$(git rev-parse --show-toplevel 2> /dev/null || pwd)" +cd "$repo_root" || exit 1 -# Install tools pinned in .tool-versions so runtime versions are consistent. -$ASDF_BIN install -$ASDF_BIN reshim -hash -r # Rehash shims so that the new versions are used +pre-commit install \ + --config scripts/config/pre-commit.yaml \ + --install-hooks -echo 'asdf setup complete' -make config -echo 'make config complete' +cd docs || exit 1 +bundle config set --local path vendor/bundle +bundle install +npm install +make include-npm-deps -jekyll --version && cd docs && bundle install -echo 'jekyll setup complete' +echo 'post-create setup complete'