问题
I'm looking for some help in designing a strategy to automate deployment of a web application's assets (images, css, js) to Rackspace's Cloud Files (CDN) service.
I currently use git push to deploy the web app to a remote server. So here's one way I'm thinking this could happen. Are there any better/cleaner methods?
- Dev makes changes to an asset file (css, js, or an image)
- Dev commits his changes
- Dev pushes his changes to the server
- Assets are automatically renamed to eliminate cache issues (append git version?) and sent to the CDN
- Referencing code would be automatically updated to new filename
FYI, this is a PHP app in CodeIgniter 2.x if it matters.
Happy to hear any ideas, alternative or not.
回答1:
I've not found anything to automatically do it.
You can use the Rack Space Cloud File API ( http://www.rackspace.com/cloud/cloud_hosting_products/files/api/ ) to upload files to Rackspace's CDN aware containers.
回答2:
I'm not aware of anything, but you could probably script something to do this without too much work.
Check out Fog or the official ruby-cloudfiles gem from Rackspace.
回答3:
This might be what you're looking for:
https://github.com/phillc/cloud-files-asset-sync
回答4:
This github repository will do at least part of what you are asking.
https://github.com/bermi/cloudfiles-mirror
回答5:
Since you're using PHP you should seriously consider using the Rackspace PHP SDK. You can find sample code for working with the CDN service. It'll be a lot easier to work with than writing directly to the Cloud Files API.
回答6:
There's a paid service http://beanstalkapp.com/features/deployments for auto deployments to cloud files or other servers.
回答7:
try this its completely automated: https://github.com/rumblelabs/asset_sync
来源:https://stackoverflow.com/questions/6669109/automatically-deploying-assets-to-rackspace-cdn-via-git-and-updating-references