execly

0.0.1 • Public • Published

execly

Streaming process executor, local and remote

install

$ npm install execly

example

deploy.sh on remote

#!/bin/bash 
 
DEST="$1"
REMOTE="$2"
BRANCH="$3"
 
echo "  ... Cloning remote into destiation '$DEST'"
git clone $REMOTE $DEST
cd $DEST
echo "  ... Checking out branch '$BRANCH'"
git checkout $BRANCH
echo "  ... Fetching latest"
git pull --rebase origin $BRANCH
 
var exec = require('execly');
 
function deploy (opts) {
  return exec(opts.host, opts.script, [
    opts.dir, // $DEST
    opts.remote, // $REMOTE
    opts.branch || 'master' // $BRANCH
  ], {
    privateKey: require('fs').readFileSync('/path/to/key/file')
  });
}
 
deploy({
  host: 'user@prod.server.com',
  dir: '/srv/www', remote: 'git@host.com:app.git'
})
.pipe(process.stdout);

usage

execly(host, command, args, opts); // => Stream

license

MIT

/execly/

    Package Sidebar

    Install

    npm i execly

    Weekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • werle