1.1.0 • Published 8 years ago

deployy-mcdeployface v1.1.0

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

Deployy McDeployface

A simple, stupid Node-based deploy script working with GitHub Webhooks.

Setup

git clone https://github.com/jwilsson/deployy-mcdeployface.git
cd deployy-mcdeployface/
npm install
npm run build

Usage example

Running via forever:

forever start /path/to/deployy-mcdeployface/dist/index.js /path/to/config.json

Running via pm2:

pm2 start /path/to/deployy-mcdeployface/dist/index.js -- /path/to/config.json

When you start you will get a list of what webhooks to add to each repo. The URL to ping should include a name of the repo in a target query string, http://example.com:1234/?target=deployy-mcdeployface will trigger a deploy for this script.

Then, whenever a push to a GitHub repo is made, this script will be pinged and perform the steps outlined for that repo.

For example:

{
    "port": 1234,
    "host": "example.com",
    "path": "/deployy-mcdeployface",
    "stopOnError": true,
    "repos": {
        "deployy-mcdeployface": {
            "path": "/local/path/to/repo",
            "commands": [
                "git pull",
                "npm install",
                "npm run build"
            ]
        }
    }
}

Response codes

CodeMeaning
200Got a valid GitHub push event
204Got a valid GitHub ping event
400Got a request without a target parameter
401Got an invalid message either with an unsupported GitHub event or without a GitHub event header