Grunt task to work with Rackspace Cloudfiles
Cloud Files is Rackspace's cloud object storage. It's simliar to Amazon S3.
This is all designed to work with Rackspace Cloud Files, and hasn't been tested on OpenStack Storage.
npm install grunt-cloudfiles --save-dev(or manually add
Add the task to your Gruntfile's grunt.initConfig:
cloudfiles:prod:'user': 'your Rackspace username''key': 'your Rackspace API key''region': 'DFW''upload':'container': 'name of your Cloud Files container''src': 'source/static/**/*''dest': 'some/folder/''stripcomponents': 1'purge':'emails': 'firstname.lastname@example.org''files': 'index.html'
Stripcomponents (as in tar) will strip X leading path parts from the source dir.
In the example above, the file
will be uploaded to
some/folder/static/js/app/main.js, with the
source/ part being removed.
Since this is a multi task, you can add multiple targets as needed.
In this example we only have
prod, but you could have
Remember that your Rackspace API key is private. If you are commiting your Gruntfile to a public repository, you probably want to store it in a separate local_config.json file.
For Rackspace UK users an additional configuration parameter
authUrl is required to use the correct CDN url for UK accounts.
cloudfiles:prod:'region': 'LON''authUrl': ''