19
25

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.

svnコミットのタイミングでJenkinsでビルドする

Posted at

curlでJobの起動を確認

参考: http://blog.kyanny.me/entry/2014/12/20/020700

上記のページを参考に以下のようにcurlでjenkinsのURLを叩く

$ curl -X POST -u user:api_token http://jenkins.example.com/JOB_NAME/build

Jenkins側でビルドが実行されたら疎通確認完了。

svn サーバに post-commit フックスクリプトを仕込む

次に、svnサーバ側に post-commit フックスクリプトを仕込む。

$ cd path/to/repos/hook    #リポジトリの格納場所に移動
$ vi post-commit

post-commit の中身には以下のように記述

user={USER}
api_token={USER_API_TOKEN}
job={JOB_NAME}

curl -X POST -u $user:$api_token http://{JENKINS_HOST:PORT}/job/$job/build

{...} の部分は環境に応じて適宜置き換え

これで準備完了。

あとは、svn commit して Jenkins でビルドが実行されたらOK

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?