File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 2424# Install helm if it is not installed
2525if ! command -v helm & > /dev/null; then
2626 echo " Installing helm..."
27- curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
28- chmod +x get_helm.sh
29- sudo ./get_helm.sh
30- rm get_helm.sh
27+
28+ # Determine the helm artifact name based on OS and architecture
29+ helm_artifact=" helm-$( os) -$( arch) .tar.gz"
30+
31+ if cache_download " $helm_artifact " > /dev/null; then
32+ echo " Using cached Helm binary"
33+ sudo mv helm /usr/local/bin/helm
34+ sudo chmod +x /usr/local/bin/helm
35+ else
36+ echo " Downloading Helm from get.helm.sh..."
37+ # Download and run the official Helm installer script
38+ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
39+ chmod +x get_helm.sh
40+ sudo ./get_helm.sh
41+
42+ if [ -f /usr/local/bin/helm ]; then
43+ ( cd /usr/local/bin && cache_upload " $helm_artifact " /usr/local/bin/helm )
44+ fi
45+
46+ # Clean up installer script
47+ rm get_helm.sh
48+ fi
3149fi
3250
3351if ! command -v stern & > /dev/null; then
You can’t perform that action at this time.
0 commit comments