Git Product home page Git Product logo

git-trello-hook's Introduction

git-trello-hook

A github/gitlab webhook script written by python inspired by ruby gem git-trello.

#Instructions

$ pip -r requirements.txt
Update these placeholders in git-trello-hook.py
    TRELLO_CONFIG = {
        'api_key': 'TRELLO_API_KEY',
        'oauth_token': 'TRELLO_OAUTH_TOKEN_FOR_BOARD',
        'board_id': 'BOARD_ID',
        'list_id_in_progress': 'LIST_ID',
        'list_id_done': 'LIST_ID',
    }

    WEBHOOK_CONFIG = {
        'host': '0.0.0.0',
        'port': 7343
    }
Open your github/gitlab repo settings, add an webhook URL according to your configs.

e.g. For heroku deployment, add url https://[your-own-url].herokuapp.com/webhook
e.g. For self hosting, add url https://your-ip-address:port/webhook

$ git commit -a -m "Fix [card #1]"
$ git push

git-trello will move Card #1(View Card, Card index is on the right bottom corner) from list_id_in_progress to list_id_done and append with your git commit url.

###API_KEY https://trello.com/1/appKey/generate

###OAUTH_TOKEN This is not so well explained in Trello, but I understood that you need to authorize the app with API_KEY to access each board separatelly. To do that:

https://trello.com/1/authorize?response_type=token&name=[BOARD+NAME+AS+SHOWN+IN+URL]&scope=read,write&expiration=never&key=[YOUR+API_KEY+HERE]

where [YOUR+API_KEY+HERE] is the one you entered in the previous step, while [BOARD+NAME+AS...] is, well, what it says. If your board url is

https://trello.com/b/XLvlTFVA/git-trello

then you should type in "git-trello".

###TRELLO_BOARD_ID It is the end of the URL when viewing the board. For example, for https://trello.com/b/XLvlTFVA/git-trello, board_id is XLvlTFVA.

###LIST_ID_IN_PROGRESS and LIST_ID_IN_DONE List IDs seem to be a (board id + list index), where all are treated as hex numbers. However, this is undocumented.

Safe way to find a list ID is to open a card from the list, click the More link in the bottom-right corner, select Export JSON and find the idList.

Post receive will move all referenced cards to the LIST_ID_IN_PROGRESS, unless they are referenced by Close or Fix word, in which case it will move them to the LIST_ID_IN_DONE.

#Examples

Example Trello board Example git repo

#TODOs

  • easy configuration
  • easy deployment

#Credits

git-trello

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.