Skip to content

Commit

Permalink
Merge pull request #21 from NHSDigital/adding-dev-container
Browse files Browse the repository at this point in the history
added dev container to nhs-notify repo and auto launch tasks.
  • Loading branch information
RossBugginsNHS authored May 30, 2024
2 parents 0f524d9 + b92cdd0 commit 007486f
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 68 deletions.
104 changes: 104 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
36 changes: 0 additions & 36 deletions .vscode/extensions.json

This file was deleted.

11 changes: 0 additions & 11 deletions .vscode/settings.json

This file was deleted.

22 changes: 14 additions & 8 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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",
}
}
]
}
File renamed without changes.
13 changes: 13 additions & 0 deletions docs/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "jekyll",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "make debug",
"type": "shell"
}
]
}
13 changes: 0 additions & 13 deletions project.code-workspace

This file was deleted.

17 changes: 17 additions & 0 deletions scripts/devcontainer/postcreatecommand.sh
Original file line number Diff line number Diff line change
@@ -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'
3 changes: 3 additions & 0 deletions scripts/devcontainer/poststartcommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
source ~/.zshrc
make config

0 comments on commit 007486f

Please sign in to comment.