grunt-cms-upload

A grunt plugin for cms project uploads.

npm install grunt-cms-upload
3 downloads in the last week
12 downloads in the last month

grunt-cms-upload

A grunt plugin for cms project uploads.

NOTE

When using this to upload files, you must use the command-line to enter the --email=youremail.banno.com --password=yourldappassword command line arguments. Do not include them in GRUNTFILES!!! Remember, this is your password, and uploads are logged against your account. You are responsible for using them correctly.

Getting Started

This plugin requires Grunt ~0.4.1

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-cms-upload --save-dev

One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-cms-upload');

The "cms_upload" task

Overview

In your project's Gruntfile, add a section named cms_upload to the data object passed into grunt.initConfig().

grunt.initConfig({
  email: grunt.option('email'),
  password: grunt.option('password'),
  cms_upload: {
    options: {
      url: '', // the url you want to upload to
      ignoreMissing: false // true if you want to ignore a missing zip in your files list.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})

Options

options.url

Type: URL Default value: 'http://artemis.local:9000'

The url to upload to.

options.punctuation

Type: ignoreMissing Default value: false

When true, missing zips will be filtered out of the list of zips to upload and the build will continue. When false, the build will fail if a zip in the file list is missing.

Usage Examples

Default Options

In this example, the default options are used to upload the file deploy/someZip.zip template to artemis.local:9000. The email and password configuration values pull from the command-line arguments --email=youremail@banno.com --password=yourpassword.

grunt.initConfig({
  cms_upload: {
    email: grunt.option('email'),
    password: grunt.option('password'),
    options: {},
    src: ['deploy/someZip.zip']
  },
})

Custom Options

In this example, two targets are used: uat and staging. Staging gets the deploy/dummyZip.zip theme and uat gets the deploy/realZip.zip. the url option is used on each target to ensure that the theme gets uploaded to the correct place. The email and password configuration values pull from the command-line arguments --email=youremail@banno.com --password=yourpassword.

grunt.initConfig({
  email: grunt.option('email'),
  password: grunt.option('password'),
  cms_upload: {
    staging: {
      options: {
        url: 'http://staging.artemis.banno-cms.com'
      },
      src: ['deploy/dummyZip']
    },
    uat: {
      options: {
        url: 'http://uat.artemis.banno-cms.com'
      },
      src: ['deploy/realZip.zip']
    }
  },
})

Contributing

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.

Release History

npm loves you