tftsr-devops_investigation/scripts/download-helm.sh
Shaun Arman 9c9ca16966 feat(kube): implement 44 new Rust K8s commands + helm binary support
New list commands: list_replicationcontrollers, list_poddisruptionbudgets,
list_priorityclasses, list_runtimeclasses, list_leases,
list_mutatingwebhookconfigurations, list_validatingwebhookconfigurations,
list_endpoints, list_endpointslices, list_ingressclasses,
list_namespaces_resource, list_crds, list_custom_resources

New action commands: force_delete_resource, describe_resource,
get_resource_yaml, attach_pod, restart_statefulset, restart_daemonset,
scale_statefulset, scale_replicaset, scale_replicationcontroller,
suspend_cronjob, resume_cronjob, trigger_cronjob,
create_namespace, delete_namespace

Log streaming: stream_pod_logs (tokio task + Tauri events), stop_log_stream

Helm: helm_list_repos, helm_add_repo, helm_update_repos, helm_search_repo,
helm_list_releases, helm_uninstall, helm_rollback

Infrastructure: shell/helm.rs locate_helm(), scripts/download-helm.sh,
AppState.log_streams for stream lifecycle management

363/363 tests passing, zero clippy warnings

Co-Authored-By: TFTSR Engineering <noreply@tftsr.com>
2026-06-08 20:34:01 -05:00

59 lines
2.0 KiB
Bash

#!/bin/bash
set -e
HELM_VERSION="v3.17.0"
BINARIES_DIR="src-tauri/binaries"
echo "Downloading helm binaries version ${HELM_VERSION}..."
mkdir -p "$BINARIES_DIR"
# Helm tarballs extract to {os}-{arch}/helm (or helm.exe on Windows)
echo "Downloading helm for Linux x86_64..."
TMPDIR=$(mktemp -d)
curl -L -o "$TMPDIR/helm-linux-amd64.tar.gz" \
"https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz"
tar -xzf "$TMPDIR/helm-linux-amd64.tar.gz" -C "$TMPDIR"
cp "$TMPDIR/linux-amd64/helm" "$BINARIES_DIR/helm-x86_64-unknown-linux-gnu"
rm -rf "$TMPDIR"
echo "Downloading helm for Linux aarch64..."
TMPDIR=$(mktemp -d)
curl -L -o "$TMPDIR/helm-linux-arm64.tar.gz" \
"https://get.helm.sh/helm-${HELM_VERSION}-linux-arm64.tar.gz"
tar -xzf "$TMPDIR/helm-linux-arm64.tar.gz" -C "$TMPDIR"
cp "$TMPDIR/linux-arm64/helm" "$BINARIES_DIR/helm-aarch64-unknown-linux-gnu"
rm -rf "$TMPDIR"
echo "Downloading helm for macOS x86_64..."
TMPDIR=$(mktemp -d)
curl -L -o "$TMPDIR/helm-darwin-amd64.tar.gz" \
"https://get.helm.sh/helm-${HELM_VERSION}-darwin-amd64.tar.gz"
tar -xzf "$TMPDIR/helm-darwin-amd64.tar.gz" -C "$TMPDIR"
cp "$TMPDIR/darwin-amd64/helm" "$BINARIES_DIR/helm-x86_64-apple-darwin"
rm -rf "$TMPDIR"
echo "Downloading helm for macOS aarch64..."
TMPDIR=$(mktemp -d)
curl -L -o "$TMPDIR/helm-darwin-arm64.tar.gz" \
"https://get.helm.sh/helm-${HELM_VERSION}-darwin-arm64.tar.gz"
tar -xzf "$TMPDIR/helm-darwin-arm64.tar.gz" -C "$TMPDIR"
cp "$TMPDIR/darwin-arm64/helm" "$BINARIES_DIR/helm-aarch64-apple-darwin"
rm -rf "$TMPDIR"
echo "Downloading helm for Windows x86_64..."
TMPDIR=$(mktemp -d)
curl -L -o "$TMPDIR/helm-windows-amd64.zip" \
"https://get.helm.sh/helm-${HELM_VERSION}-windows-amd64.zip"
unzip -q "$TMPDIR/helm-windows-amd64.zip" -d "$TMPDIR"
cp "$TMPDIR/windows-amd64/helm.exe" "$BINARIES_DIR/helm-x86_64-pc-windows-msvc.exe"
rm -rf "$TMPDIR"
# Make binaries executable
chmod +x "$BINARIES_DIR"/helm-*-linux-* "$BINARIES_DIR"/helm-*-darwin
echo "helm binaries downloaded successfully to $BINARIES_DIR"
echo "Total size:"
du -sh "$BINARIES_DIR"