Grunt task for deploying using pkgcloud
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-pkgcloud --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-pkgcloud');
In your project's Gruntfile, add a section named pkgcloud
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
pkgcloud: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
});
Type: Boolean
Default value: true
If the specified dest
container does not exists, should one be created?
Type: Object
Default value: {}
Extra metadata to apply to the uploaded files.
Type: Object
Default value: undefined
The client definition for a pkgcloud storage provider.
Deploy files to your OpenStack environment in the test
container using the default settings. The files
section
currently only has support Grunt's "Files Array" mapping format, and the cwd
option has to be specified.
grunt.initConfig({
pkgcloud: {
staging: {
options: {
client: {
authUrl: 'https://identity.stack.cloudvps.com',
username: 'foo',
password: 'bar',
provider: 'openstack',
tenantId: 'moo'
}
},
files: [{
cwd: 'dist',
src: '**',
dest: 'test'
}]
}
}
});
grunt.initConfig({
pkgcloud: {
options: {
client: {
provider: 'rackspace',
username: 'username',
apiKey: 'awesomeAPIKey',
region: 'IAD'
}
},
files: [{
cwd: 'dist/css',
src: '**',
dest: 'test/css'
},{
cwd: 'dist/fonts',
src: '**',
dest: 'test/fonts',
headers: {
'Access-Control-Allow-Origin': '*'
}
},{
cwd: 'dist/image',
src: '**',
dest: 'test/image'
},{
cwd: 'dist/js',
src: '**',
dest: 'test/js'
}]
}
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
- 0.1.0: First release