From 588c3df5ce28b786e9684049e195636ca01d3ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Hochg=C3=BCrtel?= Date: Sun, 25 Jun 2023 09:05:23 +0200 Subject: [PATCH] Add edit chart command --- README.md | 18 +++++++++++++++++- edit-chart | 2 +- install.sh | 4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1e20631..be1807a 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,25 @@ But they had some limitations like: ## Setup +### Shell, `edit-chart` command + +The idea behind the `edit-chart` command is to quickly start editing a chart from the command line. the `edit-chart` command (script) changes the volume mount source in the docker-compose file and restarts the container to apply the changes. + +```bash +curl -sSLf https://raw.githubusercontent.com/tobiashochguertel/helm-editor-frontend/main/install.sh | bash +``` + +**Usage:** + +```bash +cd path-to-my-chart && edit-chart && open http://localhost:4173 +``` + +### Docker-Compose + See [docker-compose.yml](docker-compose.yml) for how to setup and configure this project. -**Example docker-compose.yml:** +**Example: `docker-compose.yml`** ```yaml version: '3.5' diff --git a/edit-chart b/edit-chart index 09629a9..c0cf22c 100755 --- a/edit-chart +++ b/edit-chart @@ -3,6 +3,6 @@ COMPOSE_FILE="$HOME/bin/edit-chart.docker-compose.yml" CURRENT_PATH="$(pwd)" -"$HOME"/bin/dasel put -f "$COMPOSE_FILE" -s 'services.backend.volumes.index(0)' -v "$CURRENT_PATH:/app/public" +"$HOME"/bin/edit-chart.dasel put -f "$COMPOSE_FILE" -s 'services.backend.volumes.index(0)' -v "$CURRENT_PATH:/app/public" # cat "$COMPOSE_FILE" docker-compose -f "$COMPOSE_FILE" up -d \ No newline at end of file diff --git a/install.sh b/install.sh index afb9055..2a8090c 100644 --- a/install.sh +++ b/install.sh @@ -7,11 +7,11 @@ curl https://raw.githubusercontent.com/tobiashochguertel/helm-editor-frontend/ma # Dasel if [[ $OSTYPE == 'darwin'* ]]; then curl -sSLf "$(curl -sSLf https://api.github.com/repos/tomwright/dasel/releases/latest | grep browser_download_url | grep -v .gz | grep darwin_amd64 | cut -d\" -f 4)" -L -o dasel && chmod +x dasel - mv ./dasel "$HOME"/bin/dasel + mv ./dasel "$HOME"/bin/edit-chart.dasel fi if [[ $OSTYPE == 'linux-gnu'* ]]; then curl -sSLf "$(curl -sSLf https://api.github.com/repos/tomwright/dasel/releases/latest | grep browser_download_url | grep linux_amd64 | grep -v .gz | cut -d\" -f 4)" -L -o dasel && chmod +x dasel - mv ./dasel "$HOME"/bin/dasel + mv ./dasel "$HOME"/bin/edit-chart.dasel fi echo "Add the following line to your .bashrc or .bash_profile or .zshrc, ..."