Package Exports
- shipit-cli
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (shipit-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Shipit

Shipit is an automation engine and a deployment tool written for node / iojs. Shipit was built to be a Capistrano alternative for people who want to write tasks in JavaScript and don't have a piece of ruby in their beautiful codebase.
Features:
- Full JavaScript
- Login and interactive session
- Task flow based on orchestrator (gulp core)
- Blocking tasks
- Official deploy task
- Easily extendable
Install
It's recommended to install Shipit locally in your project.
npm install --save-dev shipit-cli
Getting Started
One shipit is installed, you must create a shipitfile.js, if you are familiar with grunt or gulp, this is the same.
Create a shipitfile.js
module.exports = function (shipit) {
shipit.initConfig({
staging: {
servers: 'myproject.com'
}
});
shipit.task('pwd', function () {
return shipit.remote('pwd');
});
};
Launch command
shipit staging pwd
The binary shipit
is located in ./node_modules/.bin/shipit
. I recommend you to add in your path: ./node_modules/.bin
.
Usage
shipit <environment> <tasks ...>
Options
servers
Type: String
or Array<String>
Servers on which the project will be deployed. Pattern must be user@myserver.com
if user is not specified (myserver.com
) the default user will be "deploy".
key
Type: String
Path to SSH key
Events
You can add custom event and listen to events.
shipit.task('build', function () {
// ...
shipit.emit('built');
});
shipit.on('built', function () {
shipit.run('start-server');
});
Methods
shipit.task(name, deps, fn)
Create a new Shipit task, if you are familiar with gulp, this is the same API. You can use a callback or a promise in your task.
For more documentation, please refer to orchestrator documentation.
shipit.task('pwd', function () {
return shipit.remote('pwd');
});
shipit.blTask(name, deps, fn)
Create a new Shipit task, that will block other tasks during its execution. If you use these type of task, the flow will be exactly the same as if you use grunt.
shipit.blTask('pwd', function () {
return shipit.remote('pwd');
});
shipit.start(tasks)
Run Shipit tasks.
For more documentation, please refer to orchestrator documentation.
shipit.start('task');
shipit.start('task1', 'task2');
shipit.start(['task1', 'task2']);
shipit.local(command, [options], [callback])
Run a command locally and streams the result. This command take a callback or return a promise.
shipit.local('ls -lah', {cwd: '/tmp/deploy/workspace'}).then(...);
shipit.remote(command, [options], [callback])
Run a command remotely and streams the result. This command take a callback or return a promise.
If you want to run a sudo
command, the ssh connection will use the TTY mode automatically.
shipit.remote('ls -lah').then(...);
shipit.remoteCopy(src, dest, callback)
Make a remote copy from a local path to a dest path.
shipit.remoteCopy('/tmp/workspace', '/opt/web/myapp').then(...);
shipit.log()
Log using Shipit, same API as console.log
.
shipit.log('hello %s', 'world');
Dependencies
- OpenSSH 5+
Deploy using Shipit
The best way to deploy using Shipit is to use the Shipit deploy task.
License
MIT