LoginSignup
9
9

More than 5 years have passed since last update.

hubot の github系のスクリプトをgithub enterprise で使う

Last updated at Posted at 2014-07-28

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"
9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9