mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-30 19:43:47 +00:00 
			
		
		
		
	Shorter topics for git/svn integration.
(imported from commit 6c9822f6ba383d885e48d3bb64c30e49ea8cf1e5)
This commit is contained in:
		| @@ -39,12 +39,12 @@ ZULIP_API_KEY = "0123456789abcdef0123456789abcdef" | |||||||
| # | # | ||||||
| # The default code below will send every commit pushed to "master" to | # The default code below will send every commit pushed to "master" to | ||||||
| # * stream "commits" | # * stream "commits" | ||||||
| # * subject "deploy => master" (using a pretty unicode right arrow) | # * topic "master" | ||||||
| # And similarly for branch "test-post-receive" (for use when testing). | # And similarly for branch "test-post-receive" (for use when testing). | ||||||
| def commit_notice_destination(repo, branch, commit): | def commit_notice_destination(repo, branch, commit): | ||||||
|     if branch in ["master", "test-post-receive"]: |     if branch in ["master", "test-post-receive"]: | ||||||
|         return dict(stream  = "commits", |         return dict(stream  = "commits", | ||||||
|                     subject = u"deploy \u21D2 %s" % (branch,)) |                     subject = u"%s" % (branch,)) | ||||||
|  |  | ||||||
|     # Return None for cases where you don't want a notice sent |     # Return None for cases where you don't want a notice sent | ||||||
|     return None |     return None | ||||||
|   | |||||||
| @@ -36,15 +36,15 @@ ZULIP_API_KEY = "0123456789abcdef0123456789abcdef" | |||||||
| # Returns a dictionary encoding the stream and subject to send the | # Returns a dictionary encoding the stream and subject to send the | ||||||
| # notification to (or None to send no notification). | # notification to (or None to send no notification). | ||||||
| # | # | ||||||
| # The default code below will send every commit except for the "master-plan" | # The default code below will send every commit except for the "evil-master-plan" | ||||||
| # and "secret" repos to | # and "my-super-secret-repository" repos to | ||||||
| # * stream "commits" | # * stream "commits" | ||||||
| # * subject "deploy => branch_name" (using a pretty unicode right arrow) | # * topic "branch_name" | ||||||
| def commit_notice_destination(path, commit): | def commit_notice_destination(path, commit): | ||||||
|     repo = path.split('/')[-1] |     repo = path.split('/')[-1] | ||||||
|     if repo not in ["evil-master-plan", "my-super-secret-repository"]: |     if repo not in ["evil-master-plan", "my-super-secret-repository"]: | ||||||
|         return dict(stream  = "commits", |         return dict(stream  = "commits", | ||||||
|                     subject = u"deploy \u21D2 %s" % (repo,)) |                     subject = u"%s" % (repo,)) | ||||||
|  |  | ||||||
|     # Return None for cases where you don't want a notice sent |     # Return None for cases where you don't want a notice sent | ||||||
|     return None |     return None | ||||||
|   | |||||||
| @@ -20,12 +20,12 @@ ZULIP_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |||||||
| # | # | ||||||
| # The default code below will send every commit pushed to "master" to | # The default code below will send every commit pushed to "master" to | ||||||
| # * stream "commits" | # * stream "commits" | ||||||
| # * subject "deploy => master" (using a pretty unicode right arrow) | # * topic "master" | ||||||
| # And similarly for branch "test-post-receive" (for use when testing). | # And similarly for branch "test-post-receive" (for use when testing). | ||||||
| def commit_notice_destination(repo, branch, commit): | def commit_notice_destination(repo, branch, commit): | ||||||
|     if branch in ["master", "prod", "test-post-receive"]: |     if branch in ["master", "prod", "test-post-receive"]: | ||||||
|         return dict(stream  = 'test' if 'test-' in branch else 'commits', |         return dict(stream  = 'test' if 'test-' in branch else 'commits', | ||||||
|                     subject = u"deploy \u21D2 %s" % (branch,)) |                     subject = u"%s" % (branch,)) | ||||||
|  |  | ||||||
|     # Return None for cases where you don't want a notice sent |     # Return None for cases where you don't want a notice sent | ||||||
|     return None |     return None | ||||||
|   | |||||||
| @@ -42,7 +42,7 @@ def send_deployment_finished_message(branch, message): | |||||||
|     subprocess.check_call(["/home/zulip/zulip/api/bin/zulip-send", "--user=commit-bot@zulip.com", |     subprocess.check_call(["/home/zulip/zulip/api/bin/zulip-send", "--user=commit-bot@zulip.com", | ||||||
|                            "--api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "--stream=commits", |                            "--api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "--stream=commits", | ||||||
|                            "--site=https://staging.zulip.com", |                            "--site=https://staging.zulip.com", | ||||||
|                            (u"--subject=deploy \u21D2 %s" % (branch,)).encode("utf-8"), "--message=%s" % (message,)]) |                            (u"--subject=%s" % (branch,)).encode("utf-8"), "--message=%s" % (message,)]) | ||||||
|  |  | ||||||
| deployments = { | deployments = { | ||||||
|     'refs/heads/prod': ('prod0.zulip.net', 'prod'), |     'refs/heads/prod': ('prod0.zulip.net', 'prod'), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user