Created
May 15, 2023 19:11
-
-
Save bartvdbraak/2756020138a24b47c3b8f3b0b9f76543 to your computer and use it in GitHub Desktop.
script to download all latest helm charts on your Azure Container Registry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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