Skip to content

Commit

Permalink
Add edit chart command
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashochguertel committed Jun 25, 2023
1 parent 5f7a74b commit 588c3df
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion edit-chart
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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, ..."
Expand Down

0 comments on commit 588c3df

Please sign in to comment.