github系のスクリプトっていうのはhubot-scriptで出てくるこういう
github-issue-link.coffee, github-issues.coffee, github-commits.coffee, github-pulls, など。
api のURLとかがgithub.comのと微妙に違ってはまった。
まずTOKENの作成はgithub enterpriseのドメインにapi/v3をつけたURLで行う(参考 )。
$ curl -i http://yourdomain/api/v3/authorizations -d '{"scopes":["repo"], "note":"説明を書いてね"}' -u "yourid"
{
"id": 1005,
"url": "http://yourdomain/api/v3/authorizations/1",
"app": {
"name": "test (API)",
"url": "https://developer.github.com/enterprise/2.0/v3/oauth_authorizations/",
"client_id": "00000000000000000000"
},
"token": "!!これがトークン!!",
"note": "test",
"note_url": null,
"created_at": "2015-01-30T04:18:54Z",
"updated_at": "2015-01-30T04:18:54Z",
"scopes": [
"repo"
]
}
返ってきたJSONのtokenをコピっとく。
HUBOTには以下の環境変数をセットする。
HUBOT_GITHUB_TOKEN="ここに返ってきたトークンを書いてね"
HUBOT_GITHUB_API="http://yourdomain/api/v3"