Skip to content

tushar-singh/deployrjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What?

DeployrJS allows quickly bootstrapping a deployment server that listens to github web hooks and does whatever you want whenever an action occurs. This includes system commands and/or arbitrary JS

How?

1. Install npm install --save deployrjs

2. take over the planet

const Deployr = require('deployrjs');
const exec = require('child-process-promise').exec;

const deployment = new Deployr({
    // this is your github secret key.
    // Not passing this will disable verification
    key: #####,

    // port to listen on
    port: 4000,

    // branch to deploy
    branch: 'master',
});

deployment.listen((action, pull) => {
    // "action" is the object sent by github web hook

    pull()
        .then(() => {
            // At this point, files are identical to git repo
            // Let's re-run a build script

            console.log('Running build script...');
            return exec('npm run build');
        })

        .catch(err =>
            console.error('failed!');
        );
});

use Promise wrappers for async functions. e.g. https://www.npmjs.com/package/fs-promise

About

Automatic Git deployment helper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%