0.2.0 • Published 5 years ago

deployrjs v0.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 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

5 years ago

0.0.34

7 years ago

0.0.33

7 years ago

0.0.32

7 years ago

0.0.31

7 years ago

0.0.3

7 years ago

0.0.28

7 years ago

0.0.27

7 years ago

0.0.26

7 years ago

0.0.25

8 years ago

0.0.24

8 years ago

0.0.23

8 years ago

0.0.22

8 years ago

0.0.21

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago