shipit-cnpmjs
v0.1.0
Published
cnpm tasks for shipit.
Downloads
2
Readme
shipit-cnpm
A set of tasks for Shipit used for cnpm specific tasks on deploy.
Inspired by the capistrano/composer extension.
Features:
- Triggered on the
updated
orfetched
event from shipit-deploy - Has a direct pass though task to cnpm cli
- Works via shipit-cli and grunt-shipit
Install
npm install shipit-cnpm
Usage
Just simply run: (This triggers the cnpm
task on the deploy updated
or fetched
event. No additional config necessary.)
shipit staging deploy
Or you can run the tasks separatly :
shipit staging cnpm:init cnpm:install
shipit staging cnpm:run --cmd "update"
Options shipit.config.cnpm
cnpm.remote
Type: Boolean
Default: true
A Boolean to determine whether to run the task in local workspace or on the remote.
cnpm.installArgs
Type: Array
or String
Default: []
An array or string specifying cnpm args passed to the cnpm install cmd.
cnpm.installFlags
Type: Array
or String
Default: []
An array or string specifying cnpm flags passed to the cnpm install cmd.
cnpm.triggerEvent
Type: String
,Boolean
Default: updated
or fetched
(depending on cnpm.remote
value)
An event name that triggers cnpm:install
. Can be set to false to prevent the cnpm:install
task from listening to any events.
Example shipitfile.js
options usage
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
require('shipit-cnpm')(shipit);
shipit.initConfig({
default: {
cnpm: {
remote: false,
installArgs: ['gulp'],
installFlags: ['-g']
}
}
});
};
Workflow tasks
- cnpm
- cnpm:init
- Emit event "cnpm_inited".
- cnpm:install
- Runs cnpm install (with any Args
cnpm.installArgs
or Flagscnpm.installFlags
defined in options) - Emit event "cnpm_installed"
- Runs cnpm install (with any Args
- cnpm:run
- Runs cnpm command.
- cnpm:init
Event flow:
- on Event "deploy" (shipit-deploy initialized)
- Runs cnpm:init
- on Event "cnpm_inited"
- Runs cnpm:install (Triggered on the
updated
orfetched
event from shipit-deploy or by a customcnpm.triggerEvent
as mentioned above.)
- Runs cnpm:install (Triggered on the
License
MIT