From b77a492638973e65f29cbf0ab7fb98d3b312aadc Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Mon, 16 Oct 2023 22:27:00 -0700 Subject: [PATCH] Move cluster creation to post-create (#618) Signed-off-by: Aaron Crawfis --- .devcontainer/devcontainer.json | 1 + .devcontainer/on-create.sh | 9 --------- .devcontainer/post-create.sh | 10 ++++++++++ 3 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 .devcontainer/post-create.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f07143c9..cd43a462 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,6 +3,7 @@ "image": "mcr.microsoft.com/devcontainers/universal:linux", "workspaceFolder": "/workspaces/samples", "onCreateCommand": "bash ./.devcontainer/on-create.sh", + "postCreateCommand": "bash ./.devcontainer/post-create.sh", "runArgs": [ "--privileged", "--init" diff --git a/.devcontainer/on-create.sh b/.devcontainer/on-create.sh index e453d4cb..14a38636 100644 --- a/.devcontainer/on-create.sh +++ b/.devcontainer/on-create.sh @@ -1,14 +1,5 @@ #!/bin/sh -## Create a k3d cluster -k3d cluster delete -k3d cluster create -p '8081:80@loadbalancer' --k3s-arg '--disable=traefik@server:0' - -## Install Dapr and init -wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash -dapr uninstall # clean if needed -dapr init -k - ## Install rad CLI CURRENT_BRANCH=$(git branch --show-current) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100644 index 00000000..44826f18 --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +## Create a k3d cluster +k3d cluster delete +k3d cluster create -p '8081:80@loadbalancer' --k3s-arg '--disable=traefik@server:0' + +## Install Dapr and init +wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash +dapr uninstall # clean if needed +dapr init -k