Shipr
Shipr is forked from shipit, and can use all shipit plugins.
Shipit is an automation engine and a deployment tool written for node / iojs.
Shipit was built to be a Capistrano alternative for people who don't know ruby, or who experienced some issues with it. If you want to write tasks in JavaScript and enjoy the node ecosystem, Shipit is also for you.
You can automate anything with Shipit but most of the time you will want to deploy your project using the Shipit deploy task.
Features:
- Full JavaScript (all npm package availables)
- Task flow based on orchestrator (gulp core)
- Official deploy task
- Login and interactive SSH commands
- Easily extendable
Install
Globally
npm install --global shipr
Locally
npm install --save-dev shipr
Getting Started
Once shipr is installed, you must create a shiprfile.js.
If you are familiar with grunt or gulp, you will feel at home.
shiprfile.js
Create a module { shipr; shipr;};
Launch command
shipr staging pwd
Deploy using Shipit
You can easily deploy a project using Shipit and its plugin shipit-deploy.
shiprfile.js
Example module { shipr; shipr;};
To deploy on staging, you must use the following command :
shipr staging deploy
You can rollback to the previous releases with the command :
shipr staging rollback
Usage
shipr <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.
shipr; shipr;
Shipit emits the init
event once initialized, before any tasks are run.
Methods
shipr.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.
shipr;
shipr.blTask(name, [deps], fn)
Create a new Shipit task that will block other tasks during its execution (synchronous).
If you use these type of task, the flow will be exactly the same as if you use grunt.
shipr;
shipr.start(tasks)
Run Shipit tasks.
For more documentation, please refer to orchestrator documentation.
shiprstart'task';shiprstart'task1' 'task2';shiprstart'task1' 'task2';
[options], [callback])
shipr.local(command,Run a command locally and streams the result. This command take a callback or return a promise. It returns a result object containing stdout, stderr and the child process object.
shipr;
[options], [callback])
shipr.remote(command,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.
It returns an array of result objects containing stdout, stderr and the child process object. The list of results matchs the list of servers specified in configuration.
shipr;
shipr.run(command, [options])
Run commands in seres.
more usage: TODO
shipr.remoteCopy(src, dest, [options], [callback])
Make a remote copy from a local path to a dest path.
shipr;
shipr.log()
Log using Shipit, same API as console.log
.
shipr;
Dependencies
Customising environments
You can overwrite all default variables defined as part of the default
object.
module { shipr; ... shipr; ...};
Async Config
If you can't call shipr.initConfig(...)
right away because
you need to get data asynchronously to do so, you can return
a promise from the module:
module { return }
If you need to use a function that works with callbacks instead of promises, you can wrap it manually:
module { return { } }
Known Plugins
Official
Third Party
- shipit-shared
- shipit-db
- shipit-assets
- shipit-ssh
- shipit-utils
- shipit-npm
- shipit-aws
- shipit-captain
- shipit-bower
- shipit-composer
Who use Shipit?
License
MIT