From 9f2d6a9970e2cb2845a6d90c3b4f4efdaa91c466 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Wed, 24 Jan 2024 09:04:29 -0500 Subject: [PATCH] feat: more ricing to the devcontainer Signed-off-by: Devin Buhl --- .devcontainer/ci/features/install.sh | 66 ++++++++++++++++++++-------- .devcontainer/postCreateCommand.sh | 44 ++++--------------- 2 files changed, 56 insertions(+), 54 deletions(-) diff --git a/.devcontainer/ci/features/install.sh b/.devcontainer/ci/features/install.sh index 8fd61d12..4cb2c8c9 100644 --- a/.devcontainer/ci/features/install.sh +++ b/.devcontainer/ci/features/install.sh @@ -1,43 +1,71 @@ -#!/bin/sh +#!/usr/bin/env bash set -e set -o noglob -ARCH="$(uname -m)" -if [ "$ARCH" = "x86_64" ]; then - ARCH="amd64" -elif [ "$ARCH" = "aarch64" ]; then - ARCH="arm64" -fi - -# -# Install Tools from the Alpine Repositories -# - apk add --no-cache \ bash bind-tools ca-certificates curl python3 \ py3-pip moreutils jq git iputils \ - openssh-client starship + openssh-client starship fzf apk add --no-cache \ --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ - age direnv fish helm kubectl kustomize sops yq + age direnv fish helm kubectl kustomize sops -# -# Install Tools not in Alpine Repositories -# +sudo apk add --no-cache \ + --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \ + lsd for installer_path in \ "budimanjojo/talhelper!" \ "cilium/cilium-cli!!?as=cilium" \ "cli/cli!!?as=gh" \ "cloudflare/cloudflared!" \ + "derailed/k9s!" \ "fluxcd/flux2!!?as=flux" \ "go-task/task!" \ "k0sproject/k0sctl!" \ - "derailed/k9s!" \ + "kubecolor/kubecolor!" \ "stern/stern!" \ "siderolabs/talos!!?as=talosctl" \ - "yannh/kubeconform!" + "yannh/kubeconform!" \ + "mikefarah/yq!" do curl -fsSL "https://i.jpillora.com/${installer_path}" | bash done + +# Create the fish configuration directory +mkdir -p /home/vscode/.config/fish/{completions,conf.d} + +# Setup autocompletions for fish +for tool in cilium flux helm k9s kubectl kustomize talhelper talosctl; do + $tool completion fish > /home/vscode/.config/fish/completions/$tool.fish +done +gh completion --shell fish > /home/vscode/.config/fish/completions/gh.fish +k0sctl completion --shell fish > /home/vscode/.config/fish/completions/k0sctl.fish +stern --completion fish > /home/vscode/.config/fish/completions/stern.fish +yq shell-completion fish > /home/vscode/.config/fish/completions/yq.fish + +# Add hooks into fish +tee /home/vscode/.config/fish/conf.d/hooks.fish > /dev/null < /dev/null < /dev/null < /dev/null < /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 +# Setup fisher plugin manager for fish and install plugins +/usr/bin/fish -c " +curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher +fisher install decors/fish-colored-man +fisher install edc/bass +fisher install jorgebucaran/autopair.fish +fisher install nickeb96/puffer-fish +fisher install PatrickF1/fzf.fish +" # Create/update virtual environment if ! grep -q "venv /workspaces/" .venv/pyvenv.cfg; then