From 1db7a49534ac74d9e8e34829504231165e2ea9ff Mon Sep 17 00:00:00 2001 From: "Ross Buggins (NHS)" Date: Wed, 29 May 2024 19:58:38 +0000 Subject: [PATCH 1/9] asdf for zsh into post create command --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 889c31b..c67706d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,7 +9,7 @@ // 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": "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 && make config && jekyll --version && cd docs && bundle install", // Configure tool-specific properties. "customizations": { "codespaces": { From 96af057ba8dfc0c2761f2bfaa15f3ec4d5087e07 Mon Sep 17 00:00:00 2001 From: "Ross Buggins (NHS)" Date: Wed, 29 May 2024 20:08:29 +0000 Subject: [PATCH 2/9] change to ws folder --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c67706d..06f4129 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,7 +9,7 @@ // 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": "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 && make config && jekyll --version && cd docs && bundle install", + "postCreateCommand": "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 && cd $CODESPACE_VSCODE_FOLDER && make config && jekyll --version && cd docs && bundle install", // Configure tool-specific properties. "customizations": { "codespaces": { From 357dae81a3f3d8d558dc29bb36bf75c108ef0501 Mon Sep 17 00:00:00 2001 From: "Ross Buggins (NHS)" Date: Wed, 29 May 2024 20:27:34 +0000 Subject: [PATCH 3/9] as scripts --- .devcontainer/devcontainer.json | 3 ++- .devcontainer/postcreatecommand.sh | 9 +++++++++ .devcontainer/poststartcommand.sh | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 .devcontainer/postcreatecommand.sh create mode 100755 .devcontainer/poststartcommand.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 06f4129..4b0b1d6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,7 +9,8 @@ // 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": "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 && cd $CODESPACE_VSCODE_FOLDER && make config && jekyll --version && cd docs && bundle install", + "postCreateCommand": "$CODESPACE_VSCODE_FOLDER/.devcontainer/postcreatecommand.sh", + "postStartCommand": "$CODESPACE_VSCODE_FOLDER/.devcontainer/poststartcommand.sh", // Configure tool-specific properties. "customizations": { "codespaces": { diff --git a/.devcontainer/postcreatecommand.sh b/.devcontainer/postcreatecommand.sh new file mode 100755 index 0000000..0447867 --- /dev/null +++ b/.devcontainer/postcreatecommand.sh @@ -0,0 +1,9 @@ +#!/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 + +echo 'asdf setup complete' diff --git a/.devcontainer/poststartcommand.sh b/.devcontainer/poststartcommand.sh new file mode 100755 index 0000000..74e25c5 --- /dev/null +++ b/.devcontainer/poststartcommand.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd $CODESPACE_VSCODE_FOLDER +make config +jekyll --version && cd docs && bundle install From b1732c04b8bf227caa86c15b501717e434a77e86 Mon Sep 17 00:00:00 2001 From: "Ross Buggins (NHS)" Date: Wed, 29 May 2024 20:28:12 +0000 Subject: [PATCH 4/9] zsh in post create --- .devcontainer/postcreatecommand.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/postcreatecommand.sh b/.devcontainer/postcreatecommand.sh index 0447867..31021e6 100755 --- a/.devcontainer/postcreatecommand.sh +++ b/.devcontainer/postcreatecommand.sh @@ -5,5 +5,6 @@ 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 +zsh echo 'asdf setup complete' From bf37e2e98478d5dea1f88fdc4e429d791c814736 Mon Sep 17 00:00:00 2001 From: "Ross Buggins (NHS)" Date: Wed, 29 May 2024 20:39:23 +0000 Subject: [PATCH 5/9] try bash interactive --- .devcontainer/devcontainer.json | 4 ++-- {.devcontainer => scripts/devcontainer}/postcreatecommand.sh | 0 {.devcontainer => scripts/devcontainer}/poststartcommand.sh | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename {.devcontainer => scripts/devcontainer}/postcreatecommand.sh (100%) rename {.devcontainer => scripts/devcontainer}/poststartcommand.sh (100%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4b0b1d6..a9b043d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,8 +9,8 @@ // 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": "$CODESPACE_VSCODE_FOLDER/.devcontainer/postcreatecommand.sh", - "postStartCommand": "$CODESPACE_VSCODE_FOLDER/.devcontainer/poststartcommand.sh", + "postCreateCommand": "bash -i scripts/devcontainer/postcreatecommand.sh", + "postStartCommand": "bash -i scripts/devcontainer/poststartcommand.sh", // Configure tool-specific properties. "customizations": { "codespaces": { diff --git a/.devcontainer/postcreatecommand.sh b/scripts/devcontainer/postcreatecommand.sh similarity index 100% rename from .devcontainer/postcreatecommand.sh rename to scripts/devcontainer/postcreatecommand.sh diff --git a/.devcontainer/poststartcommand.sh b/scripts/devcontainer/poststartcommand.sh similarity index 100% rename from .devcontainer/poststartcommand.sh rename to scripts/devcontainer/poststartcommand.sh From bf692ad035c73e393c8b2cd64b386a7ddad5eee3 Mon Sep 17 00:00:00 2001 From: "Ross Buggins (NHS)" Date: Wed, 29 May 2024 20:47:39 +0000 Subject: [PATCH 6/9] trying without interactive --- .devcontainer/devcontainer.json | 4 ++-- scripts/devcontainer/postcreatecommand.sh | 4 ++++ scripts/devcontainer/poststartcommand.sh | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a9b043d..988f1e4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,8 +9,8 @@ // 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": "bash -i scripts/devcontainer/postcreatecommand.sh", - "postStartCommand": "bash -i scripts/devcontainer/poststartcommand.sh", + "postCreateCommand": "bash scripts/devcontainer/postcreatecommand.sh", + "postStartCommand": "bash scripts/devcontainer/poststartcommand.sh", // Configure tool-specific properties. "customizations": { "codespaces": { diff --git a/scripts/devcontainer/postcreatecommand.sh b/scripts/devcontainer/postcreatecommand.sh index 31021e6..5a73df5 100755 --- a/scripts/devcontainer/postcreatecommand.sh +++ b/scripts/devcontainer/postcreatecommand.sh @@ -8,3 +8,7 @@ echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc zsh echo 'asdf setup complete' + +jekyll --version && cd docs && bundle install + +echo 'jekyll setup complete' diff --git a/scripts/devcontainer/poststartcommand.sh b/scripts/devcontainer/poststartcommand.sh index 74e25c5..cdcbd04 100755 --- a/scripts/devcontainer/poststartcommand.sh +++ b/scripts/devcontainer/poststartcommand.sh @@ -1,4 +1,2 @@ #!/bin/bash -cd $CODESPACE_VSCODE_FOLDER -make config -jekyll --version && cd docs && bundle install +make -f $CODESPACE_VSCODE_FOLDER/Makefile config From 099f3d56351c20b91d6cba5127d45d8ea4fb1e04 Mon Sep 17 00:00:00 2001 From: "Ross Buggins (NHS)" Date: Wed, 29 May 2024 20:50:09 +0000 Subject: [PATCH 7/9] running with zsh --- .devcontainer/devcontainer.json | 4 ++-- scripts/devcontainer/postcreatecommand.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 988f1e4..70881e1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,8 +9,8 @@ // 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": "bash scripts/devcontainer/postcreatecommand.sh", - "postStartCommand": "bash scripts/devcontainer/poststartcommand.sh", + "postCreateCommand": "zsh scripts/devcontainer/postcreatecommand.sh", + "postStartCommand": "zsh scripts/devcontainer/poststartcommand.sh", // Configure tool-specific properties. "customizations": { "codespaces": { diff --git a/scripts/devcontainer/postcreatecommand.sh b/scripts/devcontainer/postcreatecommand.sh index 5a73df5..96638f0 100755 --- a/scripts/devcontainer/postcreatecommand.sh +++ b/scripts/devcontainer/postcreatecommand.sh @@ -5,10 +5,13 @@ 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 -zsh + +source ~/.zshrc echo 'asdf setup complete' +make -f $CODESPACE_VSCODE_FOLDER/Makefile config + jekyll --version && cd docs && bundle install echo 'jekyll setup complete' From 7622d4cb6577a454c23c45827c361179c7b12a45 Mon Sep 17 00:00:00 2001 From: "Ross Buggins (NHS)" Date: Wed, 29 May 2024 20:57:57 +0000 Subject: [PATCH 8/9] port forwards and make working --- .devcontainer/devcontainer.json | 1 + scripts/devcontainer/postcreatecommand.sh | 2 +- scripts/devcontainer/poststartcommand.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 70881e1..dd99073 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,6 +11,7 @@ // 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": { diff --git a/scripts/devcontainer/postcreatecommand.sh b/scripts/devcontainer/postcreatecommand.sh index 96638f0..aefabaf 100755 --- a/scripts/devcontainer/postcreatecommand.sh +++ b/scripts/devcontainer/postcreatecommand.sh @@ -10,7 +10,7 @@ source ~/.zshrc echo 'asdf setup complete' -make -f $CODESPACE_VSCODE_FOLDER/Makefile config +make config jekyll --version && cd docs && bundle install diff --git a/scripts/devcontainer/poststartcommand.sh b/scripts/devcontainer/poststartcommand.sh index cdcbd04..0557c94 100755 --- a/scripts/devcontainer/poststartcommand.sh +++ b/scripts/devcontainer/poststartcommand.sh @@ -1,2 +1,2 @@ #!/bin/bash -make -f $CODESPACE_VSCODE_FOLDER/Makefile config +make config From 042037211055be36f5e4059326e8ba156ffee169 Mon Sep 17 00:00:00 2001 From: "Ross Buggins (NHS)" Date: Wed, 29 May 2024 21:06:24 +0000 Subject: [PATCH 9/9] source before make --- scripts/devcontainer/poststartcommand.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/devcontainer/poststartcommand.sh b/scripts/devcontainer/poststartcommand.sh index 0557c94..31a110d 100755 --- a/scripts/devcontainer/poststartcommand.sh +++ b/scripts/devcontainer/poststartcommand.sh @@ -1,2 +1,3 @@ #!/bin/bash +source ~/.zshrc make config