LoginSignup
2
4

More than 5 years have passed since last update.

svnコミット時にSlackに投稿する

Last updated at Posted at 2017-05-31

svnコミット時にSlackに投稿する

hooks/post-commit に以下を記載

post-commit
#!/bin/bash

REPOS="$1"
REV="$2"
TXN_NAME="$3"
export LANG=ja_JP.utf8
AUTHOR=`svnlook author -r $REV $REPOS`
COMMENT=`svnlook log -r $REV $REPOS`

SHORTREPOS=`basename ${REPOS}`
TEXT="text="${SHORTREPOS}:${COMMENT}
USERNAME="username="${AUTHOR}
TOKEN="token=[取得したToken]"
CHANNEL="channel=[投稿したいチャンネル]"

curl -XPOST -d ${TOKEN} -d ${CHANNEL} -d "${TEXT}" -d 'as_user=false' -d ${USERNAME} 'https://slack.com/api/chat.postMessage'
2
4
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
2
4