Hudson, Gerrit Trigger Configuration

1,003 views
Skip to first unread message

Lazo Apostolovski

unread,
Feb 1, 2012, 8:22:12 AM2/1/12
to repo-d...@googlegroups.com
Hello there,

I Want to configure hudson to checkout not submitted patch set, try to build it and if fails to put -1 validation and of build +1.

I follow this tutorials:
but still cant make it work,

Gerrit trigger plugin is configured ok (Test connection result with success)

At the moment, its not working at all. I do not have any scripts. Do i need scripts? My project is build with mvn clean install and nothing else.

How many jobs need to be configured? How to configure them? What references need to be places? What build strategy? How can I test it if works or not?

Edwin Kempin

unread,
Feb 1, 2012, 8:40:21 AM2/1/12
to repo-d...@googlegroups.com
You don't need any scripts for this, just one build job that uses the Gerrit Trigger Plugin should be enough.
In your job configuration, have you done the configuration steps described on [1] under the section 'Usage with the Git Plugin'?
How did you trigger the build? Please note that the 'Build Now' link is NOT working as the job then doesn't know for which Gerrit change the build should run.
To test the Gerrit Trigger build job, simply push a change for your project to Gerrit for code review, the build job should then start automatically.

[1] https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger

2012/2/1 Lazo Apostolovski <lapost...@tricode.nl>

Lazo Apostolovski

unread,
Feb 16, 2012, 3:01:51 AM2/16/12
to repo-d...@googlegroups.com
Hi list :)

I think that Gerrit plugin should take patch before it get merget, Run it to see if compile and tests are passing. Also give to patch Validate +1 and +1 if tests pass or -1 if not compile and -1 if tests are not passing.
Thanks to Edwin response I configure gerrit and start working, but it always gives me Validate +1. Even if not compile or if tests fails.

This is my current gerrit trigger configuration:

Verify
Started: 0
Successfull: 1
Failed: -1
Unstable: 0

Code Review
Started: 0
Successful: 0
Failed: -1
Unstable: -1

Is this configuration correct? What else need to be configured? Do i need something in git Source Code Management Configuration? Merge after checkout or something? What I missing?

Thank you.

Emmanuel Grumbach

unread,
Feb 16, 2012, 4:36:38 AM2/16/12
to Lazo Apostolovski, repo-d...@googlegroups.com
You probably need to exit with an error code (not 0) when you want to fail your build

Emmanuel Grumbach
egru...@gmail.com


--

Lazo Apostolovski

unread,
Feb 16, 2012, 4:40:48 AM2/16/12
to repo-d...@googlegroups.com, Lazo Apostolovski
Thx but i already try to set up -1 on Unstable but result is same...

Do i need to configure some to merge in git scm? Do i need to write shell script for building?

Emmanuel Grumbach

unread,
Feb 16, 2012, 4:45:47 AM2/16/12
to Lazo Apostolovski, repo-d...@googlegroups.com
I am not talking about the gerrit trigger configuration. I am talking about the job configuration.

Did you add a step in the build ?
You need to add a step that compiles the code
Then the compilation will fail and fail the build

Emmanuel Grumbach
egru...@gmail.com


On Thu, Feb 16, 2012 at 11:40, Lazo Apostolovski <lapost...@tricode.nl> wrote:
Thx but i already try to set up -1 on Unstable but result is same...

Do i need to configure some to merge in git scm? Do i need to write shell script for building?

--

Lazo Apostolovski

unread,
Feb 16, 2012, 5:24:06 AM2/16/12
to repo-d...@googlegroups.com, Lazo Apostolovski
ohhh true... use wrong build configuration....

Thank you Emmanuel
Reply all
Reply to author
Forward
0 new messages