Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change taskname from modulus-deploy to modulusDeploy #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ This plugin requires you add environment variables to authenticate with modulus.
###MODULUS_TOKEN
- The API Token that gives access to deploy to the specified project. Please see here for documentation on [how to create an API Token](https://modulus.io/codex/cli/using_api_tokens).

## The "modulus-deploy" task
## The "modulusDeploy" task

### Overview
In your project's Gruntfile, add a section named `modulus-deploy` to the data object passed into `grunt.initConfig()`.
In your project's Gruntfile, add a section named `modulusDeploy` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
modulus-deploy: {
modulusDeploy: {
options: {
// Task-specific options go here.
},
Expand All @@ -49,14 +49,19 @@ Type: `String`

The name of the modulus project to deploy.

#### options.path
Type: `String`

The relative or absolute path of the folder to deploy.

### Usage Examples

#### Default Options
In this example, a target `stage` is defined. When the task runs, it attempts to deploy the site to the modulus project named `my-site-stage`

```js
grunt.initConfig({
modulus-deploy: {
modulusDeploy: {
stage: {
options: {
project: "my-site-stage"
Expand Down
11 changes: 8 additions & 3 deletions tasks/modulus-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,17 @@ var captureOutput = function(child, output) {

module.exports = function(grunt) {

grunt.registerMultiTask('modulus-deploy', 'Allows deployment to modulus.io from Grunt.', function() {
grunt.registerMultiTask('modulusDeploy', 'Allows deployment to modulus.io from Grunt.', function() {
var options = this.options();

var done = this.async();

var deployCmd = modulusPath + ' deploy' + ' -p ' + options.project;
if ( options.path && options.path.length > 0 ) {
options.path = ' ' + options.path;
} else {
options.path = '';
}

var deployCmd = modulusPath + ' deploy' + ' -p ' + options.project + options.path;

runCmd(deployCmd, options.project+' running at', function(err){
if(err){
Expand Down