From e8caede2733750b5156c0044448541cc6a5c53bd Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Mon, 5 Dec 2022 23:16:50 -0800 Subject: [PATCH] Update script: Purge cache of manifest files Purge the manifest files from the Bunny CDN cache before starting the update of the site. --- Scripts/update_feed.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Scripts/update_feed.rb b/Scripts/update_feed.rb index 6292b28d6..bc25f6886 100755 --- a/Scripts/update_feed.rb +++ b/Scripts/update_feed.rb @@ -130,6 +130,11 @@ if 1 #appcast_revision < latest_revision %x[curl --upload-file '#{site_dir}/#{feed}_builds/#{feed}.xml' 'https://storage.bunnycdn.com/cog-ecdn/#{feed}.xml' --header 'AccessKey: #{bunnykey}' --header 'content-type: application/xml'] %x[curl --upload-file '#{site_dir}/#{feed}_builds/#{feed}.json' 'https://storage.bunnycdn.com/cog-ecdn/#{feed}.json' --header 'AccessKey: #{bunnykey}' --header 'content-type: application/json'] + #Purge the cache + bunnykey2 = %x[security find-generic-password -w -a #{ENV['LOGNAME']} -s bunnyaccesskey2].chop + %x[curl --request GET --url 'https://api.bunny.net/purge?url=https%3A%2F%2Fcogcdn.cog.losno.co%2F#{feed}.xml&async=false' --header 'AccessKey: #{bunnykey2}' --header 'accept: application/json'] + %x[curl --request GET --url 'https://api.bunny.net/purge?url=https%3A%2F%2Fcogcdn.cog.losno.co%2F%{feed}.json&async=false' --header 'AccessKey: #{bunnykey2}' --header 'accept: application/json'] + #Send web hook to update site update_uri = %x[security find-generic-password -w -a #{ENV['LOGNAME']} -s cogupdateurl].chop update_parameter = URI.escape(latest_revision)