Skip to content

Commit 615475a

Browse files
committed
Invalidate CDN cache only once
1 parent 2cee589 commit 615475a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ci/linux-repository-builder/build-linux-repositories.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ function invalidate_bunny_cdn_cache {
155155
--fail-with-body
156156
}
157157

158+
repositories_were_updated="false"
158159
for repository in "${REPOSITORIES[@]}"; do
159160
deb_remote_repo_dir="deb/$repository"
160161
rpm_remote_repo_dir="rpm/$repository"
@@ -194,9 +195,12 @@ for repository in "${REPOSITORIES[@]}"; do
194195
echo "[#] Syncing rpm repository to $rpm_remote_repo_dir"
195196
rsync_repo "$rpm_repo_dir" "$rpm_remote_repo_dir"
196197

198+
repositories_were_updated="true"
199+
done
200+
201+
if [[ "$repositories_were_updated" == "true" ]]; then
197202
if [[ "$environment" == "production" || "$environment" == "staging" ]]; then
198203
echo "[#] Invalidating Bunny CDN cache for pull zone $bunnycdn_pull_zone_id"
199204
invalidate_bunny_cdn_cache "$bunnycdn_pull_zone_id"
200205
fi
201-
202-
done
206+
fi

0 commit comments

Comments
 (0)