beepd
beepd

Reputation: 291

Jenkins generate email when a user commits code in svn

I am new to Jenkins.

I have created a new free style project which is checked out from SVN.

My requirement is that (i) I want to generate an email whenever a user has checked in code in the SVN. (ii) The email should be in a proper format(Like html formatting)

I have just started using Jenkins today so let me tell you that i do not have much idea :)

Thanks

Upvotes: 2

Views: 1130

Answers (1)

hek2mgl
hek2mgl

Reputation: 158080

If you want to send an email, every time a commit happens in svn, then I would solve this in svn. Use a post commit hook for this

If you want to send an email each time a build in jenkins happens, add the mail command to your ant build script, build.xml. There is a special Mail task for this.

You may say that it does not matter whether the email is sent on svn commit or on jenkins build. But this is not exactly true: Normally you configure jenkins in a way that it polls svn for new commits, let's say every 30 minutes. If new commits happened jenkins will trigger the build script to run. But note that in 30 minutes more than 1 commit could happen. Therefore you'll have to decide if you want to send a email on every commit or every build:

On every build : use a special ant task in your build.xml

On every commit : use a svn post-commit hook

Upvotes: 1

Related Questions