Skip to content

Lightweight idle server listening for webhook posts and reacting accordingly

License

Notifications You must be signed in to change notification settings

FINTpoc/fint-webhook-deployer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fint-webhook-deployer

Lightweight idle server listening for webhook posts and reacting accordingly

It will listen for http action on port 3009. When we receive webhook posts to this port, the following actions will be taken:

  • Stop and remove a docker container using the same name as this package, if it exists.
  • Pull down an updated image from the configured docker repo (defauts to hub.docker.com)
  • Create a new container with the image, and boot it.

Expected webhook posts will be in this format:

{
  "package": "my-package",
  "version": "1.2.1",
  "released": "ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ)",
  "release_notes": "This is a test"
}

USAGE

This will start the process as a daemon:

npm start

In order to stop the process:

npm stop

PREREQUISITES

The environment this server runs in, must have docker installed.

Configuration

There's a config.js script which holds the configuration.

module.exports = {
    serverPort: 3009,  // The port this server should run on
    dockerRepo: ''     // If empty, defaults to hub.docker.com. 
}

About

Lightweight idle server listening for webhook posts and reacting accordingly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published