Skip to content

Instantly share code, notes, and snippets.

@emanon001
Last active December 12, 2015 04:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emanon001/4713144 to your computer and use it in GitHub Desktop.
Save emanon001/4713144 to your computer and use it in GitHub Desktop.
Jenkins の SVN Plugin 用の post-commit ファイル。
#!/bin/bash
REPOS="$1"
REV="$2"
UUID=$(svnlook uuid $REPOS)
# 適宜設定
JENKINS_HOME=http://localhost:8080
svnlook changed --revision $REV $REPOS | /usr/bin/curl \
-H "Content-Type:text/plain;charset=UTF-8" \
-d @- \
$JENKINS_HOME/subversion/$UUID/notifyCommit?rev=$REV
@emanon001
Copy link
Author

あるリビジョンで大量のファイルが追加 / 変更された場合に、svnlook changed の戻り値が恐しく長い文字列になり、cURL の実行に失敗することがある。なので、一度ファイルに吐き出してから、読み出している。

@emanon001
Copy link
Author

パイプで繋いで、@- で標準入力から読み出す作戦に変更。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment