On Wed, Apr 6, 2011 at 1:05 AM, David Weintraub <qazwart_at_gmail.com> wrote:
> On Tue, Apr 5, 2011 at 6:08 PM, San Martino <sanmrtn96_at_gmail.com> wrote:
>> we absolutely need to validate a project in the pre-commit trigger
>> with a build of the whole project being committed.
>>
>> Is this possible? Are there any tools allowing this?
>
> You can't really do it with a pre-commit script since the changes
> aren't part of the repository. (well, you can but it's a lot of work).
>
> The big problem is that your developers are sitting there twiddling
> their thumbs staring at a blank screen and unable to do any work while
> your application builds. Even a fast build takes a couple of minutes
> to complete.
>
> Your developers will hate Subversion, hate you, and hate their job.
> Well, they actually already may hate Subversion, you and their job,
> but this will make it even worse.
>
> May I recommend something like Jenkins? (http://jenkins-ci.org).
> Jenkins is a continuous build system that will do the build right
> after the developer does a commit. On a bad build, Jenkins can then
> mail the build results to the developer who did the commit and to the
> development team responsible for the project.
>
> Jenkins has a ton of plugins and can run unit tests, do deployments,
> run code check styles, coverage reports, you name it. It integrates
> with over 2 dozen defect tracking systems including Jira, and
> integrates with web-based version control browsers like Sventon,
> Fisheye, and ViewVC.
>
> Jenkins is webbased, but doesn't need Apache to run. It comes with its
> own application server built into the warfile. All you need is a JRE,
> and the Windows MSI file comes with that.
I also highly discourage performing builds in the pre-commit hook. It
will definitely take too long.
Another suggestion: we use IntelliJ IDEA (Java IDE) and TeamCity
(continuous build system). With this setup, there is a Teamcity
feature (which we can use from within the IDE) called "Pre-tested
commit". It allows you to perform a "remote build" on TeamCity with
your local changes integrated. If the build is successful, you can let
those changes be committed automatically (optionally, you can let it
ask you for confirmation first).
You can do this directly from a changed file or a changelist, or from
within the commit dialog. I have never used it myself, but I know it's
there :-). See here for more info:
http://confluence.jetbrains.net/display/TCD6/Pre-Tested+%28Delayed%29+Commit
I'm not sure if there is a way to enforce this centrally (as far as I
can see, it's up to the developer whether or not to perform a remote
build upon commit). But maybe it's good enough to have this as a
policy, and educate the developers to use this feature as standard
procedure ...
Cheers,
--
Johan
Received on 2011-04-06 13:58:35 CEST