Skip to content

Simple tool for running shell scripts on webhook events. A simple sample use case is Github Actions: send request from a deploy action to a server with webhook shell invoker running to easily run a deploy script

Notifications You must be signed in to change notification settings

kolayne/webhook_shell_script_invoker

Repository files navigation

Webhook Shell Invoker

Codacy Badge

Simple tool for running shell scripts on webhook events. A simple sample use case is Github Actions: send request from a deploy action to a server with WSI (this project) running to easily run a deploy script

Usage (server)

To set up a requests acceptor on a server, follow these steps:

  1. Create scripts inside scripts/ directory and make them runnable (chmod +x)

  2. Create config.py with the following variables defined:

    • secret_token A string token to verify that a trusted service is sending the request

    • projects_to_scripts A dictionary from (strings) projects names to (strings) names of script files inside scripts/ directory

    Example is in example_config.py

  3. Run python3 main.py

Usage (client)

Default port is 2010. Post HTTP requests to / with header Authorization set to the authorization secret key from config.py and json body with key project_name set to name of a project (key of projects_to_scripts from config.py) are accepted. You can send it in any way. Example with curl:

curl --fail http://localhost:2010 -H "Content-Type: application/json" \
        -H "Authorization: password12345" \
        --data '{"project_name": "project_name_1"}'

About

Simple tool for running shell scripts on webhook events. A simple sample use case is Github Actions: send request from a deploy action to a server with webhook shell invoker running to easily run a deploy script

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages