Django应用程序集成了Bitbucket挂接后调用和Trello板。

django-trello-broker的Python项目详细描述


Django Trello经纪人

Info:Django app to integrate BitBucket POST hooks and Trello boards
Version:0.3
Author:Peter Sanchez <peter@netlandish.com> - Netlandish Inc. (http://www.netlandish.com)

依赖性

  • Python2.7+
  • Django 1.7+
  • 特雷罗0.9.1+
  • 请求2.2.1+

安装

管道:

pip install django-trello-broker

基本手动安装:

$ python setup.py build
$ sudo python setup.py install

替代安装(手动):

在python路径中放置trello_broker目录。在python中安装site packages目录,或设置$pythonpath环境变量以包含trello_broker目录所在的目录。

使用量

  1. 将“Trello_Broker”添加到已安装的应用程序中

  2. 在URL结构中的某个位置添加“trello_broker.url”。示例:

    urlpatterns = patterns('',
        url(r'^admin/', include(admin.site.urls)),
        url(r'^broker', include('trello_broker.urls')),
        ... (all your other urls here) ...
    )
    
  3. 向数据库中至少添加1个trello令牌。示例:

    $ ./manage.py add_trello_token
    Enter your Trello applications name.
    
    App Name: Netlandish Bot
    
    Enter your Trello user API Key. You can get it from:
    
    https://trello.com/1/appKey/generate
    
    API Key: <Our Super Secret Key Here>
    
    Go to the following URL to get your API Token:
    
    https://trello.com/1/authorize?key=<Our Super Secret Key Here>&name=Netlandish+Bot&expiration=never&response_type=token&scope=read,write
    
    API Token: <Our Super Secret Token Here>
    Saved token (ID: 1) to the database.
    
  4. 现在,您可以自动填充新令牌可以访问的所有trello板。示例:

    $ ./manage.py populate_trello_boards
    Processing token Netlandish Bot
    Processing board BracketWire Development
    Processing board Bracketwire Planning
    Processing board CHAP Development
    Processing board CHAP Planning
    Processing board CartFreak Development
    Processing board CartFreak Planning
    .......
    
  5. 转到http://yourdomain.com/admin/(或您的管理url)并添加位桶存储库。保存后,您将能够添加一个新的“规则”。一旦保存了该规则,就可以添加另一个规则。目前只允许2条规则。“参考”和“修复/关闭”。

Referenced
When a card has been referenced in a commit message, this rule will be triggered.
Example
Simply using “#<card-short-id>” works. For instance, “Starting working on new feature for #213”
Fixes / Closes
When a card has been referenced in a commit message but also uses a “fix” or “close” prefix
Example:
One of the following words following by the card short ID. Words are “fix(ed|es)” or “close(d|s)”. This is case insensitive. For instance, “Finished work for new feature. Closes #213”
http://all-media.s3.amazonaws.com/images/broker_admin.png

#是的。将post hook添加到bitbucket存储库设置中。见BitBucket POST Hook Management

Note Be sure to include the access_key if you stored one in your BitBucket Repo in the Django Admin. For instance, if you used “foobar” as your access key in Django admin, in the BitBucket settings you need to pass in the access key like so: http://yourdomain.com/broker/?access_key=foobar

设置

应用程序支持一些设置。

  1. trello_broker_use_芹菜-默认为false。如果为true,代理处理器将使用芹菜任务“芹菜进程提交”,这只是通过芹菜设置运行的正常“进程提交”函数的包装。

  2. trello_broker_restrict_ips-默认为false。如果为true,代理将检查发送请求的客户端是否来自指定的BitBucket代理服务器。见:BitBucket IP List Here

  3. trello_broker_bitbucket_ip s-允许发布给代理的客户端IP的列表。默认为

    ['131.103.20.165', '131.103.20.166']
    

    此设置取决于trello_broker_restrict_ips设置为true

模板

使用了一个模板,其中包含用于生成Trello卡上的注释的消息。:

trello_broker/update_message.txt

默认情况下,模板包含以下内容:

Commit ```{{ changeset }}``` committed by {{ author }} with the message ```{{ commit_message }}``` - View at: {{ commit_url }}

以下是将传递给模板的上下文:

context = {
    'author': commit['author'],
    'author_full': commit['raw_author'],
    'changeset': commit['node'],
    'changeset_full': commit['raw_node'],
    'commit_url': urljoin(base_commit_url, commit['raw_node']),
    'commit_message': commit['message'],
}

“base_commit_url”变量的值是从BitBucket提供的数据拼凑而成的。本质上是“https://bitbucket.org/username/reponame”。请参见BitBucket POST Hook Management文档,了解json数据的外观示例

管理操作

还包括一个简单的管理操作,使您可以很容易地通过管理列表页面重新填充一个或多个trello板。只需选择要更新的板,选择操作,点击“开始”。

http://all-media.s3.amazonaws.com/images/broker_actions.png

实际例子

这是我们的一张开发卡的简单截图

http://all-media.s3.amazonaws.com/images/in_action.png

商业支持

这个软件,以及许多其他类似的软件,都是为支持 Netlandish自己的项目,以及我们客户的项目。我们很乐意帮助你 关于你的下一个项目,请联系我们,在hello@netlandish.com留言。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android:在ListView上使用setOnItemClickListener   使用Netbeans 7.0连接到SQL Server的java正在挂起   java Spring3依赖项注入不适用于mule   java Flink SQL结果字段与LocalDateTime上请求的类型错误不匹配   java找不到文件的结尾   考虑到NamingStrategy,java有没有办法将字符串转换为JsonNode?   使用Netbeans/ant部署java(命令行)应用程序   java如何修复Spring引导多部分上载中的“所需请求部分不存在”   java在应用程序启动时通过引用获取映射未知目标实体属性异常   java形状旋转问题Java2d   Weblogic服务器上的java ExecuteAndWaitInterceptor问题   JavaSpringBoot:project将图像保存在错误的路径中,并且在使用IDEIntellji打开时不显示图像   类向java接口添加方法   Swing组件上的Java 7泛型   sql server如何从java获取用户名。sql。联系   java如何检查该行是否与正则表达式(regex)冲突?   java如何在spring引导安全中为计数失败登录设置验证登录为false   图像如何在Java中使PNG的白色透明?