ci: add resilient helm oci push fallbacks
This commit is contained in:
@@ -145,10 +145,27 @@ jobs:
|
||||
- name: Push chart to OCI registry
|
||||
if: steps.version.outputs.is_app_release == 'true'
|
||||
run: |
|
||||
helm push --plain-http \
|
||||
set -euo pipefail
|
||||
|
||||
if ! echo "${{ secrets.REGISTRY_PASS }}" | helm registry login registry.kloude.ir \
|
||||
--username "${{ secrets.REGISTRY_USER }}" \
|
||||
--password "${{ secrets.REGISTRY_PASS }}" \
|
||||
"$CHART_PACKAGE" "oci://registry.kloude.ir/kloude/kks-provider-plugin-charts"
|
||||
--password-stdin; then
|
||||
echo "Registry login failed, retrying during push"
|
||||
fi
|
||||
|
||||
primary_repo="oci://registry.kloude.ir/kloude/kks-provider-plugin-charts"
|
||||
fallback_repo="oci://registry.kloude.ir/kloude"
|
||||
|
||||
if helm push --username "${{ secrets.REGISTRY_USER }}" --password "${{ secrets.REGISTRY_PASS }}" "$CHART_PACKAGE" "$primary_repo"; then
|
||||
exit 0
|
||||
fi
|
||||
if helm push --plain-http --username "${{ secrets.REGISTRY_USER }}" --password "${{ secrets.REGISTRY_PASS }}" "$CHART_PACKAGE" "$primary_repo"; then
|
||||
exit 0
|
||||
fi
|
||||
if helm push --username "${{ secrets.REGISTRY_USER }}" --password "${{ secrets.REGISTRY_PASS }}" "$CHART_PACKAGE" "$fallback_repo"; then
|
||||
exit 0
|
||||
fi
|
||||
helm push --plain-http --username "${{ secrets.REGISTRY_USER }}" --password "${{ secrets.REGISTRY_PASS }}" "$CHART_PACKAGE" "$fallback_repo"
|
||||
|
||||
- name: Make OCI chart public
|
||||
if: steps.version.outputs.is_app_release == 'true'
|
||||
|
||||
Reference in New Issue
Block a user