Generates OmniSD zip file from a Git repo whenever it was called(For usage with Git webhooks)

Farooq KZ c6d79ed709 Merge branch 'master' of https://notabug.org/farooqkz/git2omnisd 1 week ago
.gitignore 678df14bca Initial commit 1 week ago
LICENSE 678df14bca Initial commit 1 week ago
README.md 75256611c1 Update 'README.md' 1 week ago
git2omnisd.py ab184498b5 Fix: OmniSD invalid metadata 1 week ago

README.md

git2omnisd

Generates OmniSD zip file from a Git repo whenever it was called(For usage with Git webhooks)

This script creates an OmniSD compatible zip file from the given git repository and has been created to use with Git webhooks. Config has been hardcoded. Adding a method which reads config from a config file is welcome(hint: use Python's configparser module) or if you can't and you need, contact me so that I may add this feature if I had enough resource.

Usage

First install requirements with pip:

python3 -m pip install cherrypy requests

Then change this app's config through editing the source code:

  • Change port from 2080 to what you want
  • Change "mooing" to the secret thing of the webhook you've been created for your repo.
  • Change out variable ("/tmp/eval-omnisd.zip") to anything you want. A temporary file will be written there.
  • Change repo_name to your app's repository name.
  • Change app_id to App ID. This will be used in creating OmniSD zip.

Now run the script:

python3 git2omnisd.py

And:

  • Set your webhook payload URL to http://host:the_port_you_used/
  • Download your an OmniSD compatible version of your app from http://host:port/download
  • Content type must be application/x-www-form-urlencoded That's it all :)

Licence

It is under ISC and comes with absolutely no warranty from me. See LICENSE.