scripts: Properly invalidate the caches by putting them in sync order. Per various...
authorDevrim Gunduz <devrim@gunduz.org>
Wed, 1 Oct 2025 17:17:21 +0000 (18:17 +0100)
committerDevrim Gunduz <devrim@gunduz.org>
Wed, 1 Oct 2025 17:17:21 +0000 (18:17 +0100)
scripts/buildserver/packagesync.sh
scripts/buildserver/packagesynccommon.sh

index 1a4a85ef6c1725ee7a911b7ccd56df66575a66c4..079613ccf2628d1f4d447986b91871496e6b46a4 100755 (executable)
@@ -61,10 +61,14 @@ do
        # rsync --checksum -ave ssh --delete $RPM_DIR/ yumupload@yum.postgresql.org:yum/yum/$packageSyncVersion/$osdistro/$os-$osarch
 
        # Sync SRPMs to S3 bucket:
-       aws s3 sync $SRPM_DIR s3://dnf-srpms.postgresql.org20250313103537584600000001/srpms/$packageSyncVersion/$osdistro/$os-$osarch --exclude "*.html"
+       aws s3 sync $SRPM_DIR s3://dnf-srpms.postgresql.org20250313103537584600000001/srpms/$packageSyncVersion/$osdistro/$os-$osarch --exclude "*.html" --exclude "repodata"
+       aws s3 sync --delete $SRPM_DIR/repodata/ s3://dnf-srpms.postgresql.org20250313103537584600000001/srpms/$packageSyncVersion/$osdistro/$os-$osarch/repodata/ --exclude "*.html"
+       aws cloudfront create-invalidation --distribution-id $CF_SRPM_DISTRO_ID --path /debug/$packageSyncVersion/$osdistro/$os-$osarch/repodata/*
 
        # Sync debug* RPMs to S3 bucket:
-       aws s3 sync $DEBUG_RPM_DIR s3://dnf-debuginfo.postgresql.org20250312201116649700000001/debug/$packageSyncVersion/$osdistro/$os-$osarch/ --exclude "*.html"
+       aws s3 sync $DEBUG_RPM_DIR s3://dnf-debuginfo.postgresql.org20250312201116649700000001/debug/$packageSyncVersion/$osdistro/$os-$osarch/ --exclude "*.html" --exclude "repodata"
+       aws s3 sync --delete $DEBUG_RPM_DIR/repodata/ s3://dnf-debuginfo.postgresql.org20250312201116649700000001/debug/$packageSyncVersion/$osdistro/$os-$osarch/repodata/ --exclude "*.html"
+       aws cloudfront create-invalidation --distribution-id $CF_DEBUG_DISTRO_ID --path /debug/$packageSyncVersion/$osdistro/$os-$osarch/repodata/*
 done
 
 exit 0
index d8e701b2092681772f10ae32cc1ef27b37b7b7c7..c81e8edec7adc3c73eb068b748b903bd8fd1a7a6 100755 (executable)
@@ -50,9 +50,13 @@ then
 fi
 
 # Sync SRPMs to S3 bucket:
-aws s3 sync $COMMON_SRPM_DIR s3://dnf-srpms.postgresql.org20250313103537584600000001/srpms/common/$osdistro/$os-$osarch/ --exclude "*.html"
+aws s3 sync $COMMON_SRPM_DIR s3://dnf-srpms.postgresql.org20250313103537584600000001/srpms/common/$osdistro/$os-$osarch/ --exclude "*.html" --exclude "repodata"
+aws s3 sync --delete $COMMON_SRPM_DIR/repodata/ s3://dnf-srpms.postgresql.org20250313103537584600000001/srpms/common/$packageSyncVersion/$osdistro/$os-$osarch/repodata/ --exclude "*.html"
+aws cloudfront create-invalidation --distribution-id $CF_SRPM_DISTRO_ID --path /srpms/common/$packageSyncVersion/$osdistro/$os-$osarch/repodata/*
 
 # Sync debug* RPMs to S3 bucket:
-aws s3 sync $COMMON_DEBUG_RPM_DIR s3://dnf-debuginfo.postgresql.org20250312201116649700000001/debug/common/$osdistro/$os-$osarch/ --exclude "*.html"
+aws s3 sync $COMMON_DEBUG_RPM_DIR s3://dnf-debuginfo.postgresql.org20250312201116649700000001/debug/common/$osdistro/$os-$osarch/ --exclude "*.html" --exclude "repodata"
+aws s3 sync --delete $COMMON_DEBUG_RPM_DIR/repodata/ s3://dnf-debuginfo.postgresql.org20250312201116649700000001/debug/common/$packageSyncVersion/$osdistro/$os-$osarch/repodata/ --exclude "*.html"
+aws cloudfront create-invalidation --distribution-id $CF_DEBUG_DISTRO_ID --path /debug/common/$packageSyncVersion/$osdistro/$os-$osarch/repodata/*
 
 exit 0