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

Added script to automate cloudflare cache purge #8736

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

kurtisassad
Copy link
Contributor

Link to Issue

Closes: #8487

Test Plan

  • (Locally) With the required env vars in your .env file, run the script with tsx ./purgeCloudflareCache.ts, you should get a success response from the cloudflare api indicating that the cache has been purged.
  • On frick make a release and check to make sure that the script has run.

Deployment Plan

Need to add env vars CF_ZONE_ID and CF_API_KEY to heroku.

@kurtisassad kurtisassad added the deployment plan (PRs only) requires manual infrastructure changes on release label Aug 5, 2024
@kurtisassad kurtisassad force-pushed the ka.cloudflarePurgeCache branch 2 times, most recently from 0df13d5 to 64cf7ba Compare August 5, 2024 11:43
@kurtisassad kurtisassad marked this pull request as ready for review August 5, 2024 11:48
Copy link
Contributor

@rbennettcw rbennettcw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine though I think the errors should propagate to a single point and result in a non-zero exit code because the runtime environment usually does utilize that info somehow

Copy link
Collaborator

@timolegros timolegros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple more comments. Does this release phase step work conceptually (I might be missing something)? The dynos will not have restarted yet when the release phase is running so they will still be serving the old code, won't the cache repopulate with the existing app files instead of repopulating with the new app files that are deployed after the script completes? Seems like cache clearing needs to happen after deployment not during release no?

@kurtisassad kurtisassad merged commit 039418b into master Aug 12, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment plan (PRs only) requires manual infrastructure changes on release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate clearing cloudflare cache for commonwealth.im on production deploy
4 participants