Travis CI と統合する
この記事では、Jira Service Management Cloud の一部のお客様に段階的に展開されている、Jira Service Management でネイティブに利用できる新しいアラート機能を取り上げています。ご利用のサイトにはまだ表示されていないか、利用できない可能性があります。
統合でできるようになること
Jira Service Management の Travis CI 統合を使用して、Travis CI アラートを Jira Service Management に転送します。Jira Service Management はこれらのアラートのディスパッチャーとして機能し、オンコール スケジュールに基づいて通知する適切な担当者を決定します。メール、テキスト メッセージ (SMS)、電話、iPhone や Android のプッシュ通知による通知を行い、アラートが承認またはクローズされるまでアラートをエスカレーションします。
統合による機能
Travis CI でプロジェクトのステータスが failing、broken、または errored になった場合、統合を通じて Jira Service Management でアラートが自動的に作成されます。
Travis CI でステータスが passed または fixed になると、Jira Service Management でアラートがクローズされます。
統合をセットアップする
Travis CI は API 統合です。次の手順でセットアップを行います。
Jira Service Management で Travis CI 統合を追加する
Travis CI で統合を設定する
Travis CI 統合を追加する
Bidirectional integrations aren’t supported in Free and Standard plans. All the other integrations are supported at a team level in Free and Standard; however, for their outgoing part to work, you need to upgrade to a higher plan. To add any integration at a site level through Settings
(gear icon) > Products
(under JIRA SETTINGS) > OPERATIONS
, you need to be either on Premium or Enterprise.
統合をチームの運用ページから追加すると、そのチームが統合の所有者になります。つまり、Jira Service Management は、この統合を通じて受信したアラートをチームにのみ割り当てます。
Jira Service Management で Travis CI 統合を追加するには、次の手順に従います。
チームの運用ページに移動します。
左側のナビゲーション パネルで、[統合] > [統合を追加] の順に選択します。
検索を実行して「Travis CI」を選択します。
次の画面で、統合の名前を入力します。
オプション: 特定のチームが統合からのアラートを受信するようにする場合は、[Assignee team (担当者チーム)] のチームを選択します。
[Continue] を選択します。
この時点で、統合が保存されます。[統合を設定する手順] セクションを展開して Webhook URL をコピーします。
このキーは、後ほど Travis CI で統合を設定する際に使用します。[統合をオンにする] を選択します。
統合のために作成したルールは、統合をオンにした場合にのみ機能します。
Travis CI で統合を設定する
Travis CI と Jira Service Management の統合を設定するには、次の手順に従います。
モニタリングする GitHub リポジトリを選択して、GitHub で Travis CI のサービス フックを有効にします。
.tracvis.yml ファイルをリポジトリに追加します。
.travis.yml ファイルに次の設定を追加します。
notifications:
webhooks: <webhook-url>
先ほどコピーした Webhook URL を [webhooks] に貼り付けます。
.travis.yml ファイルをリポジトリのルートにコミットします。
ペイロードの例
The requestbin.com URL in the following payload can be generated from RequestBin.com. You can use the service to create a free HTTPS endpoint. Any HTTP requests sent to that endpoint will be recorded with the associated payload and headers so you can observe the data sent from our webhooks before configuring your application to accept it.
JSON
{
"id": 17413947,
"repository": {
"id": 1797493,
"name": "travisci",
"owner_name": "halixxxxxx",
"url": "https://github.com/xxxxxxx/travisci"
},
"number": "16",
"config": {
"language": "java",
"jdk": [
"oraclejdk7",
"openjdk7",
"openjdk6"
],
"notifications": {
"webhooks": [
"https://[YOUR ENDPOINT ID].x.requestbin.com"
],
"on_start": true
},
".result": "configured"
},
"status": 1,
"result": 1,
"status_message": "Still Failing",
"result_message": "Still Failing",
"started_at": "2014-01-22T14:56:52Z",
"finished_at": "2014-01-22T14:57:50Z",
"duration": 53,
"build_url": "https://travis-ci.org/halixxxx/travisci/builds/17413947",
"commit": "b3e6b383453467613cfdab20a6ec2a80c9cb2867",
"branch": "master",
"message": "ddaax",
"compare_url": "https://github.com/halixxxx/travisci/compare/59b70385cf7e...b3e6b3834534",
"committed_at": "2014-01-22T14:56:29Z",
"author_name": "halit",
"author_email": "sistani@mail.com",
"committer_name": "sistani",
"committer_email": "sistani@mail.como"
}
Close
この内容はお役に立ちましたか?