From b9575ad14f1005e7240c56620035eae98409fa25 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Tue, 23 Jan 2024 18:58:46 -0500 Subject: [PATCH] feat: more ricing to the devcontainer Signed-off-by: Devin Buhl --- .devcontainer/ci/features/install.sh | 1 + .devcontainer/devcontainer.json | 2 +- .devcontainer/postCreateCommand.sh | 30 +++++++++++++++++++++------- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.devcontainer/ci/features/install.sh b/.devcontainer/ci/features/install.sh index 91740293..8fd61d12 100644 --- a/.devcontainer/ci/features/install.sh +++ b/.devcontainer/ci/features/install.sh @@ -34,6 +34,7 @@ for installer_path in \ "fluxcd/flux2!!?as=flux" \ "go-task/task!" \ "k0sproject/k0sctl!" \ + "derailed/k9s!" \ "stern/stern!" \ "siderolabs/talos!!?as=talosctl" \ "yannh/kubeconform!" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 37fb0239..d73602a2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,6 +3,6 @@ "name": "Flux Cluster Template", "image": "ghcr.io/onedr0p/flux-cluster-template/devcontainer:base", "postCreateCommand": { - "deps": "bash ${containerWorkspaceFolder}/.devcontainer/postCreateCommand.sh" + "deps": "${containerWorkspaceFolder}/.devcontainer/postCreateCommand.sh" } } diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 62b819a6..00a6c8b3 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -3,7 +3,7 @@ set -e set -o noglob # Create the fish configuration directory -mkdir -p ~/.config/fish/conf.d +mkdir -p ~/.config/fish/{completions,conf.d} # Hook direnv into fish tee ~/.config/fish/conf.d/direnv.fish > /dev/null < /dev/null < ~/.config/fish/completions/$tool.fish +done +gh completion --shell fish > ~/.config/fish/completions/gh.fish +k0sctl completion --shell fish > ~/.config/fish/completions/k0sctl.fish +stern --completion fish > ~/.config/fish/completions/stern.fish +yq shell-completion fish > ~/.config/fish/completions/yq.fish + +# Create/update virtual environment +if ! grep -q "/workspaces/flux-template-cluster/.venv" .venv/pyvenv.cfg; then + rm -rf .venv +fi +task workstation:venv + # Export the direnv environment variables task workstation:direnv - -# Remove the .venv directory -rm -rf .venv - -# Create a new virtual environment -task workstation:venv