Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Node deployment tool.

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README
ndeploy
=======

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.

Plugins
-------

The plugin name is determined by the exported name. The plugin itself is exported as
the `plugin` attribute.

An example:

    var http = require('http');

    exports.name = '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.
          app.deploy();

          response.writeHead(200);
          response.end();
        });

        listener.listen(config.port || 80, config.host || 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": "0.0.0.0",
        "trigger": "deploy"
      },
      "deploy": {
        "type": "git-push"
      },
      "targets": [{
        "type": "git",
        "path": "ssh://node@server.no.de/repo",
        "branch": "master",
        "local-private-key": "local/id_rsa",
        "local-public-key": "local/id_rsa.pub"
      }, {
        "type": "ssh-git",
        "host": "ubuntu@myserver.com",
        "remote-private-key": "remote/id_rsa",
        "remote-public-key": "remote/id_rsa.pub"
      }, {
        "type": "local",
        "path": "/tmp"
      }],
      "plugins": [
        "./plugins/github-listener"
        "global-module"
      ],
      "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.
Something went wrong with that request. Please try again.