From 2bb3e6cf5e945cb5eeb98fd0aa9fa00e889c16df Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Sun, 3 Nov 2024 21:26:51 +0100 Subject: [PATCH] feat(devcontainer): add devcontainer references here and in clustertool templates --- .devcontainer/devcontainer.json | 12 ++++++++++++ .devcontainer/postCreateCommand.sh | 19 +++++++++++++++++++ .../DOTREPLACEdevcontainer/devcontainer.json | 12 ++++++++++++ .../postCreateCommand.sh | 19 +++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/postCreateCommand.sh create mode 100644 clustertool/embed/generic/root/DOTREPLACEdevcontainer/devcontainer.json create mode 100755 clustertool/embed/generic/root/DOTREPLACEdevcontainer/postCreateCommand.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..5cee465925d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json", + "name": "ClusterTool Cluster", + "image": "tccr.io/tccr/devcontainer:latest", + "initializeCommand": "docker pull tccr.io/tccr/devcontainer:latest", + "postCreateCommand": { + "setup": "bash ${containerWorkspaceFolder}/.devcontainer/postCreateCommand.sh" + }, + "postStartCommand": { + "git": "git config --global --add safe.directory ${containerWorkspaceFolder}" + } + } diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100755 index 00000000000..01edfdb3d9f --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -e +set -o noglob + +# 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 + rm -rf .venv +fi +task workstation:venv diff --git a/clustertool/embed/generic/root/DOTREPLACEdevcontainer/devcontainer.json b/clustertool/embed/generic/root/DOTREPLACEdevcontainer/devcontainer.json new file mode 100644 index 00000000000..5225815b33d --- /dev/null +++ b/clustertool/embed/generic/root/DOTREPLACEdevcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json", + "name": "TrueCharts", + "image": "tccr.io/tccr/devcontainer:latest", + "initializeCommand": "docker pull tccr.io/tccr/devcontainer:latest", + "postCreateCommand": { + "setup": "bash ${containerWorkspaceFolder}/.devcontainer/postCreateCommand.sh" + }, + "postStartCommand": { + "git": "git config --global --add safe.directory ${containerWorkspaceFolder}" + } + } diff --git a/clustertool/embed/generic/root/DOTREPLACEdevcontainer/postCreateCommand.sh b/clustertool/embed/generic/root/DOTREPLACEdevcontainer/postCreateCommand.sh new file mode 100755 index 00000000000..01edfdb3d9f --- /dev/null +++ b/clustertool/embed/generic/root/DOTREPLACEdevcontainer/postCreateCommand.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -e +set -o noglob + +# 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 + rm -rf .venv +fi +task workstation:venv