Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
96 lines (74 sloc) 2.4 KB
Deployment for Node.
Design Document
- Use npm as much as possible.
- Be agnostic. Can deploy any code; be it Python, Ruby or Ecmascript.
- Have a cli UI that allows both a daemon and one-off deployment.
- Allow the cli to report back on deployment status.
The plugin name is determined by the exported name. The plugin itself is exported as
the `plugin` attribute.
An example:
var http = require('http'); = 'github-listener';
exports.plugin = function (config) {
return function (app) {
var listener = http.createServer(function (request, response) {
// Parse webhook requests etc...
// Call deploy on the app if a valid change has been made.
listener.listen(config.port || 80, || undefined);
deploy.json File
A valid json file, that descibes how your app will be deployed.
Each object represents a plugin instance, and is passed to the plugin
as the config (first argument) parameter.
Each first level object key represents a key on the `app` object, with each plugin
being resolved as a instance. The only special keys is the `plugins` and `default` key, which specifies
additional plugins to load and which command to run as default respectively.
An example:
"listener": {
"type": "github-listener",
"port": 80,
"host": "",
"trigger": "deploy"
"deploy": {
"type": "git-push"
"targets": [{
"type": "git",
"path": "ssh://",
"branch": "master",
"local-private-key": "local/id_rsa",
"local-public-key": "local/"
}, {
"type": "ssh-git",
"host": "",
"remote-private-key": "remote/id_rsa",
"remote-public-key": "remote/"
}, {
"type": "local",
"path": "/tmp"
"plugins": [
"default": "listener"
ndeploy cli
The cli tool can run any non array type field in the deploy.json file. For the above
config you could run:
ndeploy path/to/deploy.json listener
Which would run the `github-listener` plugin with the given settings.