Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOUDP-258469 - add retries for chart releaser #334

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading