-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·36 lines (30 loc) · 1.38 KB
/
deploy.sh
File metadata and controls
executable file
·36 lines (30 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
# Build and deploy the plugin to CloudCLI's plugins directory.
# Usage: ./deploy.sh
set -euo pipefail
REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
PLUGIN_DIR="$HOME/.claude-code-ui/plugins/cloudcli-plugin-helm-dashboard"
API="http://localhost:3004/api/plugins/helm-dashboard"
echo "[helm] Building..."
cd "$REPO_DIR"
npm run build
echo "[helm] Deploying to $PLUGIN_DIR..."
# Disable plugin to stop the server
curl -sf -X PUT "$API/enable" -H "Content-Type: application/json" -d '{"enabled":false}' > /dev/null 2>&1 || true
sleep 1
rm -rf "$PLUGIN_DIR"
# Copy what CloudCLI needs (dist, manifest, runtime deps)
mkdir -p "$PLUGIN_DIR/dist"
cp "$REPO_DIR/manifest.json" "$REPO_DIR/package.json" "$REPO_DIR/icon.svg" "$PLUGIN_DIR/"
cp -r "$REPO_DIR/dist/"* "$PLUGIN_DIR/dist/"
# Copy production node_modules (ws is a runtime dep for the server)
if [ -d "$REPO_DIR/node_modules" ]; then
cp -r "$REPO_DIR/node_modules" "$PLUGIN_DIR/node_modules"
fi
# Re-enable to start the server
curl -sf -X PUT "$API/enable" -H "Content-Type: application/json" -d '{"enabled":true}' > /dev/null 2>&1
sleep 2
# Verify
STATUS=$(curl -sf "$API/../" 2>/dev/null | python3 -c "import sys,json; d=json.load(sys.stdin); p=[x for x in d['plugins'] if x['name']=='helm-dashboard']; print(f\"running={p[0]['serverRunning']}\" if p else 'not found')" 2>/dev/null)
echo "[helm] Status: $STATUS"
echo "[helm] Done."