forked from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from NHSDigital/rossbugginsnhs/2024-07-03-preb…
…uild-dev-container Rossbugginsnhs/2024 07 03 prebuild dev container
- Loading branch information
Showing
11 changed files
with
226 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
build: | ||
make -C ../../ Makefile version | ||
npm install -g @devcontainers/cli | ||
ver=$$(head -n 1 ../../.version 2> /dev/null || echo unknown); \ | ||
verb=$$(echo $$ver | sed 's/\+.*//'); \ | ||
echo "version: $$verb"; \ | ||
BUILDKIT_PROGRESS=plain devcontainer build --workspace-folder ./src --image-name "ghcr.io/nhsdigital/nhs-notify-template-repository:$$verb" | ||
|
||
publish: | ||
ver=$$(head -n 1 ../../.version 2> /dev/null || echo unknown); \ | ||
verb=$$(echo $$ver | sed 's/\+.*//'); \ | ||
echo "version: $$verb"; \ | ||
docker image tag ghcr.io/nhsdigital/nhs-notify-template-repository:$$verb ghcr.io/nhsdigital/nhs-notify-template-repository:latest; \ | ||
docker push "ghcr.io/nhsdigital/nhs-notify-template-repository:$$verb"; \ | ||
docker push "ghcr.io/nhsdigital/nhs-notify-template-repository:latest" | ||
|
||
debug: | ||
devcontainer up --workspace-folder ./src | ||
devcontainer exec --workspace-folder ./src ls -la |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Publishing | ||
|
||
To publish, create classic and docker login before `make publish` | ||
|
||
Docker login: | ||
|
||
```bash | ||
export CR_PAT=YOUR_TOKEN | ||
echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/jekyll:2-bullseye | ||
LABEL org.opencontainers.image.source=https://github.com/NHSDigital/nhs-notify-repository-template |
105 changes: 105 additions & 0 deletions
105
src/jekyll-devcontainer/src/.devcontainer/devcontainer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"customizations": { | ||
"codespaces": { | ||
"openFiles": [ | ||
"README.md", | ||
".github/SECURITY.md", | ||
"docs/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": {}, | ||
"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 Default Dev Container", | ||
"runArgs": [ | ||
"--platform=linux/amd64" | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
src/jekyll-devcontainer/src/.devcontainer/nhsnotify/devcontainer-feature.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.0" | ||
} |
18 changes: 18 additions & 0 deletions
18
src/jekyll-devcontainer/src/.devcontainer/nhsnotify/install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
15 changes: 15 additions & 0 deletions
15
src/jekyll-devcontainer/src/.devcontainer/nhsnotify/postcreatecommand.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |