Parameter | Required/Optional | Description |
---|---|---|
api_version | Required | A string that matches the API version this document is for. |
source_association_key | Required | A key generated by TeamForge EventQ that links incoming commit messages with the appropriate source server. |
Example: "source_association_key": "31e8dd90-164f-0130-c4d0-406c8f04c05d" | ||
commit_data | Required | The commit. |
Field | Required/Optional | Description |
---|---|---|
repo_id | Optional | A unique identifier for this repository. For example, the repo UUID. |
revision_id | Required | A unique identifier for the commit action (eg., revision number or commit id). |
branch_name | Optional | Identifier for the applicable repository branch. |
type | Required | A string representing the activity type. |
Accepted values post-commit - A commit has been completed. |
||
message | Optional | The message associated with this activity. |
changes | Optional | An array of changed items. Required information about affected paths (an array of hashes). |
Accepted values
|
||
event_time | Required | A string containing a timestamp in UTC timezone and RFC 3339 format. |
created_by | Required | The user name of the person who took the action. |
The following code examples are Copyright 2020 CollabNet, Inc., licensed under the Apache License, Version 2.0 (the "License"); you may not use this code except in compliance with the License. You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0]
{ "api_version": "1", "source_association_key" : "150e8951-19e1-4066-8b74-601026dd6cde", "commit_data" : { "repo_id": "390e8951-19e1-4066-8b74-601026dd6cde", "revision_id": "2315", "branch_name": "master", "type": "post_commit", "message": "here's my commit [orc-277]", "changes": [ { "path": "/source/file/1", "action": "modified" }, { "path": "/source/file/2", "action": "added" }, { "path": "/source/file/3", "action": "deleted" }, { "path": "/source/file/4", "action": "modified" }, { "path": "/source/file/4", "action": "props_modified" } ], "event_time": "2012-10-02T17:15:32.320Z", "created_by": "username" } }
require 'amqp' QUEUE = 'eventq.commits' COMMIT = '{ "api_version": "1", "source_association_key" : "150e8951-19e1-4066-8b74-601026dd6cde", "commit_data" : { "repo_id": "390e8951-19e1-4066-8b74-601026dd6cde", "revision_id": "2315", "branch_name": "master", "type": "post_commit", "message": "here\'s my commit [orc-277]", "changes": [ { "path": "/source/file/1", "action": "modified" }, { "path": "/source/file/2", "action": "added" }, { "path": "/source/file/3", "action": "deleted" }, { "path": "/source/file/4", "action": "modified" }, { "path": "/source/file/4", "action": "props_modified" } ], "event_time": "2012-10-02T17:15:32.320Z", "created_by": "username" } }' # Event loop EventMachine.run do connection = AMQP.connect('amqp://guest:guest@example-mq') # Set up our RabbitMQ information channel = AMQP::Channel.new(connection) queue = channel.queue(QUEUE, :auto_delete => false, durable: true) exchange = channel.direct('') # Publish the activity and exit the loop exchange.publish COMMIT, :routing_key => queue.name do connection.disconnect {EventMachine.stop} end end