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 6ab4c80 commit 5f7a74b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 27 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@ version: '3.5'
services:
backend:
image: docker.io/tobiashochguertel/th-helm-playground-backend:latest
ports:
- '3001:3001'
volumes:
- ./../gitlab-project:/app/public
# - /Users/tobiashochgurtel/work-dev/helm-playground/github/gitlab/charts/gitlab:/app/public
environment:
- PORT=3001
template:
image: docker.io/tobiashochguertel/th-helm-playground-template:latest
ports:
- '3002:3002'
environment:
- PORT=3002
webapp:
Expand Down
42 changes: 19 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
version: '3.5'
services:
backend:
image: docker.io/tobiashochguertel/th-helm-playground-backend:latest
ports:
- '3001:3001'
volumes:
- ./../gitlab-project:/app/public
environment:
- PORT=3001
template:
image: docker.io/tobiashochguertel/th-helm-playground-template:latest
ports:
- '3002:3002'
environment:
- PORT=3002
webapp:
image: docker.io/tobiashochguertel/th-helm-playground-frontend:latest
ports:
- '4173:4173'
environment:
- BACKEND_PORT=3001
- BACKEND_HOSTNAME=backend
- BACKEND_TEMPLATE_HOSTNAME=template
- BACKEND_TEMPLATE_PORT=3002
backend:
image: docker.io/tobiashochguertel/th-helm-playground-backend:latest
volumes:
- /Users/tobiashochgurtel/work-dev/helm-playground/frontend:/app/public
environment:
- PORT=3001
template:
image: docker.io/tobiashochguertel/th-helm-playground-template:latest
environment:
- PORT=3002
frontend:
image: docker.io/tobiashochguertel/th-helm-playground-frontend:latest
ports:
- 4173:4173
environment:
- BACKEND_PORT=3001
- BACKEND_HOSTNAME=backend
- BACKEND_TEMPLATE_HOSTNAME=template
- BACKEND_TEMPLATE_PORT=3002
8 changes: 8 additions & 0 deletions edit-chart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

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"
# cat "$COMPOSE_FILE"
docker-compose -f "$COMPOSE_FILE" up -d
26 changes: 26 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

mkdir -p ~/bin
curl https://raw.githubusercontent.com/tobiashochguertel/helm-editor-frontend/main/edit-chart > ~/bin/edit-chart
curl https://raw.githubusercontent.com/tobiashochguertel/helm-editor-frontend/main/docker-compose.yml > ~/bin/edit-chart.docker-compose.yml

# 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
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
fi

echo "Add the following line to your .bashrc or .bash_profile or .zshrc, ..."
echo ""
echo 'export PATH=$PATH:$HOME/bin'
echo ""
echo "and restart your shell."

echo "Usage example:"
echo ""
echo "cd path-to-my-chart && edit-chart && open http://localhost:4173"
echo ""

0 comments on commit 5f7a74b

Please sign in to comment.