auto building upon change to repo

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

auto building upon change to repo

Ben Mills
Hello,

Running Hudson v1.99 on Linux and SVN as the repo.  
Looking to perform builds whenever someone makes a change in the repository, and so I have added the following line to /repository/cvsroot/CVSROOT/loginfo

/usr/bin/wget -o /dev/null http://<ip_address>:8080/job/<project_name>/build

Note: I don't need /hudson in the link as I installed in Tomcat v5.5.23 by deleting everything in ${CATALINA_HOME}/webapps and renaming hudson.war to ROOT.war.

Questions:

1) How can I control this on a per-project basis?  I would think the entry (above) would cause Hudson to build <project_name> whenever any change in any project is committed.  

2) Do I need to call wget in logfile for each project?

3) Do you happen to know what I need to do to initialize the change to loginfo?  Just restart init?

Thank you.



Reply | Threaded
Open this post in threaded view
|

Re: auto building upon change to repo

Manuel Darveau
On 4/24/07, Ben Mills <[hidden email]> wrote:
> Running Hudson v1.99 on Linux and SVN as the repo.

Hum... I guess you means CVS?

> 1) How can I control this on a per-project basis?  I would think the entry
> (above) would cause Hudson to build <project_name> whenever any change in
> any project is committed.

From loginfo: "The first entry on a line is a regular expression which
must match the directory that the change is being made to, relative to
the $CVSROOT."
So for example, if you want hudson to build when a commit is done in
project "toto", you can add:

^toto /usr/bin/wget -o /dev/null http://xxx.xxx.xxx.xxx:8080/job/toto/build

> 2) Do I need to call wget in logfile for each project?

I am not sure what you mean but I think the answer is yes since the
project name is part of the URL you access with wget...

> 3) Do you happen to know what I need to do to initialize the change to
> loginfo?  Just restart init?

Did you changed loginfo directly on the server or via a checkout of
the CVSROOT module?
If you did a checkout, the cvs server will read the file and you dont
have anything to do (check the cvs output when you commit the loginfo
file...).
If you modified the file directly on the server, I don't know if you
have to do something but dont do that. I strongly recommend to edit
loginfo using a CVSROOT checkout since the changes will be tracked and
if someone change the file using a checkout, your changes on the
server wont be lost.

Hope it helps...

Manuel

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: auto building upon change to repo

Ben Mills
Thank you - responses are inline below...

On Apr 24, 2007, at 6:02 PM, Manuel Darveau wrote:

On 4/24/07, Ben Mills <[hidden email]> wrote:
Running Hudson v1.99 on Linux and SVN as the repo.

Hum... I guess you means CVS?

Well no, I mean Subversion but they are somewhat similar.

1) How can I control this on a per-project basis?  I would think the entry
(above) would cause Hudson to build <project_name> whenever any change in
any project is committed.

From loginfo: "The first entry on a line is a regular expression which
must match the directory that the change is being made to, relative to
the $CVSROOT."
So for example, if you want hudson to build when a commit is done in
project "toto", you can add:

^toto /usr/bin/wget -o /dev/null http://xxx.xxx.xxx.xxx:8080/job/toto/build

Right yes, understood, thanks.

2) Do I need to call wget in logfile for each project?

I am not sure what you mean but I think the answer is yes since the
project name is part of the URL you access with wget...

3) Do you happen to know what I need to do to initialize the change to
loginfo?  Just restart init?

Did you changed loginfo directly on the server or via a checkout of
the CVSROOT module?
If you did a checkout, the cvs server will read the file and you dont
have anything to do (check the cvs output when you commit the loginfo
file...).
If you modified the file directly on the server, I don't know if you
have to do something but dont do that. I strongly recommend to edit
loginfo using a CVSROOT checkout since the changes will be tracked and
if someone change the file using a checkout, your changes on the
server wont be lost.

I did not checkout, but your advice is understood and appreciated :)

Hope it helps...

Very much, thanks.

Manuel

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: auto building upon change to repo

Kohsuke Kawaguchi
Administrator
In reply to this post by Ben Mills
There has been some discussion of improving this. Instead of having
loginfo figure out which project to build, define one URL that can be
called from any change, then have Hudson figure out which projects map
to changed files. Something like that might be useful.

What I'm doing on my production system is to do this over e-mail system.

Most projects do set up some sort of e-mail notification for
developers. So I have set up my Hudson server so that e-mails to
hudson-<jobname>@myhudsonhost triggers the build of that project. I
use qmail and a little script to do this, and I don't need to do
anything when a new job is added. It handles all
hudson-*@hmyhudsonhost.

This is environment dependent, but maybe something like this should go
into the documentation.

2007/4/24, Ben Mills <[hidden email]>:

> Hello,
>
> Running Hudson v1.99 on Linux and SVN as the repo.
> Looking to perform builds whenever someone makes a change in the repository,
> and so I have added the following line to
> /repository/cvsroot/CVSROOT/loginfo
>
> /usr/bin/wget -o /dev/null
> http://<ip_address>:8080/job/<project_name>/build
>
> Note: I don't need /hudson in the link as I installed in Tomcat v5.5.23 by
> deleting everything in ${CATALINA_HOME}/webapps and renaming hudson.war to
> ROOT.war.
>
> Questions:
>
> 1) How can I control this on a per-project basis?  I would think the entry
> (above) would cause Hudson to build <project_name> whenever any change in
> any project is committed.
>
> 2) Do I need to call wget in logfile for each project?
>
> 3) Do you happen to know what I need to do to initialize the change to
> loginfo?  Just restart init?
>
> Thank you.
>
>
>
>
>


--
Kohsuke Kawaguchi

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: auto building upon change to repo

Ben Mills
Yes, that sounds good (email-driven setup and updated documentation
with a note about environment dependance).

I am currently setting up a post-commit hook in Subversion.  The
script should be small and I can have one for each project.  I think
I can still use the syntax your documentation already provides?

/usr/bin/wget -o /dev/null http://<ip_address>:8080/job/
<project_name>/build

I may try out your qmail + script setup (using sendmail) as well.
Thanks.

On Apr 25, 2007, at 11:15 AM, Kohsuke Kawaguchi wrote:

> There has been some discussion of improving this. Instead of having
> loginfo figure out which project to build, define one URL that can be
> called from any change, then have Hudson figure out which projects map
> to changed files. Something like that might be useful.
>
> What I'm doing on my production system is to do this over e-mail  
> system.
>
> Most projects do set up some sort of e-mail notification for
> developers. So I have set up my Hudson server so that e-mails to
> hudson-<jobname>@myhudsonhost triggers the build of that project. I
> use qmail and a little script to do this, and I don't need to do
> anything when a new job is added. It handles all
> hudson-*@hmyhudsonhost.
>
> This is environment dependent, but maybe something like this should go
> into the documentation.
>
> 2007/4/24, Ben Mills <[hidden email]>:
>> Hello,
>>
>> Running Hudson v1.99 on Linux and SVN as the repo.
>> Looking to perform builds whenever someone makes a change in the  
>> repository,
>> and so I have added the following line to
>> /repository/cvsroot/CVSROOT/loginfo
>>
>> /usr/bin/wget -o /dev/null
>> http://<ip_address>:8080/job/<project_name>/build
>>
>> Note: I don't need /hudson in the link as I installed in Tomcat  
>> v5.5.23 by
>> deleting everything in ${CATALINA_HOME}/webapps and renaming  
>> hudson.war to
>> ROOT.war.
>>
>> Questions:
>>
>> 1) How can I control this on a per-project basis?  I would think  
>> the entry
>> (above) would cause Hudson to build <project_name> whenever any  
>> change in
>> any project is committed.
>>
>> 2) Do I need to call wget in logfile for each project?
>>
>> 3) Do you happen to know what I need to do to initialize the  
>> change to
>> loginfo?  Just restart init?
>>
>> Thank you.
>>
>>
>>
>>
>>
>
>
> --
> Kohsuke Kawaguchi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: auto building upon change to repo

Kohsuke Kawaguchi
Administrator
Yes. I think wget approach is totally adequate until the # of projects
get too many.

2007/4/25, Ben Mills <[hidden email]>:

> Yes, that sounds good (email-driven setup and updated documentation
> with a note about environment dependance).
>
> I am currently setting up a post-commit hook in Subversion.  The
> script should be small and I can have one for each project.  I think
> I can still use the syntax your documentation already provides?
>
> /usr/bin/wget -o /dev/null http://<ip_address>:8080/job/
> <project_name>/build
>
> I may try out your qmail + script setup (using sendmail) as well.
> Thanks.
>
> On Apr 25, 2007, at 11:15 AM, Kohsuke Kawaguchi wrote:
>
> > There has been some discussion of improving this. Instead of having
> > loginfo figure out which project to build, define one URL that can be
> > called from any change, then have Hudson figure out which projects map
> > to changed files. Something like that might be useful.
> >
> > What I'm doing on my production system is to do this over e-mail
> > system.
> >
> > Most projects do set up some sort of e-mail notification for
> > developers. So I have set up my Hudson server so that e-mails to
> > hudson-<jobname>@myhudsonhost triggers the build of that project. I
> > use qmail and a little script to do this, and I don't need to do
> > anything when a new job is added. It handles all
> > hudson-*@hmyhudsonhost.
> >
> > This is environment dependent, but maybe something like this should go
> > into the documentation.
> >
> > 2007/4/24, Ben Mills <[hidden email]>:
> >> Hello,
> >>
> >> Running Hudson v1.99 on Linux and SVN as the repo.
> >> Looking to perform builds whenever someone makes a change in the
> >> repository,
> >> and so I have added the following line to
> >> /repository/cvsroot/CVSROOT/loginfo
> >>
> >> /usr/bin/wget -o /dev/null
> >> http://<ip_address>:8080/job/<project_name>/build
> >>
> >> Note: I don't need /hudson in the link as I installed in Tomcat
> >> v5.5.23 by
> >> deleting everything in ${CATALINA_HOME}/webapps and renaming
> >> hudson.war to
> >> ROOT.war.
> >>
> >> Questions:
> >>
> >> 1) How can I control this on a per-project basis?  I would think
> >> the entry
> >> (above) would cause Hudson to build <project_name> whenever any
> >> change in
> >> any project is committed.
> >>
> >> 2) Do I need to call wget in logfile for each project?
> >>
> >> 3) Do you happen to know what I need to do to initialize the
> >> change to
> >> loginfo?  Just restart init?
> >>
> >> Thank you.
> >>
> >>
> >>
> >>
> >>
> >
> >
> > --
> > Kohsuke Kawaguchi
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Kohsuke Kawaguchi

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: auto building upon change to repo

Ben Mills
Apologies for asking an unrelated question on this thread...
How can I configure Hudson to send a notification email for all build  
results (including success even after the last build for a given  
project was successful).
This would be a help during our evaluation.
Thanks,

On Apr 25, 2007, at 11:48 AM, Kohsuke Kawaguchi wrote:

> Yes. I think wget approach is totally adequate until the # of projects
> get too many.
>
> 2007/4/25, Ben Mills <[hidden email]>:
>> Yes, that sounds good (email-driven setup and updated documentation
>> with a note about environment dependance).
>>
>> I am currently setting up a post-commit hook in Subversion.  The
>> script should be small and I can have one for each project.  I think
>> I can still use the syntax your documentation already provides?
>>
>> /usr/bin/wget -o /dev/null http://<ip_address>:8080/job/
>> <project_name>/build
>>
>> I may try out your qmail + script setup (using sendmail) as well.
>> Thanks.
>>
>> On Apr 25, 2007, at 11:15 AM, Kohsuke Kawaguchi wrote:
>>
>> > There has been some discussion of improving this. Instead of having
>> > loginfo figure out which project to build, define one URL that  
>> can be
>> > called from any change, then have Hudson figure out which  
>> projects map
>> > to changed files. Something like that might be useful.
>> >
>> > What I'm doing on my production system is to do this over e-mail
>> > system.
>> >
>> > Most projects do set up some sort of e-mail notification for
>> > developers. So I have set up my Hudson server so that e-mails to
>> > hudson-<jobname>@myhudsonhost triggers the build of that project. I
>> > use qmail and a little script to do this, and I don't need to do
>> > anything when a new job is added. It handles all
>> > hudson-*@hmyhudsonhost.
>> >
>> > This is environment dependent, but maybe something like this  
>> should go
>> > into the documentation.
>> >
>> > 2007/4/24, Ben Mills <[hidden email]>:
>> >> Hello,
>> >>
>> >> Running Hudson v1.99 on Linux and SVN as the repo.
>> >> Looking to perform builds whenever someone makes a change in the
>> >> repository,
>> >> and so I have added the following line to
>> >> /repository/cvsroot/CVSROOT/loginfo
>> >>
>> >> /usr/bin/wget -o /dev/null
>> >> http://<ip_address>:8080/job/<project_name>/build
>> >>
>> >> Note: I don't need /hudson in the link as I installed in Tomcat
>> >> v5.5.23 by
>> >> deleting everything in ${CATALINA_HOME}/webapps and renaming
>> >> hudson.war to
>> >> ROOT.war.
>> >>
>> >> Questions:
>> >>
>> >> 1) How can I control this on a per-project basis?  I would think
>> >> the entry
>> >> (above) would cause Hudson to build <project_name> whenever any
>> >> change in
>> >> any project is committed.
>> >>
>> >> 2) Do I need to call wget in logfile for each project?
>> >>
>> >> 3) Do you happen to know what I need to do to initialize the
>> >> change to
>> >> loginfo?  Just restart init?
>> >>
>> >> Thank you.
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>> > --
>> > Kohsuke Kawaguchi
>> >
>> >  
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [hidden email]
>> > For additional commands, e-mail: [hidden email]
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> --
> Kohsuke Kawaguchi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: auto building upon change to repo

Kohsuke Kawaguchi
Administrator
Ben Mills wrote:
> Apologies for asking an unrelated question on this thread...
> How can I configure Hudson to send a notification email for all build  
> results (including success even after the last build for a given  
> project was successful).
> This would be a help during our evaluation.

There's an RFE filed for this. I'd like to refactor the e-mail
notification to smaller pieces that are individually pluggable.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: auto building upon change to repo

Ben Mills


On Apr 26, 2007, at 12:24 PM, Kohsuke Kawaguchi wrote:

Ben Mills wrote:
Apologies for asking an unrelated question on this thread...
How can I configure Hudson to send a notification email for all build  results (including success even after the last build for a given  project was successful).
This would be a help during our evaluation.

There's an RFE filed for this. I'd like to refactor the e-mail notification to smaller pieces that are individually pluggable.

Sounds good - thank you.
-- 
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]