From 2a6f921b88abae519474be82194c984e8c138c83 Mon Sep 17 00:00:00 2001 From: "Ross Buggins (NHS)" Date: Wed, 29 May 2024 22:08:35 +0100 Subject: [PATCH] Dependancies asdf for make all fully automated (#12) * asdf for zsh into post create command * change to ws folder * as scripts * zsh in post create * try bash interactive * trying without interactive * running with zsh * port forwards and make working * source before make --- .devcontainer/devcontainer.json | 4 +++- scripts/devcontainer/postcreatecommand.sh | 17 +++++++++++++++++ scripts/devcontainer/poststartcommand.sh | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 scripts/devcontainer/postcreatecommand.sh create mode 100755 scripts/devcontainer/poststartcommand.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 889c31b..dd99073 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,7 +9,9 @@ // 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": "jekyll --version && cd docs && bundle install", + "postCreateCommand": "zsh scripts/devcontainer/postcreatecommand.sh", + "postStartCommand": "zsh scripts/devcontainer/poststartcommand.sh", + "forwardPorts": [4000], // Configure tool-specific properties. "customizations": { "codespaces": { 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