Skip to content

Instantly share code, notes, and snippets.

@bartvdbraak
Created May 15, 2023 19:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bartvdbraak/2756020138a24b47c3b8f3b0b9f76543 to your computer and use it in GitHub Desktop.
Save bartvdbraak/2756020138a24b47c3b8f3b0b9f76543 to your computer and use it in GitHub Desktop.
script to download all latest helm charts on your Azure Container Registry
#!/bin/bash
# Destination directory to save YAML files
DESTINATION_DIR="${1:-.}"
# Prompt for Azure Container Registry name if not provided
read -p "Enter Azure Container Registry name: " ACR_NAME
# Add Azure Container Registry to helm repositories
echo "Enter the password for your Azure Container Registry"
helm repo add $ACR_NAME https://$ACR_NAME.azurecr.io/helm/v1/repo --username $ACR_NAME
# List available Helm charts
CHARTS=$(helm search repo $ACR_NAME --output json | jq -r '.[] | .name')
# Iterate through the list of Helm charts
for CHART in $CHARTS; do
# Download and extract the chart
helm pull $CHART --untar --untardir .
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment