Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
8
Help us understand the problem. What is going on with this article?
@fakestarbaby

Engine Yard Cloud へデプロイした事を HipChat へ通知したい!

More than 5 years have passed since last update.

以下のように、デプロイをフックするスクリプトを用意して、リポジトリに commit & push しておくだけです。

  • AUTH_TOKENROOM_ID は自分の環境に合わせて変更して下さい。
/deploy/after_restart.rb
require 'open-uri'

auth_token = 'AUTH_TOKEN'
room_id    = 'ROOM_ID'
from       = 'Engine Yard'
color      = 'purple'
notify     = 1
message    = "#{deployed_by} deployed a new version of #{app}: #{environment_name} (#{revision[0...6]})."

`curl -d "auth_token=#{auth_token}&room_id=#{room_id}&from=#{from}&color=#{color}&notify=#{notify}&message=#{message}" https://api.hipchat.com/v1/rooms/message`

利用可能な変数

スクリプトで利用可能な変数一覧は、以下のページに掲載されているので、
通知するメッセージは自由にカスタマイズする事が可能です。

HipChat の通知 API

API の詳細は、以下のページに掲載されています。

あわせて読みたい

8
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
fakestarbaby
嫁と娘(7歳)と息子(4歳)を愛するパパエンジニア Unity, C#, CoronaSDK, Lua, Ruby, Rails

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
8
Help us understand the problem. What is going on with this article?