Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions inventory/php/group_vars/all.yml.skeleton
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ github_secret:
bugs_magic_cookie:
flickr_api_token:

# Bunny CDN account API key, used by update-www to purge the CDN cache
bunny_api_key:

# OhDearHealthChecks
ohdear_secret:

Expand Down
16 changes: 14 additions & 2 deletions roles/properties/www/templates/update-www
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
#!/bin/sh

rsync -rlptDC --timeout=600 --delete --delete-after \
# export tokens
export BUNNY_API_KEY="{{ bunny_api_key }}"

CHANGES=$(rsync -rlptDC --timeout=600 --delete --delete-after --itemize-changes \
--include='distributions/*.exe' --include='manual/en/' \
--include='manual/en/**' --include='manual/*.php' \
--include='manual/**' {{ rsync_address }}::phpweb \
{{ www_docroot }}
{{ www_docroot }})

# Bust the Bunny CDN cache for the pre-release builds page, but only when
# rsync actually pulled new content (avoids purging on every 5-minute run)
if [ -n "$CHANGES" ]; then
curl --fail --silent --show-error --request POST \
--url 'https://api.bunny.net/purge?url=https://www.php.net/pre-release-builds.php*' \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This probably works for now as a single item, but I do think it would be better to define these in a list in a config file, with a loop here, if we add even a single extra line — or, perhaps right from the start.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, we could maintain that list in the vars and loop over to make this less static.

--header "AccessKey: ${BUNNY_API_KEY}"
fi