0.2.0 • Published 7 years ago

deployrjs v0.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

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

Setup

1. Install npm install --save deployrjs or yarn add deployrjs

2. take over the planet

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

/* optional: for slack notifications */
const Slack = require('deployrjs/addons/slack')('https://hooks.slack.com/services/xxxxxx/xxxxxx/xxxxxx'); // Slack webhook URL

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

    // port to listen on
    port: 4000,

    // branch to deploy (optional)
    // deploy only when this branch is updated
    branch: 'master',
});

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

    pull()
        .then(() => {
            Slack.post('Deploying...');
            
            // At this point, files are identical to git repo
            // Let's re-run a build script
            return exec('npm run build');
        })
        
        .then(() => {
            Slack.post('Deployment successful!');
        })

        .catch(err =>
            Slack.post('Deployment failed!');
        );
});

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

0.2.0

7 years ago

0.0.34

9 years ago

0.0.33

9 years ago

0.0.32

10 years ago

0.0.31

10 years ago

0.0.3

10 years ago

0.0.28

10 years ago

0.0.27

10 years ago

0.0.26

10 years ago

0.0.25

10 years ago

0.0.24

10 years ago

0.0.23

10 years ago

0.0.22

10 years ago

0.0.21

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago