Skip to content

PM2 module to process webhooks and update your project realtime. Supports multiple ports and pathes.

License

Notifications You must be signed in to change notification settings

presenterx/pm2-webhook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PM2-Webhook

npm npm

PM2 module to process webhooks and update your project realtime. Supports multiple ports and pathes.

Installation

You must have pm2 installed. Just add module

pm2 install pm2-webhook

Usage

GitHub webhook

Your repository page → Settings → Webhooks & services → Add webhook

Field Value
Payload URL http://example.com:23928/webhook
Content Type application/json
Secret SECRET

PM2 config

Add environment variables in your ecosystem.json file. Only port variable is mandatory.

{
    "apps": [
        {
            "name": "app",
            "env_webhook": {
                "port": 23928,
                "path": "/webhook",
                "secret": "SECRET"
            },
            ...
        },
        ...
    ]
}

Restart your processes with pm2 startOrGracefulReload ecosystem.json.

That's it. Each time you push to your repository, this module runs pm2 pull <app name>.

Copyright and license

Copyright 2016 Anton Isaykin.

Licensed under the MIT License.

About

PM2 module to process webhooks and update your project realtime. Supports multiple ports and pathes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%