0.9.4 • Published 10 years ago

hubot-github-tfs v0.9.4

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

Build Status

hubot-github-tfs

A Hubot script to integrate GitHub and Microsoft Team Foundation Server (TFS). You can now automatically trigger a TFS build following a push on a pull request and get the build result back.

Installation

  • In hubot project repo, run:

npm install hubot-github-tfs --save

  • Then add hubot-github-tfs to your external-scripts.json:
[
  "hubot-github-tfs"
]
  • Set the following environment variables in the shell where Hubot is running
VariableRequired/OptionalComments
HUBOT_TFS_SERVERrequiredIp or DNS name of the TFS server
HUBOT_TFS_USERNAMErequiredTFS username
HUBOT_TFS_PASSWORDrequiredPassword of the TFS user
HUBOT_TFS_GITHUB_PAToptionalPersonal Access Token of the GitHub user with repo:status permission. This will be used to update the pull request status.
HUBOT_TFS_PROTOCOLoptionaldefault to https
HUBOT_TFS_PORToptionaldefault to 80 for http and 443 for https
HUBOT_TFS_URL_PREFIXoptionaldefault to /
HUBOT_TFS_DEFAULT_COLLECTIONoptionaldefault to defaultcollection
  • Create a webhook on your GitHub repo for the Push event with the following URL :
http://<hubot_server>/hubot/github-tfs/build/<room>
  • Create a webhook on TFS with the following URL so Hubot can receive the notification back
http://<hubot_server>/hubot/github-tfs/build-result/<room>
  • Make sure the IIS server running TFS as basic authentication enabled.

Sample Interactions

Get some help

**user1**>> hubot tfs-build help
**hubot**>>Here's what I can do with TFS builds :
tfs-build list builds for <project>
tfs-build list builds for <project> from <collection>
tfs-build queue <project> with def=<definition id>
tfs-build queue <project> from <collection> with def=<definition id> branch=<branch name>
tfs-build list definitions for <project>
tfs-build list definitions for <project> from <collection>
tfs-build rem all
tfs-build rem about <org>/<repo>
tfs-build forget about <org>/<repo>
tfs-build rem <org>/<repo> builds with <project>/<definition id>
tfs-build rem <org>/<repo> builds with <project>/<definition id> from <collection>

List builds

**user1**>> hubot tfs-build list builds for SpidersFromMars
**hubot**>>
----------------------------------------------------------------------------------------
| Build       | Status   | Result  | Branch             | Definition                   |
----------------------------------------------------------------------------------------
|20160407.2   |completed |succeeded|master              |SpidersFromMars on github.com |
|20160407.1   |completed |failed   |master              |SpidersFromMars on github.com |
|20160331.19  |completed |succeeded|master              |SpidersFromMars on Octodemo   |
|20160331.18  |completed |failed   |master              |SpidersFromMars on Octodemo   |
|20160331.17  |completed |succeeded|syntaxerror         |SpidersFromMars on Octodemo   |
|20160331.16  |completed |failed   |synataxerror        |SpidersFromMars on Octodemo   |
----------------------------------------------------------------------------------------

List build definitions for a project

**user1**>> hubot tfs-build list definitions for SpidersFromMars
**hubot**>> Found 1 results for SpidersFromMars in
**hubot**>>
--------------------------------------
| ID  | Name                         |
--------------------------------------
|1    |SpidersFromMars on Octodemo   |
--------------------------------------

Remind me which build definition is used to automatically trigger the build of a repository

**user1**>> hubot tfs-build rem about OctoCheese/SpidersFromMars
**hubot**>> OctoCheese/SpidersFromMars builds with defaultcollection/SpidersFromMars/1

Automatically build in TFS following a push in GitHub

**user1**>> hubot tfs-build rem OctoCheese/SpidersFromMars builds with SpidersFromMars/1
**hubot**>> Saved build setting for SpidersFromMars. Now building with defaultcollection/SpidersFromMars/1

Note : The build definition id 1 was retrieved with the list definitions command

Whenever a push happens on this repo, Hubot will comment in the room specified in the webhook URL and trigger the registered build.

**hubot**>> @helaili just pushed code on OctoCheese/SpidersFromMars/testTFS. Requesting a TFS build with defaultcollection/SpidersFromMars/1
0.9.4

10 years ago

0.9.3

10 years ago

0.9.2

10 years ago

0.9.1

10 years ago

0.9.0

10 years ago

0.8.0

10 years ago

0.7.1

10 years ago

0.7.0

10 years ago

0.6.0

10 years ago

0.5.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.0

10 years ago