LoginSignup
0

More than 5 years have passed since last update.

JenkinsのSlack通知にgit logの情報を出力する (Groovyスクリプト編)

Posted at

Jenkinsのデプロイ完了をSlackに通知している方も多いと思います。

今回は、その通知メッセージにgit logの内容を出力する方法を紹介します。
といっても、単にコマンド実行結果を出力する方法なんですが。

Groovyスクリプトで、

def output = sh returnStdout: true, script: 'git log --stat -1'

とすると、コマンドの実行結果がoutputに保存されます。
これを、Slackへの出力メッセージに追加するだけです。

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
0