diff --git a/.devcontainer/ci/devcontainer.json b/.devcontainer/ci/devcontainer.json index 61678e22..b6ac0502 100644 --- a/.devcontainer/ci/devcontainer.json +++ b/.devcontainer/ci/devcontainer.json @@ -1,40 +1,18 @@ { "name": "Flux Cluster Template (CI)", - "image": "mcr.microsoft.com/devcontainers/base:bullseye", + "image": "mcr.microsoft.com/devcontainers/base:alpine", "features": { - "ghcr.io/audacioustux/devcontainers/cilium:1": {}, - "ghcr.io/devcontainers/features/common-utils:2": { - "configureZshAsDefaultShell": true - }, - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/python:1": { - "version": "3.11.7", - "installTools": false - }, - "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { - "minikube": "none" - }, - "ghcr.io/devcontainers-contrib/features/age:1": {}, - "ghcr.io/devcontainers-contrib/features/cloudflared:1": {}, - "ghcr.io/devcontainers-contrib/features/go-task:1": {}, - "ghcr.io/devcontainers-contrib/features/direnv:1": {}, - "ghcr.io/devcontainers-contrib/features/sops:1": {}, - "ghcr.io/dhoeric/features/stern:1": {}, - "ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {}, - "ghcr.io/framctr/devcontainer-features/talosctl:1": {}, - "ghcr.io/gickis/devcontainer-features/kubeconform:1": {}, - "ghcr.io/jsburckhardt/devcontainer-features/flux:1": {}, - "ghcr.io/rio/features/kustomize:1": {} + "./features": {} }, "customizations": { "vscode": { "settings": { "terminal.integrated.profiles.linux": { "bash": { - "path": "/bin/zsh" + "path": "/usr/bin/fish" } }, - "terminal.integrated.defaultProfile.linux": "zsh" + "terminal.integrated.defaultProfile.linux": "fish" }, "extensions": [ "redhat.ansible", diff --git a/.devcontainer/ci/features/devcontainer-feature.json b/.devcontainer/ci/features/devcontainer-feature.json new file mode 100644 index 00000000..1b474c55 --- /dev/null +++ b/.devcontainer/ci/features/devcontainer-feature.json @@ -0,0 +1,6 @@ +{ + "name": "Flux Cluster Template (Dev Tooling)", + "id": "flux-cluster-template", + "version": "1.0.0", + "description": "Install Development Tools" +} diff --git a/.devcontainer/ci/features/install.sh b/.devcontainer/ci/features/install.sh new file mode 100644 index 00000000..91b28dbb --- /dev/null +++ b/.devcontainer/ci/features/install.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +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 \ + openssh-client + +apk add --no-cache \ + --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ + age direnv fish github-cli \ + go-task helm k0sctl kubectl \ + kustomize sops yq + +apk add --no-cache \ + --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \ + cilium-cli flux stern + +# Naming things is hard +ln -s /usr/bin/go-task /usr/local/bin/task + +# +# Install Tools not in Alpine Repositories +# + +curl https://i.jpillora.com/cloudflare/cloudflared! | sudo bash +curl https://i.jpillora.com/budimanjojo/talhelper! | sudo bash +curl https://i.jpillora.com/yannh/kubeconform! | sudo bash + +curl -fsSL -o /usr/local/bin/talosctl \ + "https://github.com/siderolabs/talos/releases/latest/download/talosctl-linux-${ARCH}" +chmod +x /usr/local/bin/talosctl diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index ad354eb4..db37fd04 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -1,11 +1,5 @@ #!/usr/bin/env bash -# Hook direnv into zsh -if [[ -f "/home/vscode/.zshrc" ]]; then - # shellcheck disable=SC2016 - echo -e 'eval "$(direnv hook zsh)"' >> /home/vscode/.zshrc -fi - # Export the direnv environment variables task workstation:direnv