redoc/scripts/invalidate-cache.sh
2022-08-18 16:56:28 +03:00

24 lines
593 B
Bash
Executable File

#!/usr/bin/env bash
set -e # exit on error
echo jsdelivr clearing cache
curl -i -X POST https://purge.jsdelivr.net/ \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"path": [
"npm/redoc@latest/bundles/redoc.browser.lib.js",
"npm/redoc@latest/bundles/redoc.lib.js",
"npm/redoc@latest/bundles/redoc.standalone.js"
]
}'
echo
echo start invalidate cloudfront
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION --paths "/redoc/*"
echo Cache cleared successfully
exit 0