7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SlackからGitLabのChatopsを行う

Last updated at Posted at 2017-01-08

GitLab8.15 から、SlackからGitLabのChatops連携出来るようになったようです。
どんなものか試してみたかったので設定メモを残しておきます。1


Slack側の設定

ここ を開いて、自分のSlackチームに新規スラッシュコマンドを作ります。

コマンド名はお好きなものをどうぞ。プロジェクトごとに作るなら /<project_name>などとしておけばよいでしょう。

このページに Token 欄があるので、それをメモしておきます。
また、後ほどGitLabの設定を貼り付けるのでページは開いたままにしておきます。


GitLab側の設定

プロジェクト選択 > 設定 > Services > Slack Command を開きます。
スクリーンショット 2017-01-09 1.18.40.png


そしてこのページの URL 欄をコピーし、Slack側設定の URL にコピペします↓
スクリーンショット 2017-01-09 1.19.48.png


次に、先ほどメモしておいたSlackの Token を 今度はGitLab側設定の Token にコピペします。
そして最後に Active にチェックして保存。
スクリーンショット 2017-01-09 1.20.49.png

以上でchatops連携は終了です。簡単ですね。
初回のコマンド実行時にOAuthを要求されるのでAcceptすれば使えるようになります。


コマンドメモ

コマンドリストは /<command_name> help で確認できます。
現時点では以下のオペレーションが可能となっているようです。

  • /<command_name> issue show <id>
  • /<command_name> issue new <title> [⇧ Shift+↵ Enter] <description>
  • /<command_name> issue search <your query>
  • /<command_name> deploy <environment> to <target-environment>

issueの操作と、deployコマンドの実行が可能。
おそらく今後はもっとできることが増えていくでしょう。
設定もお手軽にできるので一度試してみてはいかがでしょうか


  1. 8.15.2では不具合があるらしく動作しませんでした。今回の動作確認は8.15.3で行っています

7
7
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
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?