-
-
Save danishbacker/f75e90cfbf6c10a3959a3632e80fcb20 to your computer and use it in GitHub Desktop.
Automatically Publishing Files to CloudFront in Elastic Beanstalk
This file contains hidden or 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
container_commands: | |
01_upload_to_cdn: | |
command: | | |
export REGION=`curl -s http://169.254.169.254/latest/dynamic/instance-identity/document |grep region |cut -d: -f2 | sed -e 's/[\",]//g'` | |
export INCLUDES=`echo $W3TC_CF_FILE_EXTENSIONS | sed 's/;/\ /g'` | |
for INC in $INCLUDES; do | |
aws s3 sync wp-includes/ s3://${W3TC_CF_BUCKET_NAME}/wp-includes/ --exclude "*" --include "${INC}" --region $REGION | |
aws s3 sync wp-content/ s3://${W3TC_CF_BUCKET_NAME}/wp-content/ --exclude "*" --include "${INC}" --region $REGION | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment