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
3 changes: 1 addition & 2 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/jekyll-devcontainer/.gitignore

This file was deleted.

6 changes: 1 addition & 5 deletions src/jekyll-devcontainer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand All @@ -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
12 changes: 0 additions & 12 deletions src/jekyll-devcontainer/src/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
11 changes: 0 additions & 11 deletions src/jekyll-devcontainer/src/.devcontainer/nhsnotify/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Loading