-
Notifications
You must be signed in to change notification settings - Fork 5
Distributing assets
After you've built your CSS, JS and static images, you will have to distribute them if the designated environment is running S3. This is configured in /application/configs/assets.ini
$ g cdn distribute --to=staging
The staging parameter above could also be development, production or integration. Be careful to specify the correct environment, otherwise you'll have to roll it back to prevent code vs code conflicts.
By default, only the recently modified assets will be distributed. This will not be enough for the first time distributing. In that case, add the since parameter:
$ g cdn distribute --to=staging --since=forever
Next to forever, you can also specify a date.
If you want to distribute specific assets, you can add it to the command; the string will match all folders or files.
$ g cdn distribute --to=staging block-bg.jpg
$ g cdn distribute --to=staging block
Note: block will match block-bg.jpg, as well as folders called block (including their contents).
Use the following command to allow cross origin requests from the main domain to the CDN.
$ g s3 setCors --e=[ENVIRONMENT]
Roll assets back by checking out the master branch (or the one running on the harmed server), building and distributing again to correct it.