2013-08-06 21:32:15 +02:00
|
|
|
# Zulip, Inc's internal git plugin configuration.
|
2013-02-15 23:01:55 +01:00
|
|
|
# The plugin and example config are under api/integrations/
|
|
|
|
|
|
|
|
# Leaving all the instructions out of this file to avoid having to
|
|
|
|
# sync them as we update the comments.
|
|
|
|
|
2013-08-07 18:26:11 +02:00
|
|
|
ZULIP_USER = "commit-bot@zulip.com"
|
|
|
|
ZULIP_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
2013-02-15 23:01:55 +01:00
|
|
|
|
|
|
|
# commit_notice_destination() lets you customize where commit notices
|
|
|
|
# are sent to.
|
|
|
|
#
|
|
|
|
# It takes the following arguments:
|
|
|
|
# * repo = the name of the git repository
|
|
|
|
# * branch = the name of the branch that was pushed to
|
|
|
|
# * commit = the commit id
|
|
|
|
#
|
|
|
|
# Returns a dictionary encoding the stream and subject to send the
|
|
|
|
# notification to (or None to send no notification, e.g. for ).
|
|
|
|
#
|
|
|
|
# The default code below will send every commit pushed to "master" to
|
|
|
|
# * stream "commits"
|
2013-12-11 17:41:54 +01:00
|
|
|
# * topic "master"
|
2013-02-15 23:01:55 +01:00
|
|
|
# And similarly for branch "test-post-receive" (for use when testing).
|
|
|
|
def commit_notice_destination(repo, branch, commit):
|
2013-03-18 23:15:52 +01:00
|
|
|
if branch in ["master", "prod", "test-post-receive"]:
|
2013-03-18 23:17:16 +01:00
|
|
|
return dict(stream = 'test' if 'test-' in branch else 'commits',
|
2013-12-11 17:41:54 +01:00
|
|
|
subject = u"%s" % (branch,))
|
2013-02-15 23:01:55 +01:00
|
|
|
|
|
|
|
# Return None for cases where you don't want a notice sent
|
|
|
|
return None
|
|
|
|
|
2013-10-08 20:45:05 +02:00
|
|
|
# Modify this function to change how commits are displayed; the most
|
|
|
|
# common customization is to include a link to the commit in your
|
|
|
|
# graphical repository viewer, e.g.
|
|
|
|
#
|
2013-11-20 19:10:43 +01:00
|
|
|
# return '!avatar(%s) [%s](https://example.com/commits/%s)\n' % (author, subject, commit_id)
|
2013-10-08 20:45:05 +02:00
|
|
|
def format_commit_message(author, subject, commit_id):
|
2013-11-20 19:10:43 +01:00
|
|
|
return '!avatar(%s) [%s](https://git.zulip.net/eng/zulip/commit/%s)\n' % (author, subject, commit_id)
|
2013-10-08 20:45:05 +02:00
|
|
|
|
2013-10-04 19:19:57 +02:00
|
|
|
ZULIP_API_PATH = "/home/zulip/zulip/api"
|
2015-02-06 07:07:13 +01:00
|
|
|
ZULIP_SITE = "https://zulip.com"
|