Giter Site home page Giter Site logo

kolayne / webhook_shell_script_invoker Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 28 KB

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

Python 100.00%
actions webhook webhook-events

webhook_shell_script_invoker's Introduction

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"}'

webhook_shell_script_invoker's People

Contributors

codacy-badger avatar kolayne avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.