diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..dd99073 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,104 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/jekyll +{ + "name": "Jekyll", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye", + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Uncomment the next line to run commands after the container is created. + "postCreateCommand": "zsh scripts/devcontainer/postcreatecommand.sh", + "postStartCommand": "zsh scripts/devcontainer/poststartcommand.sh", + "forwardPorts": [4000], + // Configure tool-specific properties. + "customizations": { + "codespaces": { + "openFiles": [ + "README.md", + ".github/SECURITY.md", + "docs/index.md" + ] + }, + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "editor.formatOnSave": true, + "files.insertFinalNewline": true, + "[makefile]": { + "editor.insertSpaces": false, + "editor.detectIndentation": false + } + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "alefragnani.bookmarks", + "davidanson.vscode-markdownlint", + "dbaeumer.vscode-eslint", + "donjayamanne.githistory", + "eamodio.gitlens", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "github.codespaces", + "github.github-vscode-theme", + "github.remotehub", + "github.vscode-github-actions", + "github.vscode-pull-request-github", + "hediet.vscode-drawio", + "johnpapa.vscode-peacock", + "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", + "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" + ] + } + }, + "features": { + "ghcr.io/devcontainers/features/aws-cli:1": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "moby": true, + "azureDnsAutoDetection": true, + "installDockerBuildx": true, + "installDockerComposeSwitch": true, + "version": "latest", + "dockerDashComposeVersion": "latest" + }, + "ghcr.io/devcontainers/features/node:1": { + "nodeGypDependencies": true, + "version": "lts", + "nvmVersion": "latest" + }, + "ghcr.io/devcontainers/features/github-cli:1": { + "installDirectlyFromGitHubRelease": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "configureZshAsDefaultShell": true, + "installOhMyZsh": true, + "installOhMyZshConfig": true, + "upgradePackages": true, + "username": "automatic", + "userUid": "automatic", + "userGid": "automatic" + } + } + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 957d73f..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "recommendations": [ - "alefragnani.bookmarks", - "davidanson.vscode-markdownlint", - "dbaeumer.vscode-eslint", - "donjayamanne.githistory", - "eamodio.gitlens", - "editorconfig.editorconfig", - "esbenp.prettier-vscode", - "github.codespaces", - "github.github-vscode-theme", - "github.remotehub", - "github.vscode-github-actions", - "github.vscode-pull-request-github", - "hediet.vscode-drawio", - "johnpapa.vscode-peacock", - "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", - "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" - ], - "unwantedRecommendations": [] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 4eacdc9..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "markdownlint.config": { - "MD013": false, - "MD024": { "siblings_only": true }, - "MD033": false - }, - "cSpell.words": [ - "Licence" - ], - "cSpell.language": "en-GB" -} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 6d1b1b6..23f58c6 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,13 +1,19 @@ + { "version": "2.0.0", "tasks": [ - { - "label": "jekyll", - "options": { - "cwd": "${workspaceFolder}/docs/" - }, - "command": "make debug", - "type": "shell" - } + { + "label": "Start Make Config", + "type": "shell", + "command": "make config", + "group": "none", + "presentation": { + "reveal": "always", + "panel": "new" + }, + "runOptions": { + "runOn": "folderOpen", + } + } ] } diff --git a/.vscode/launch.json b/docs/.vscode/launch.json similarity index 100% rename from .vscode/launch.json rename to docs/.vscode/launch.json diff --git a/docs/.vscode/tasks.json b/docs/.vscode/tasks.json new file mode 100644 index 0000000..ba15193 --- /dev/null +++ b/docs/.vscode/tasks.json @@ -0,0 +1,13 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "jekyll", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": "make debug", + "type": "shell" + } + ] +} diff --git a/project.code-workspace b/project.code-workspace deleted file mode 100644 index 3dda11f..0000000 --- a/project.code-workspace +++ /dev/null @@ -1,13 +0,0 @@ -{ - "folders": [ - { - "name": "NHS Notify", - "path": "." - } - ], - "settings": { - "cSpell.words": [ - "endfor" - ] - } -} diff --git a/scripts/devcontainer/postcreatecommand.sh b/scripts/devcontainer/postcreatecommand.sh new file mode 100755 index 0000000..aefabaf --- /dev/null +++ b/scripts/devcontainer/postcreatecommand.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +rm -Rf ~/.asdf +git clone https://github.com/asdf-vm/asdf.git ~/.asdf; +chmod +x ~/.asdf/asdf.sh; +echo '. $HOME/.asdf/asdf.sh' >> ~/.zshrc +echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc + +source ~/.zshrc + +echo 'asdf setup complete' + +make config + +jekyll --version && cd docs && bundle install + +echo 'jekyll setup complete' diff --git a/scripts/devcontainer/poststartcommand.sh b/scripts/devcontainer/poststartcommand.sh new file mode 100755 index 0000000..31a110d --- /dev/null +++ b/scripts/devcontainer/poststartcommand.sh @@ -0,0 +1,3 @@ +#!/bin/bash +source ~/.zshrc +make config