From f87caf9ac2d4ce18b16a572ec4329afba8f0a502 Mon Sep 17 00:00:00 2001 From: aidenvaines-cgi Date: Wed, 8 Jul 2026 15:03:10 +0100 Subject: [PATCH 1/4] CCM-18536 adding localised devcontainer build --- .devcontainer/devcontainer.json | 2 +- .../workflows/devcontainer-build-publish.yaml | 39 +++++++++++++++++++ Makefile | 32 ++++++++++++++- src/jekyll-devcontainer/Dockerfile | 18 +++++++++ src/jekyll-devcontainer/VERSION | 1 + 5 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/devcontainer-build-publish.yaml create mode 100644 src/jekyll-devcontainer/Dockerfile create mode 100644 src/jekyll-devcontainer/VERSION diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c8a6205f..663c8cec 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -56,7 +56,7 @@ } }, "forwardPorts": [4000], - "image": "ghcr.io/nhsdigital/nhs-notify-template-repository:latest", + "image": "ghcr.io/nhsdigital/nhs-notify-web-cms-jekyll-devcontainer:latest", "name": "Jekyll", "runArgs": ["--platform=linux/amd64"] } diff --git a/.github/workflows/devcontainer-build-publish.yaml b/.github/workflows/devcontainer-build-publish.yaml new file mode 100644 index 00000000..d5ce9b39 --- /dev/null +++ b/.github/workflows/devcontainer-build-publish.yaml @@ -0,0 +1,39 @@ +name: "Build and publish devcontainer" + +on: + push: + branches: + - main + paths: + - gem.lock + - docs/Gemfile.lock + - src/jekyll-devcontainer/** + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + build-and-publish: + name: "Build and publish Jekyll devcontainer" + runs-on: ubuntu-latest + timeout-minutes: 30 + env: + BUILD_TARGET: devcontainer + DEVCONTAINER_IMAGE: ghcr.io/nhsdigital/nhs-notify-web-cms-jekyll-devcontainer + steps: + - name: "Checkout code" + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + + - name: "Log in to GitHub Container Registry" + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin + + - name: "Build devcontainer image" + run: | + make build + + - name: "Publish devcontainer image" + run: | + make publish \ No newline at end of file diff --git a/Makefile b/Makefile index ea70e95e..d6b87c6c 100644 --- a/Makefile +++ b/Makefile @@ -7,14 +7,39 @@ include scripts/init.mk # Example CI/CD targets are: dependencies, build, publish, deploy, clean, etc. +DEVCONTAINER_DIR ?= src/jekyll-devcontainer +DEVCONTAINER_IMAGE ?= ghcr.io/nhsdigital/nhs-notify-web-cms-jekyll-devcontainer +DEVCONTAINER_TITLE ?= NHS Notify Web CMS Jekyll devcontainer + dependencies: # Install dependencies needed to build and test the project @Pipeline # TODO: Implement installation of your project dependencies build: # Build the project artefact @Pipeline - (cd docs && make build) + if [[ "$${BUILD_TARGET:-all}" == "devcontainer" ]]; then + make build-devcontainer + else + (cd docs && make build) + make build-devcontainer + fi publish: # Publish the project artefact @Pipeline - # TODO: Implement the artefact publishing step + if [[ "$${BUILD_TARGET:-all}" == "devcontainer" ]]; then + make publish-devcontainer + else + make publish-devcontainer + fi + +build-devcontainer: # Build the devcontainer image @Pipeline + make docker-build \ + dir=${DEVCONTAINER_DIR} \ + DOCKER_IMAGE=${DEVCONTAINER_IMAGE} \ + DOCKER_TITLE="${DEVCONTAINER_TITLE}" + +publish-devcontainer: # Publish the devcontainer image @Pipeline + make docker-push \ + dir=${DEVCONTAINER_DIR} \ + DOCKER_IMAGE=${DEVCONTAINER_IMAGE} \ + DOCKER_TITLE="${DEVCONTAINER_TITLE}" deploy: # Deploy the project artefact to the target environment @Pipeline # TODO: Implement the artefact deployment step @@ -34,7 +59,10 @@ version: ${VERBOSE}.SILENT: \ build \ + build-devcontainer \ clean \ config \ dependencies \ deploy \ + publish \ + publish-devcontainer \ diff --git a/src/jekyll-devcontainer/Dockerfile b/src/jekyll-devcontainer/Dockerfile new file mode 100644 index 00000000..c03a1004 --- /dev/null +++ b/src/jekyll-devcontainer/Dockerfile @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/devcontainers/ruby:3.3-bookworm + +ARG DEBIAN_FRONTEND=noninteractive + +# Install Node.js for frontend tooling used by docs build scripts. +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates curl gnupg make \ + && mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \ + && apt-get update \ + && apt-get install -y --no-install-recommends nodejs \ + && npm install -g npm@latest \ + && gem install bundler:2.5.10 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /workspaces/nhs-notify-web-cms diff --git a/src/jekyll-devcontainer/VERSION b/src/jekyll-devcontainer/VERSION new file mode 100644 index 00000000..2a170c7b --- /dev/null +++ b/src/jekyll-devcontainer/VERSION @@ -0,0 +1 @@ +0.0.${yyyy}${mm}${dd}.${HH}${MM}${SS}-${hash} \ No newline at end of file From 0352c39640f60f25cea788a1017ba9db995fb853 Mon Sep 17 00:00:00 2001 From: aidenvaines-cgi Date: Wed, 8 Jul 2026 15:18:06 +0100 Subject: [PATCH 2/4] CCM-18536 adding localised devcontainer build --- .../workflows/devcontainer-build-publish.yaml | 2 +- src/jekyll-devcontainer/Dockerfile | 20 +++++++++---------- src/jekyll-devcontainer/VERSION | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/devcontainer-build-publish.yaml b/.github/workflows/devcontainer-build-publish.yaml index d5ce9b39..5fea4b9d 100644 --- a/.github/workflows/devcontainer-build-publish.yaml +++ b/.github/workflows/devcontainer-build-publish.yaml @@ -36,4 +36,4 @@ jobs: - name: "Publish devcontainer image" run: | - make publish \ No newline at end of file + make publish diff --git a/src/jekyll-devcontainer/Dockerfile b/src/jekyll-devcontainer/Dockerfile index c03a1004..cacbd219 100644 --- a/src/jekyll-devcontainer/Dockerfile +++ b/src/jekyll-devcontainer/Dockerfile @@ -4,15 +4,15 @@ ARG DEBIAN_FRONTEND=noninteractive # Install Node.js for frontend tooling used by docs build scripts. RUN apt-get update \ - && apt-get install -y --no-install-recommends ca-certificates curl gnupg make \ - && mkdir -p /etc/apt/keyrings \ - && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ - && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \ - && apt-get update \ - && apt-get install -y --no-install-recommends nodejs \ - && npm install -g npm@latest \ - && gem install bundler:2.5.10 \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && apt-get install -y --no-install-recommends ca-certificates curl gnupg make \ + && mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \ + && apt-get update \ + && apt-get install -y --no-install-recommends nodejs \ + && npm install -g npm@latest \ + && gem install bundler:2.5.10 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* WORKDIR /workspaces/nhs-notify-web-cms diff --git a/src/jekyll-devcontainer/VERSION b/src/jekyll-devcontainer/VERSION index 2a170c7b..58a1d962 100644 --- a/src/jekyll-devcontainer/VERSION +++ b/src/jekyll-devcontainer/VERSION @@ -1 +1 @@ -0.0.${yyyy}${mm}${dd}.${HH}${MM}${SS}-${hash} \ No newline at end of file +0.0.${yyyy}${mm}${dd}.${HH}${MM}${SS}-${hash} From 2c04715ab67f40fce3a3d01e0508054da63f49d1 Mon Sep 17 00:00:00 2001 From: aidenvaines-cgi Date: Wed, 8 Jul 2026 15:48:22 +0100 Subject: [PATCH 3/4] CCM-18536 adding localised devcontainer build --- src/jekyll-devcontainer/Dockerfile | 19 +++----------- src/jekyll-devcontainer/packages.txt | 39 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 src/jekyll-devcontainer/packages.txt diff --git a/src/jekyll-devcontainer/Dockerfile b/src/jekyll-devcontainer/Dockerfile index cacbd219..991c18e6 100644 --- a/src/jekyll-devcontainer/Dockerfile +++ b/src/jekyll-devcontainer/Dockerfile @@ -1,18 +1,7 @@ -FROM mcr.microsoft.com/devcontainers/ruby:3.3-bookworm +FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/jekyll:2-bullseye -ARG DEBIAN_FRONTEND=noninteractive +LABEL org.opencontainers.image.source=https://github.com/NHSDigital/nhs-notify-web-cms -# Install Node.js for frontend tooling used by docs build scripts. -RUN apt-get update \ - && apt-get install -y --no-install-recommends ca-certificates curl gnupg make \ - && mkdir -p /etc/apt/keyrings \ - && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ - && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \ - && apt-get update \ - && apt-get install -y --no-install-recommends nodejs \ - && npm install -g npm@latest \ - && gem install bundler:2.5.10 \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* +COPY packages.txt packages.txt -WORKDIR /workspaces/nhs-notify-web-cms +RUN apt-get update && xargs apt-get -y install < packages.txt diff --git a/src/jekyll-devcontainer/packages.txt b/src/jekyll-devcontainer/packages.txt new file mode 100644 index 00000000..1cdc793a --- /dev/null +++ b/src/jekyll-devcontainer/packages.txt @@ -0,0 +1,39 @@ +ca-certificates +fonts-liberation +libasound2 +libatk-adaptor +libatk-bridge2.0-0 +libatk1.0-0 +libc6 +libcairo2 +libcups2 +libdbus-1-3 +libexpat1 +libfontconfig1 +libgbm1 +libgcc1 +libglib2.0-0 +libgtk-3-0 +libnspr4 +libnss3 +libpango-1.0-0 +libpangocairo-1.0-0 +libstdc++6 +libx11-6 +libx11-xcb1 +libxcb1 +libxcomposite1 +libxcursor1 +libxdamage1 +libxext6 +libxfixes3 +libxi6 +libxrandr2 +libxrender1 +libxss1 +libxtst6 +lsb-release +openbox +wget +xdg-utils +xorg From 0811990aa583b8428a25955c810f15d6fbe5ca6d Mon Sep 17 00:00:00 2001 From: aidenvaines-cgi Date: Wed, 8 Jul 2026 16:30:40 +0100 Subject: [PATCH 4/4] CCM-18536 adding localised devcontainer build --- .devcontainer/devcontainer.json | 2 +- .../workflows/devcontainer-build-publish.yaml | 7 +- Makefile | 13 +-- src/jekyll-devcontainer/Makefile | 22 ++++ src/jekyll-devcontainer/README.md | 10 ++ src/jekyll-devcontainer/VERSION | 1 - .../{ => src/.devcontainer}/Dockerfile | 5 +- .../src/.devcontainer/check.sh | 5 + .../src/.devcontainer/devcontainer-lock.json | 29 +++++ .../src/.devcontainer/devcontainer.json | 107 ++++++++++++++++++ .../nhsnotify/devcontainer-feature.json | 11 ++ .../src/.devcontainer/nhsnotify/install.sh | 18 +++ .../nhsnotify/postcreatecommand.sh | 15 +++ .../{ => src/.devcontainer}/packages.txt | 2 +- 14 files changed, 230 insertions(+), 17 deletions(-) create mode 100644 src/jekyll-devcontainer/Makefile create mode 100644 src/jekyll-devcontainer/README.md delete mode 100644 src/jekyll-devcontainer/VERSION rename src/jekyll-devcontainer/{ => src/.devcontainer}/Dockerfile (62%) create mode 100755 src/jekyll-devcontainer/src/.devcontainer/check.sh create mode 100644 src/jekyll-devcontainer/src/.devcontainer/devcontainer-lock.json create mode 100644 src/jekyll-devcontainer/src/.devcontainer/devcontainer.json create mode 100644 src/jekyll-devcontainer/src/.devcontainer/nhsnotify/devcontainer-feature.json create mode 100755 src/jekyll-devcontainer/src/.devcontainer/nhsnotify/install.sh create mode 100755 src/jekyll-devcontainer/src/.devcontainer/nhsnotify/postcreatecommand.sh rename src/jekyll-devcontainer/{ => src/.devcontainer}/packages.txt (98%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 663c8cec..69d826a0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -56,7 +56,7 @@ } }, "forwardPorts": [4000], - "image": "ghcr.io/nhsdigital/nhs-notify-web-cms-jekyll-devcontainer:latest", + "image": "ghcr.io/nhsdigital/nhs-notify-web-cms:latest", "name": "Jekyll", "runArgs": ["--platform=linux/amd64"] } diff --git a/.github/workflows/devcontainer-build-publish.yaml b/.github/workflows/devcontainer-build-publish.yaml index 5fea4b9d..a48574db 100644 --- a/.github/workflows/devcontainer-build-publish.yaml +++ b/.github/workflows/devcontainer-build-publish.yaml @@ -21,11 +21,16 @@ jobs: timeout-minutes: 30 env: BUILD_TARGET: devcontainer - DEVCONTAINER_IMAGE: ghcr.io/nhsdigital/nhs-notify-web-cms-jekyll-devcontainer + DEVCONTAINER_IMAGE: ghcr.io/nhsdigital/nhs-notify-web-cms steps: - name: "Checkout code" uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - name: "Set up Node.js" + uses: actions/setup-node@v4 + with: + node-version: "22" + - name: "Log in to GitHub Container Registry" run: | echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin diff --git a/Makefile b/Makefile index d6b87c6c..cd74e41f 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,7 @@ include scripts/init.mk # Example CI/CD targets are: dependencies, build, publish, deploy, clean, etc. DEVCONTAINER_DIR ?= src/jekyll-devcontainer -DEVCONTAINER_IMAGE ?= ghcr.io/nhsdigital/nhs-notify-web-cms-jekyll-devcontainer -DEVCONTAINER_TITLE ?= NHS Notify Web CMS Jekyll devcontainer +DEVCONTAINER_IMAGE ?= ghcr.io/nhsdigital/nhs-notify-web-cms dependencies: # Install dependencies needed to build and test the project @Pipeline # TODO: Implement installation of your project dependencies @@ -30,16 +29,10 @@ publish: # Publish the project artefact @Pipeline fi build-devcontainer: # Build the devcontainer image @Pipeline - make docker-build \ - dir=${DEVCONTAINER_DIR} \ - DOCKER_IMAGE=${DEVCONTAINER_IMAGE} \ - DOCKER_TITLE="${DEVCONTAINER_TITLE}" + make -C ${DEVCONTAINER_DIR} build IMAGE=${DEVCONTAINER_IMAGE} publish-devcontainer: # Publish the devcontainer image @Pipeline - make docker-push \ - dir=${DEVCONTAINER_DIR} \ - DOCKER_IMAGE=${DEVCONTAINER_IMAGE} \ - DOCKER_TITLE="${DEVCONTAINER_TITLE}" + make -C ${DEVCONTAINER_DIR} publish IMAGE=${DEVCONTAINER_IMAGE} deploy: # Deploy the project artefact to the target environment @Pipeline # TODO: Implement the artefact deployment step diff --git a/src/jekyll-devcontainer/Makefile b/src/jekyll-devcontainer/Makefile new file mode 100644 index 00000000..0174644a --- /dev/null +++ b/src/jekyll-devcontainer/Makefile @@ -0,0 +1,22 @@ +IMAGE ?= ghcr.io/nhsdigital/nhs-notify-web-cms + +build: + $(MAKE) -C ../../ version + 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" + +publish: + ver=$$(head -n 1 ../../.version 2> /dev/null || echo unknown); \ + verb=$$(echo $$ver | sed 's/+.*//'); \ + echo "version: $$verb"; \ + docker image tag ${IMAGE}:$$verb ${IMAGE}:latest; \ + docker push "${IMAGE}:$$verb"; \ + docker push "${IMAGE}:latest" + +debug: + 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 \ No newline at end of file diff --git a/src/jekyll-devcontainer/README.md b/src/jekyll-devcontainer/README.md new file mode 100644 index 00000000..33c52bb6 --- /dev/null +++ b/src/jekyll-devcontainer/README.md @@ -0,0 +1,10 @@ +# Publishing + +To publish, create a classic token and run `docker login` before `make publish`. + +Docker login: + +```bash +export CR_PAT=YOUR_TOKEN +echo "$CR_PAT" | docker login ghcr.io -u USERNAME --password-stdin +``` \ No newline at end of file diff --git a/src/jekyll-devcontainer/VERSION b/src/jekyll-devcontainer/VERSION deleted file mode 100644 index 58a1d962..00000000 --- a/src/jekyll-devcontainer/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.${yyyy}${mm}${dd}.${HH}${MM}${SS}-${hash} diff --git a/src/jekyll-devcontainer/Dockerfile b/src/jekyll-devcontainer/src/.devcontainer/Dockerfile similarity index 62% rename from src/jekyll-devcontainer/Dockerfile rename to src/jekyll-devcontainer/src/.devcontainer/Dockerfile index 991c18e6..eb53bbec 100644 --- a/src/jekyll-devcontainer/Dockerfile +++ b/src/jekyll-devcontainer/src/.devcontainer/Dockerfile @@ -1,7 +1,6 @@ -FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/jekyll:2-bullseye - +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 COPY packages.txt packages.txt -RUN apt-get update && xargs apt-get -y install < packages.txt +RUN apt-get update && DEBIAN_FRONTEND=noninteractive xargs apt-get -yq install < packages.txt \ No newline at end of file diff --git a/src/jekyll-devcontainer/src/.devcontainer/check.sh b/src/jekyll-devcontainer/src/.devcontainer/check.sh new file mode 100755 index 00000000..f127ffd0 --- /dev/null +++ b/src/jekyll-devcontainer/src/.devcontainer/check.sh @@ -0,0 +1,5 @@ +#! /bin/zsh + +cd ./.devcontainer +cat packages.txt +apt-get -s install < packages.txt \ No newline at end of file diff --git a/src/jekyll-devcontainer/src/.devcontainer/devcontainer-lock.json b/src/jekyll-devcontainer/src/.devcontainer/devcontainer-lock.json new file mode 100644 index 00000000..2ad7c887 --- /dev/null +++ b/src/jekyll-devcontainer/src/.devcontainer/devcontainer-lock.json @@ -0,0 +1,29 @@ +{ + "features": { + "ghcr.io/devcontainers/features/aws-cli:1": { + "version": "1.1.4", + "resolved": "ghcr.io/devcontainers/features/aws-cli@sha256:1f93c8315b7a6d76982ebb2269f8b0d50413fc0f965c032edf4aee0caceb73ef", + "integrity": "sha256:1f93c8315b7a6d76982ebb2269f8b0d50413fc0f965c032edf4aee0caceb73ef" + }, + "ghcr.io/devcontainers/features/common-utils:2": { + "version": "2.5.9", + "resolved": "ghcr.io/devcontainers/features/common-utils@sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a", + "integrity": "sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a" + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "version": "2.17.0", + "resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:25b9f05705ffba7dbe503230ac76081419306f8c8bc88e0ce78c4ecd99a0c78c", + "integrity": "sha256:25b9f05705ffba7dbe503230ac76081419306f8c8bc88e0ce78c4ecd99a0c78c" + }, + "ghcr.io/devcontainers/features/github-cli:1": { + "version": "1.1.0", + "resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671", + "integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671" + }, + "ghcr.io/devcontainers/features/node:1": { + "version": "1.7.1", + "resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6", + "integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6" + } + } +} \ No newline at end of file diff --git a/src/jekyll-devcontainer/src/.devcontainer/devcontainer.json b/src/jekyll-devcontainer/src/.devcontainer/devcontainer.json new file mode 100644 index 00000000..b6cf9c2c --- /dev/null +++ b/src/jekyll-devcontainer/src/.devcontainer/devcontainer.json @@ -0,0 +1,107 @@ +{ + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "codespaces": { + "openFiles": [ + "README.md", + ".github/SECURITY.md", + "docs/pages/index.md" + ] + }, + "vscode": { + "extensions": [ + "alefragnani.bookmarks", + "AmazonWebServices.aws-toolkit-vscode", + "chdsbd.github-code-owners", + "davidanson.vscode-markdownlint", + "dbaeumer.vscode-eslint", + "donjayamanne.githistory", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "fvclaus.sort-json-array", + "github.codespaces", + "github.github-vscode-theme", + "github.remotehub", + "github.vscode-github-actions", + "github.vscode-pull-request-github", + "hediet.vscode-drawio", + "johnpapa.vscode-peacock", + "joshx.workspace-terminals", + "maattdd.gitless", + "mhutchie.git-graph", + "ms-azuretools.vscode-docker", + "ms-vscode-remote.remote-containers", + "ms-vscode-remote.remote-wsl", + "ms-vscode.hexeditor", + "ms-vscode.live-server", + "ms-vsliveshare.vsliveshare", + "redhat.vscode-xml", + "streetsidesoftware.code-spell-checker-british-english", + "takumii.markdowntable", + "tamasfe.even-better-toml", + "tomoki1207.pdf", + "vscode-icons-team.vscode-icons", + "vstirbu.vscode-mermaid-preview", + "wayou.vscode-todo-highlight", + "yzane.markdown-pdf", + "yzhang.dictionary-completion", + "yzhang.markdown-all-in-one", + "zoma.vscode-auto-open-workspace" + ], + "settings": { + "[makefile]": { + "editor.detectIndentation": false, + "editor.insertSpaces": false + }, + "autoOpenWorkspace.enableAutoOpenIfSingleWorkspace": true, + "editor.formatOnSave": true, + "extensions.ignoreRecommendations": true, + "files.insertFinalNewline": true + } + } + }, + "features": { + "./nhsnotify": { + "version": "1.0.1" + }, + "ghcr.io/devcontainers/features/aws-cli:1": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/common-utils:2": { + "configureZshAsDefaultShell": true, + "installOhMyZsh": true, + "installOhMyZshConfig": true, + "installZsh": true, + "upgradePackages": true, + "userGid": "automatic", + "userUid": "automatic", + "username": "automatic" + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "azureDnsAutoDetection": true, + "dockerDashComposeVersion": "latest", + "installDockerBuildx": true, + "installDockerComposeSwitch": true, + "moby": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/github-cli:1": { + "installDirectlyFromGitHubRelease": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/node:1": { + "nodeGypDependencies": true, + "nvmVersion": "latest", + "version": "lts" + } + }, + "forwardPorts": [ + 4000 + ], + "name": "NHS Notify Web CMS Dev Container", + "runArgs": [ + "--platform=linux/amd64" + ] +} \ No newline at end of file diff --git a/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/devcontainer-feature.json b/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/devcontainer-feature.json new file mode 100644 index 00000000..b970fe89 --- /dev/null +++ b/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/devcontainer-feature.json @@ -0,0 +1,11 @@ +{ + "dependsOn": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installOhMyZsh": true + } + }, + "id": "nhsnotify", + "name": "Notify Custom", + "postCreateCommand": "zsh /postcreatecommand.sh", + "version": "1.0.1" +} \ No newline at end of file diff --git a/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/install.sh b/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/install.sh new file mode 100755 index 00000000..b4d20689 --- /dev/null +++ b/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/install.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +cp ./postcreatecommand.sh /postcreatecommand.sh + +cp ~/.zshrc /.zshrc +rm -Rf /.asdf +git clone https://github.com/asdf-vm/asdf.git /.asdf +chmod +x /.asdf/asdf.sh +echo '. /.asdf/asdf.sh' >> /.zshrc +echo '. /.asdf/completions/asdf.bash' >> /.zshrc +sed -i "/plugins=/c\plugins=(git ssh-agent sudo terraform dirhistory zsh-autosuggestions)" /.zshrc + +cat /.zshrc + +cp /.zshrc ~/.zshrc +source ~/.zshrc +mkdir -p /zsh/plugins/zsh-autosuggestions +git clone https://github.com/zsh-users/zsh-autosuggestions /zsh/plugins/zsh-autosuggestions \ No newline at end of file diff --git a/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/postcreatecommand.sh b/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/postcreatecommand.sh new file mode 100755 index 00000000..a5796a6c --- /dev/null +++ b/src/jekyll-devcontainer/src/.devcontainer/nhsnotify/postcreatecommand.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +cp /.zshrc ~/.zshrc +cp -r /zsh/* ${ZSH_CUSTOM:-~/.oh-my-zsh/custom} +ls -la ${ZSH_CUSTOM:-~/.oh-my-zsh/custom} + +cat ~/.zshrc +source ~/.zshrc +echo 'asdf setup complete' + +make config +echo 'make config complete' + +jekyll --version && cd docs && bundle install +echo 'jekyll setup complete' \ No newline at end of file diff --git a/src/jekyll-devcontainer/packages.txt b/src/jekyll-devcontainer/src/.devcontainer/packages.txt similarity index 98% rename from src/jekyll-devcontainer/packages.txt rename to src/jekyll-devcontainer/src/.devcontainer/packages.txt index 1cdc793a..44f14cc0 100644 --- a/src/jekyll-devcontainer/packages.txt +++ b/src/jekyll-devcontainer/src/.devcontainer/packages.txt @@ -36,4 +36,4 @@ lsb-release openbox wget xdg-utils -xorg +xorg \ No newline at end of file