Skip to content

Commit

Permalink
CLOUDP-258469 - add retries for chart releaser (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
nammn authored Jul 16, 2024
1 parent 690b958 commit ffb3837
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/actions/releaser/cr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ release_charts_inside_folders() {
check_charts_released() {
local folders=("$@")
local unreleased_charts=()
local retries=5
local delay=5

prepare_helm_repo

Expand All @@ -90,7 +92,18 @@ check_charts_released() {
chart_version=$(read_chart_version "${charts_dir}/${folder}")
echo "Checking if \"$charts_dir/$folder\" has been released to the repo"

if ! chart_released "${chart_name}" "${chart_version}"; then
local released=false
for ((i=0; i<retries; i++)); do
if chart_released "${chart_name}" "${chart_version}"; then
released=true
break
fi
echo "Retrying in ${delay} seconds... ($((i+1))/$retries)"
sleep "${delay}"
update_helm_repo
done

if [ "$released" = false ]; then
unreleased_charts+=("$chart_name")
fi
done
Expand All @@ -117,9 +130,13 @@ read_chart_version() {
awk '/^version: /{print $2}' "$chart_path/Chart.yaml"
}

update_helm_repo(){
helm repo update mongodb
}

prepare_helm_repo() {
helm repo add mongodb https://mongodb.github.io/helm-charts
helm repo update mongodb
update_helm_repo
}

chart_released() {
Expand Down

0 comments on commit ffb3837

Please sign in to comment.