-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0b5642
commit 393d2e0
Showing
4 changed files
with
41 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,37 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
base=${base:-/home/forge/laravel.com} | ||
docs=${base}/resources/docs | ||
hashes=${base}/build/hashes | ||
versions=('8.x' '9.x' '10.x' '11.x' 'master') | ||
shouldBustCache=0 | ||
|
||
for v in "${versions[@]}" | ||
do | ||
# Update repositories... | ||
cd "${docs}/${v}" | ||
git pull origin "${v}" | ||
|
||
# Calculate md5 of the pulled markdown files and compare to the previous... | ||
find "." -type f -name "*.md" | xargs md5sum > "${hashes}/${v}.pulled" | ||
if ! cmp -s "${hashes}/${v}.pulled" "${hashes}/${v}.previous"; then | ||
shouldBustCache=1 | ||
fi | ||
done | ||
|
||
# Bust the Cloudflare cache... | ||
if [[ $shouldBustCache == 1 ]]; then | ||
curl -X POST \ | ||
"https://api.cloudflare.com/client/v4/zones/${1}/purge_cache" \ | ||
-H 'Content-Type: application/json' \ | ||
-H "Authorization: Bearer ${2}" \ | ||
-d '{ "purge_everything": true }' | ||
fi | ||
|
||
# cd ${docs}/5.5 && git pull origin 5.5 | ||
# cd ${docs}/5.8 && git pull origin 5.8 | ||
# cd ${docs}/6.0 && git pull origin 6.0 | ||
# cd ${docs}/6.x && git pull origin 6.x | ||
# cd ${docs}/7.x && git pull origin 7.x | ||
cd ${docs}/8.x && git pull origin 8.x | ||
cd ${docs}/9.x && git pull origin 9.x | ||
cd ${docs}/10.x && git pull origin 10.x | ||
cd ${docs}/11.x && git pull origin 11.x | ||
cd ${docs}/master && git pull origin master | ||
# Mark pulled files as the previous files... | ||
for v in "${versions[@]}" | ||
do | ||
mv -f "${hashes}/${v}.pulled" "${hashes}/${v}.previous" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters