Quantcast

SVN Post commit script

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SVN Post commit script

Fafou31-2
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Michael Donohue
I find polling to be a more self contained way of handling builds - you will never have a skew between your polling logic and your checkout because they are configured by the same string in Hudson.   If you use SVN hooks, you have to make sure you keep the hooks correctly correlated with the Hudson job names.

-Michael

On Fri, Jun 12, 2009 at 9:23 AM, Fabrice Mercier <[hidden email]> wrote:
Hi

I am trying to migrate my company from CVS to SVN and to change build strategy from polling to SVN hooks

Hard to me to write a well complete post-commit hook to run a build. I have difficulties to get information, PROJECT_NAME, BRANCH

It will be very useful to give in the hudson wiki the post-commit hook.

Here my incomplete script that does not work because it does not know the project name commited :

REPOS="$1"
REV="$2"

HUDSON_URL="http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB"

oldIFS=$IFS
IFS="/"
Array=( $REPOS )
IFS=$oldIFS
LastElementIndex=${#Array[@]}-1

ProjectName=${Array[$LastElementIndex]}
HUDSON_URL=$( echo "$HUDSON_URL" | sed s/#PROJECT#/$ProjectName/g )

echo $REPOS >> /tmp/commit.txt

/usr/bin/wget -o /dev/null "$HUDSON_URL"



could you help me please ?


--
Cordialement / Best regards

Fabrice Mercier

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Ken Liu
Is there a reason you are avoiding the polling? I have done it this way for many years in several different companies and find that it works well. It is the default strategy in Hudson.
 
Ken

On Fri, Jun 12, 2009 at 9:50 AM, Michael Donohue <[hidden email]> wrote:
I find polling to be a more self contained way of handling builds - you will never have a skew between your polling logic and your checkout because they are configured by the same string in Hudson.   If you use SVN hooks, you have to make sure you keep the hooks correctly correlated with the Hudson job names.

-Michael

On Fri, Jun 12, 2009 at 9:23 AM, Fabrice Mercier <[hidden email]> wrote:
Hi

I am trying to migrate my company from CVS to SVN and to change build strategy from polling to SVN hooks

Hard to me to write a well complete post-commit hook to run a build. I have difficulties to get information, PROJECT_NAME, BRANCH

It will be very useful to give in the hudson wiki the post-commit hook.

Here my incomplete script that does not work because it does not know the project name commited :

REPOS="$1"
REV="$2"

HUDSON_URL="http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB"

oldIFS=$IFS
IFS="/"
Array=( $REPOS )
IFS=$oldIFS
LastElementIndex=${#Array[@]}-1

ProjectName=${Array[$LastElementIndex]}
HUDSON_URL=$( echo "$HUDSON_URL" | sed s/#PROJECT#/$ProjectName/g )

echo $REPOS >> /tmp/commit.txt

/usr/bin/wget -o /dev/null "$HUDSON_URL"



could you help me please ?


--
Cordialement / Best regards

Fabrice Mercier


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Fafou31-2
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Aleksandar Kostadinov
Polling on SVN is far less expensive than CVS.So you can just try
migrate first, then see if polling is working good enough.

Fabrice Mercier wrote, On 06/15/2009 09:21 AM (EEST):

> Yes I have more 500 jobs and even If I configured Hudson for limit //
> number of polling every 5 minutes but it is not enough.
> I had to upgrade my hudson server for a more powerfull physical
> configuration but now it is CVS that has some strange comportment and
> must support heavy loading.
>
> I think it is more optimized to hook SCM commit to Hudson builds. You
> consume lot of resources to poll projects that do not change.
>
> Force users to name job corretly is not a problem, it is just a new
> company recommandation.
>
> 2009/6/12 Ken Liu <[hidden email] <mailto:[hidden email]>>
>
>     Is there a reason you are avoiding the polling? I have done it this
>     way for many years in several different companies and find that it
>     works well. It is the default strategy in Hudson.
>      
>     Ken
>
>     On Fri, Jun 12, 2009 at 9:50 AM, Michael Donohue
>     <[hidden email] <mailto:[hidden email]>> wrote:
>
>         I find polling to be a more self contained way of handling
>         builds - you will never have a skew between your polling logic
>         and your checkout because they are configured by the same string
>         in Hudson.   If you use SVN hooks, you have to make sure you
>         keep the hooks correctly correlated with the Hudson job names.
>
>         -Michael
>
>         On Fri, Jun 12, 2009 at 9:23 AM, Fabrice Mercier
>         <[hidden email] <mailto:[hidden email]>> wrote:
>
>             Hi
>
>             I am trying to migrate my company from CVS to SVN and to
>             change build strategy from polling to SVN hooks
>
>             Hard to me to write a well complete post-commit hook to run
>             a build. I have difficulties to get information,
>             PROJECT_NAME, BRANCH
>
>             *It will be very useful to give in the hudson wiki the
>             post-commit hook.*
>
>             Here my incomplete script that does not work because it does
>             not know the project name commited :
>
>             REPOS="$1"
>             REV="$2"
>
>             HUDSON_URL="<a href="http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB">http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB
>             <http://tl-em-1:8080/hudson/#PROJECT%23/build?token=BUILD_ALMERYS_JOB>"
>
>             oldIFS=$IFS
>             IFS="/"
>             Array=( $REPOS )
>             IFS=$oldIFS
>             LastElementIndex=${#Array[@]}-1
>
>             ProjectName=${Array[$LastElementIndex]}
>             HUDSON_URL=$( echo "$HUDSON_URL" | sed
>             s/#PROJECT#/$ProjectName/g )
>
>             echo $REPOS >> /tmp/commit.txt
>
>             /usr/bin/wget -o /dev/null "$HUDSON_URL"
>
>
>
>             could you help me please ?
>
>
>             --
>             Cordialement / Best regards
>
>             Fabrice Mercier
>
>
>
>
>
>
> --
> Cordialement / Best regards
>
> Fabrice Mercier

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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Fafou31-2
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Jesper Eskilson-2
Fabrice Mercier wrote:
> Do you have some argument ? (bench)
> SVN update is more optimized than cvs update ?

They are based on completely different algorithms. cvs update time is
proportional to the number of files in the tree, since the cvs tree
needs to visit all the files on disk to see if there are any changes.
svn update can run in time proportional to roughly the number of changes
retrieved.

--
/Jesper



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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Fafou31-2
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Jesper Eskilson-2
Fabrice Mercier wrote:
> Ok it could be similar to a
> find / -name "toto"
> and
> find / -name "toto" -mtime -1

No, the difference is that the Subversion database maintains information
on *changesets* (i.e. sets of commits), so that when "svn update" asks
the server "give me all the changes since revision x", the server knows
which files are involved without having to check each individual file.

CVS would need to traverse the entire repository looking for files with
changes since revision x.

--
/Jesper



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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Fafou31-2
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Jesper Eskilson-2
Fabrice Mercier wrote:
> Ok nice but when you said "lot of companies use hudson with poll
> strategy without any problem".

I haven't said any such thing. Maybe you replied to the wrong post?

> how many jobs are configured ? I have more than 400 jobs configured in
> my companies, poll run every 5 minutes, 25 in //
>
> Sometimes I have a very strange comportment, Hudson process do not
> release file (or too muche file opened) so I have a too many open file
> exception. All my jobs run failed. My Gentoo is configured to be able to
> support 10000 files opened in // (ulimit -n parameter)
> Maybe with my very large number of jobs makes appear a bug that is not
> detectable with less jobs.
>
>
>
>
> 2009/6/15 Jesper Eskilson <[hidden email]
> <mailto:[hidden email]>>
>
>     Fabrice Mercier wrote:
>
>         Ok it could be similar to a
>         find / -name "toto"
>         and
>         find / -name "toto" -mtime -1
>
>
>     No, the difference is that the Subversion database maintains
>     information on *changesets* (i.e. sets of commits), so that when
>     "svn update" asks the server "give me all the changes since revision
>     x", the server knows which files are involved without having to
>     check each individual file.
>
>     CVS would need to traverse the entire repository looking for files
>     with changes since revision x.
>
>
>     --
>     /Jesper
>
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: [hidden email]
>     <mailto:[hidden email]>
>     For additional commands, e-mail: [hidden email]
>     <mailto:[hidden email]>
>
>
>
>
> --
> Cordialement / Best regards
>
> Fabrice Mercier


--
/Jesper



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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Fafou31-2
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Ken Liu
Yes, in my group I have something like 50 jobs, but we are using hudson and subversion on a multi-cpu machine with a disk array. Clearly 400 jobs is going to put a lot of strain on the Hudson server and CVS server. I agree with the other person who suggested completing the migration to SVN to see if faster "update" operation will suit your Hudson.
 
I believe there are a number of users (a few dozen, according to Kohsuke) who have Hudson set up for many hundreds of jobs. You may want to try the user list to see if any of them are similar problems.
 
Ken

On Mon, Jun 15, 2009 at 10:37 AM, Fabrice Mercier <[hidden email]> wrote:
Sorry it is ken liu
"Is there a reason you are avoiding the polling? I have done it this way for many years in several different companies and find that it works well. It is the default strategy in Hudson."

2009/6/15 Jesper Eskilson <[hidden email]>
Fabrice Mercier wrote:
Ok nice but when you said "lot of companies use hudson with poll strategy without any problem".

I haven't said any such thing. Maybe you replied to the wrong post?

how many jobs are configured ? I have more than 400 jobs configured in my companies, poll run every 5 minutes, 25 in //

Sometimes I have a very strange comportment, Hudson process do not release file (or too muche file opened) so I have a too many open file exception. All my jobs run failed. My Gentoo is configured to be able to support 10000 files opened in // (ulimit -n parameter)
Maybe with my very large number of jobs makes appear a bug that is not detectable with less jobs.




2009/6/15 Jesper Eskilson <[hidden email] <mailto:[hidden email]>>


   Fabrice Mercier wrote:

       Ok it could be similar to a
       find / -name "toto"
       and
       find / -name "toto" -mtime -1


   No, the difference is that the Subversion database maintains
   information on *changesets* (i.e. sets of commits), so that when
   "svn update" asks the server "give me all the changes since revision
   x", the server knows which files are involved without having to
   check each individual file.

   CVS would need to traverse the entire repository looking for files
   with changes since revision x.


   --    /Jesper



   ---------------------------------------------------------------------
   To unsubscribe, e-mail: [hidden email]
   <mailto:[hidden email]>

   For additional commands, e-mail: [hidden email]
   <mailto:[hidden email]>





--
Cordialement / Best regards

Fabrice Mercier


--
/Jesper



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




--
Cordialement / Best regards

Fabrice Mercier

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Andrew Chandler

Ken is write on this - the poll on svn is a very quick low cost operation.  On cvs it is an expensive time consuming operation as it has to recurse to every file to check individual version numbers.  We have both running in our environment and the difference in time for an svn poll is tremendous.   I think even with 400 jobs the check version won't strain your server and you may not have the open file issue either since many fewer files have to be opened to check what version everything is at.   In cvs I think its the entries file but at minimum one has to be checked per directory level.


On Mon, 2009-06-15 at 11:06 -0400, Ken Liu wrote:
Yes, in my group I have something like 50 jobs, but we are using hudson and subversion on a multi-cpu machine with a disk array. Clearly 400 jobs is going to put a lot of strain on the Hudson server and CVS server. I agree with the other person who suggested completing the migration to SVN to see if faster "update" operation will suit your Hudson.
 
I believe there are a number of users (a few dozen, according to Kohsuke) who have Hudson set up for many hundreds of jobs. You may want to try the user list to see if any of them are similar problems.
 
Ken


On Mon, Jun 15, 2009 at 10:37 AM, Fabrice Mercier <[hidden email]> wrote:
Sorry it is ken liu
"Is there a reason you are avoiding the polling? I have done it this way for many years in several different companies and find that it works well. It is the default strategy in Hudson."



2009/6/15 Jesper Eskilson <[hidden email]>
Fabrice Mercier wrote:
Ok nice but when you said "lot of companies use hudson with poll strategy without any problem".


I haven't said any such thing. Maybe you replied to the wrong post?

how many jobs are configured ? I have more than 400 jobs configured in my companies, poll run every 5 minutes, 25 in //

Sometimes I have a very strange comportment, Hudson process do not release file (or too muche file opened) so I have a too many open file exception. All my jobs run failed. My Gentoo is configured to be able to support 10000 files opened in // (ulimit -n parameter)
Maybe with my very large number of jobs makes appear a bug that is not detectable with less jobs.





2009/6/15 Jesper Eskilson <[hidden email] <mailto:[hidden email]>>


   Fabrice Mercier wrote:

       Ok it could be similar to a
       find / -name "toto"
       and
       find / -name "toto" -mtime -1


   No, the difference is that the Subversion database maintains
   information on *changesets* (i.e. sets of commits), so that when
   "svn update" asks the server "give me all the changes since revision
   x", the server knows which files are involved without having to
   check each individual file.

   CVS would need to traverse the entire repository looking for files
   with changes since revision x.


   --    /Jesper



   ---------------------------------------------------------------------
   To unsubscribe, e-mail: [hidden email]

   <mailto:[hidden email]>

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

   <mailto:[hidden email]>





--
Cordialement / Best regards

Fabrice Mercier




--
/Jesper



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





--
Cordialement / Best regards

Fabrice Mercier



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

stephenconnolly
The SVN poll does not have to open any files on the hudson server.

hudson knows the last revision it checked out... svn poll is just:
"hey mr svn server, what's the latest revision number?"

AFAIK the svn server can answer that with just one file being opened.

Hudson then compares the response with the last revision built... so

SVN poll is O(1)
CVS poll is O(N)

where N is the number of files in your repo

-Stephen

2009/6/15 Andrew Chandler <[hidden email]>:

>
> Ken is write on this - the poll on svn is a very quick low cost operation.
> On cvs it is an expensive time consuming operation as it has to recurse to
> every file to check individual version numbers.  We have both running in our
> environment and the difference in time for an svn poll is tremendous.   I
> think even with 400 jobs the check version won't strain your server and you
> may not have the open file issue either since many fewer files have to be
> opened to check what version everything is at.   In cvs I think its the
> entries file but at minimum one has to be checked per directory level.
>
>
> On Mon, 2009-06-15 at 11:06 -0400, Ken Liu wrote:
>
> Yes, in my group I have something like 50 jobs, but we are using hudson and
> subversion on a multi-cpu machine with a disk array. Clearly 400 jobs is
> going to put a lot of strain on the Hudson server and CVS server. I agree
> with the other person who suggested completing the migration to SVN to see
> if faster "update" operation will suit your Hudson.
>
>
>
> I believe there are a number of users (a few dozen, according to
> Kohsuke) who have Hudson set up for many hundreds of jobs. You may want to
> try the user list to see if any of them are similar problems.
>
>
>
> Ken
>
>
> On Mon, Jun 15, 2009 at 10:37 AM, Fabrice Mercier <[hidden email]> wrote:
>
> Sorry it is ken liu
>
> "Is there a reason you are avoiding the polling? I have done it this way for
> many years in several different companies and find that it works well. It is
> the default strategy in Hudson."
>
>
>
> 2009/6/15 Jesper Eskilson <[hidden email]>
>
> Fabrice Mercier wrote:
>
> Ok nice but when you said "lot of companies use hudson with poll strategy
> without any problem".
>
>
> I haven't said any such thing. Maybe you replied to the wrong post?
>
> how many jobs are configured ? I have more than 400 jobs configured in my
> companies, poll run every 5 minutes, 25 in //
>
> Sometimes I have a very strange comportment, Hudson process do not release
> file (or too muche file opened) so I have a too many open file exception.
> All my jobs run failed. My Gentoo is configured to be able to support 10000
> files opened in // (ulimit -n parameter)
> Maybe with my very large number of jobs makes appear a bug that is not
> detectable with less jobs.
>
>
>
>
>
> 2009/6/15 Jesper Eskilson <[hidden email]
> <mailto:[hidden email]>>
>
>    Fabrice Mercier wrote:
>
>        Ok it could be similar to a
>        find / -name "toto"
>        and
>        find / -name "toto" -mtime -1
>
>
>    No, the difference is that the Subversion database maintains
>    information on *changesets* (i.e. sets of commits), so that when
>    "svn update" asks the server "give me all the changes since revision
>    x", the server knows which files are involved without having to
>    check each individual file.
>
>    CVS would need to traverse the entire repository looking for files
>    with changes since revision x.
>
>
>    --    /Jesper
>
>
>
>    ---------------------------------------------------------------------
>    To unsubscribe, e-mail: [hidden email]
>
>    <mailto:[hidden email]>
>
>    For additional commands, e-mail: [hidden email]
>
>    <mailto:[hidden email]>
>
>
>
>
> --
> Cordialement / Best regards
>
> Fabrice Mercier
>
>
>
>
> --
> /Jesper
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>
>
> --
> Cordialement / Best regards
>
> Fabrice Mercier
>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Andrew Chandler
right which is why I was saying it should be fine - note I was talking about cvs being the expensive one, the original user wanting the commit script was coming from a cvs environment and moving to a Subversion environment - all his experience/troubles were from a pre-svn point of view, I was just emphasizing the point that svn should be nowhere near as bad.

On Mon, 2009-06-15 at 18:00 +0100, Stephen Connolly wrote:
The SVN poll does not have to open any files on the hudson server.

hudson knows the last revision it checked out... svn poll is just:
"hey mr svn server, what's the latest revision number?"

AFAIK the svn server can answer that with just one file being opened.

Hudson then compares the response with the last revision built... so

SVN poll is O(1)
CVS poll is O(N)

where N is the number of files in your repo

-Stephen

2009/6/15 Andrew Chandler <[hidden email]>:
>
> Ken is write on this - the poll on svn is a very quick low cost operation.
> On cvs it is an expensive time consuming operation as it has to recurse to
> every file to check individual version numbers.  We have both running in our
> environment and the difference in time for an svn poll is tremendous.   I
> think even with 400 jobs the check version won't strain your server and you
> may not have the open file issue either since many fewer files have to be
> opened to check what version everything is at.   In cvs I think its the
> entries file but at minimum one has to be checked per directory level.
>
>
> On Mon, 2009-06-15 at 11:06 -0400, Ken Liu wrote:
>
> Yes, in my group I have something like 50 jobs, but we are using hudson and
> subversion on a multi-cpu machine with a disk array. Clearly 400 jobs is
> going to put a lot of strain on the Hudson server and CVS server. I agree
> with the other person who suggested completing the migration to SVN to see
> if faster "update" operation will suit your Hudson.
>
>
>
> I believe there are a number of users (a few dozen, according to
> Kohsuke) who have Hudson set up for many hundreds of jobs. You may want to
> try the user list to see if any of them are similar problems.
>
>
>
> Ken
>
>
> On Mon, Jun 15, 2009 at 10:37 AM, Fabrice Mercier <[hidden email]> wrote:
>
> Sorry it is ken liu
>
> "Is there a reason you are avoiding the polling? I have done it this way for
> many years in several different companies and find that it works well. It is
> the default strategy in Hudson."
>
>
>
> 2009/6/15 Jesper Eskilson <[hidden email]>
>
> Fabrice Mercier wrote:
>
> Ok nice but when you said "lot of companies use hudson with poll strategy
> without any problem".
>
>
> I haven't said any such thing. Maybe you replied to the wrong post?
>
> how many jobs are configured ? I have more than 400 jobs configured in my
> companies, poll run every 5 minutes, 25 in //
>
> Sometimes I have a very strange comportment, Hudson process do not release
> file (or too muche file opened) so I have a too many open file exception.
> All my jobs run failed. My Gentoo is configured to be able to support 10000
> files opened in // (ulimit -n parameter)
> Maybe with my very large number of jobs makes appear a bug that is not
> detectable with less jobs.
>
>
>
>
>
> 2009/6/15 Jesper Eskilson <[hidden email]
> <[hidden email]>>
>
>    Fabrice Mercier wrote:
>
>        Ok it could be similar to a
>        find / -name "toto"
>        and
>        find / -name "toto" -mtime -1
>
>
>    No, the difference is that the Subversion database maintains
>    information on *changesets* (i.e. sets of commits), so that when
>    "svn update" asks the server "give me all the changes since revision
>    x", the server knows which files are involved without having to
>    check each individual file.
>
>    CVS would need to traverse the entire repository looking for files
>    with changes since revision x.
>
>
>    --    /Jesper
>
>
>
>    ---------------------------------------------------------------------
>    To unsubscribe, e-mail: [hidden email]
>
>    <[hidden email]>
>
>    For additional commands, e-mail: [hidden email]
>
>    <[hidden email]>
>
>
>
>
> --
> Cordialement / Best regards
>
> Fabrice Mercier
>
>
>
>
> --
> /Jesper
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>
>
> --
> Cordialement / Best regards
>
> Fabrice Mercier
>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

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




--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Kohsuke Kawaguchi
Administrator
In reply to this post by Fafou31-2

Toward 1.311 I implemented the post-commit hook support. See more about
this in
http://wiki.hudson-ci.org/display/HUDSON/Subversion+post-commit+hook

This implementation pushes much of the logic into Hudson itself, and
keeps the script minimal --- this makes it more robust to the
configuration changes made on Hudson.

Fabrice Mercier wrote:

> Hi
>
> I am trying to migrate my company from CVS to SVN and to change build
> strategy from polling to SVN hooks
>
> Hard to me to write a well complete post-commit hook to run a build. I have
> difficulties to get information, PROJECT_NAME, BRANCH
>
> *It will be very useful to give in the hudson wiki the post-commit hook.*
>
> Here my incomplete script that does not work because it does not know the
> project name commited :
>
> REPOS="$1"
> REV="$2"
>
> HUDSON_URL="
> <a href="http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB">http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB"
>
> oldIFS=$IFS
> IFS="/"
> Array=( $REPOS )
> IFS=$oldIFS
> LastElementIndex=${#Array[@]}-1
>
> ProjectName=${Array[$LastElementIndex]}
> HUDSON_URL=$( echo "$HUDSON_URL" | sed s/#PROJECT#/$ProjectName/g )
>
> echo $REPOS >> /tmp/commit.txt
>
> /usr/bin/wget -o /dev/null "$HUDSON_URL"
>
>
>
> could you help me please ?
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

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

Re: SVN Post commit script

Kohsuke Kawaguchi
Administrator

Compared to the polling approach, this reduces the delay between a
commit and a build --- even if you run polling every minute, you can
still see up to 1 minute delay. But with this, your delay is next to 0.

Kohsuke Kawaguchi wrote:

> Toward 1.311 I implemented the post-commit hook support. See more about
> this in
> http://wiki.hudson-ci.org/display/HUDSON/Subversion+post-commit+hook
>
> This implementation pushes much of the logic into Hudson itself, and
> keeps the script minimal --- this makes it more robust to the
> configuration changes made on Hudson.
>
> Fabrice Mercier wrote:
>> Hi
>>
>> I am trying to migrate my company from CVS to SVN and to change build
>> strategy from polling to SVN hooks
>>
>> Hard to me to write a well complete post-commit hook to run a build. I have
>> difficulties to get information, PROJECT_NAME, BRANCH
>>
>> *It will be very useful to give in the hudson wiki the post-commit hook.*
>>
>> Here my incomplete script that does not work because it does not know the
>> project name commited :
>>
>> REPOS="$1"
>> REV="$2"
>>
>> HUDSON_URL="
>> <a href="http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB">http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB"
>>
>> oldIFS=$IFS
>> IFS="/"
>> Array=( $REPOS )
>> IFS=$oldIFS
>> LastElementIndex=${#Array[@]}-1
>>
>> ProjectName=${Array[$LastElementIndex]}
>> HUDSON_URL=$( echo "$HUDSON_URL" | sed s/#PROJECT#/$ProjectName/g )
>>
>> echo $REPOS >> /tmp/commit.txt
>>
>> /usr/bin/wget -o /dev/null "$HUDSON_URL"
>>
>>
>>
>> could you help me please ?
>>
>>
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

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

Re: SVN Post commit script

Ken Liu
Hi Kohsuke,

This sounds pretty good. Am I correct in guessing that the quiet period is still respected?

Ken

On Mon, Jun 15, 2009 at 5:18 PM, Kohsuke Kawaguchi <[hidden email]> wrote:

Compared to the polling approach, this reduces the delay between a commit and a build --- even if you run polling every minute, you can still see up to 1 minute delay. But with this, your delay is next to 0.


Kohsuke Kawaguchi wrote:
Toward 1.311 I implemented the post-commit hook support. See more about this in http://wiki.hudson-ci.org/display/HUDSON/Subversion+post-commit+hook

This implementation pushes much of the logic into Hudson itself, and keeps the script minimal --- this makes it more robust to the configuration changes made on Hudson.

Fabrice Mercier wrote:
Hi

I am trying to migrate my company from CVS to SVN and to change build
strategy from polling to SVN hooks

Hard to me to write a well complete post-commit hook to run a build. I have
difficulties to get information, PROJECT_NAME, BRANCH

*It will be very useful to give in the hudson wiki the post-commit hook.*

Here my incomplete script that does not work because it does not know the
project name commited :

REPOS="$1"
REV="$2"

HUDSON_URL="
http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB"

oldIFS=$IFS
IFS="/"
Array=( $REPOS )
IFS=$oldIFS
LastElementIndex=${#Array[@]}-1

ProjectName=${Array[$LastElementIndex]}
HUDSON_URL=$( echo "$HUDSON_URL" | sed s/#PROJECT#/$ProjectName/g )

echo $REPOS >> /tmp/commit.txt

/usr/bin/wget -o /dev/null "$HUDSON_URL"



could you help me please ?






--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVN Post commit script

Kohsuke Kawaguchi
Administrator
Ken Liu wrote:
> Hi Kohsuke,
> This sounds pretty good. Am I correct in guessing that the quiet period is
> still respected?

Yes.

> Ken
>
> On Mon, Jun 15, 2009 at 5:18 PM, Kohsuke Kawaguchi <
> [hidden email]> wrote:
>
>>
>> Compared to the polling approach, this reduces the delay between a commit
>> and a build --- even if you run polling every minute, you can still see up
>> to 1 minute delay. But with this, your delay is next to 0.
>>
>>
>> Kohsuke Kawaguchi wrote:
>>
>>> Toward 1.311 I implemented the post-commit hook support. See more about
>>> this in
>>> http://wiki.hudson-ci.org/display/HUDSON/Subversion+post-commit+hook
>>>
>>> This implementation pushes much of the logic into Hudson itself, and keeps
>>> the script minimal --- this makes it more robust to the configuration
>>> changes made on Hudson.
>>>
>>> Fabrice Mercier wrote:
>>>
>>>> Hi
>>>>
>>>> I am trying to migrate my company from CVS to SVN and to change build
>>>> strategy from polling to SVN hooks
>>>>
>>>> Hard to me to write a well complete post-commit hook to run a build. I
>>>> have
>>>> difficulties to get information, PROJECT_NAME, BRANCH
>>>>
>>>> *It will be very useful to give in the hudson wiki the post-commit hook.*
>>>>
>>>> Here my incomplete script that does not work because it does not know the
>>>> project name commited :
>>>>
>>>> REPOS="$1"
>>>> REV="$2"
>>>>
>>>> HUDSON_URL="
>>>> <a href="http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB">http://tl-em-1:8080/hudson/#PROJECT#/build?token=BUILD_ALMERYS_JOB<http://tl-em-1:8080/hudson/#PROJECT%23/build?token=BUILD_ALMERYS_JOB>
>>>> "
>>>>
>>>> oldIFS=$IFS
>>>> IFS="/"
>>>> Array=( $REPOS )
>>>> IFS=$oldIFS
>>>> LastElementIndex=${#Array[@]}-1
>>>>
>>>> ProjectName=${Array[$LastElementIndex]}
>>>> HUDSON_URL=$( echo "$HUDSON_URL" | sed s/#PROJECT#/$ProjectName/g )
>>>>
>>>> echo $REPOS >> /tmp/commit.txt
>>>>
>>>> /usr/bin/wget -o /dev/null "$HUDSON_URL"
>>>>
>>>>
>>>>
>>>> could you help me please ?
>>>>
>>>>
>>>>
>>>
>>>
>>
>> --
>> Kohsuke Kawaguchi
>> Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/
>>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

smime.p7s (4K) Download Attachment
12
Loading...