Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to replace the entire Repository Url with a parameterized string in Hudson/Jenkins?

In Hudson/Jenkins, is it possible to replace the entire string in the Subversion Module Repository URL with a String parameter? I don't want to just replace just the version or anything like that, I want to replace the entire url.

So, when I run the build, I'd get a prompt for the URL and I'd put something like "http://scm.work.corp/svn/com.work.package/tags/project-4.0.0.RELEASE" and it would check that out and build it.

Being able to substitute the "com.work.package" and "project-4.0.0.RELEASE" parts would be just as acceptable. I basically want it to be one job that can build any release.

like image 326
AHungerArtist Avatar asked Apr 21 '11 22:04

AHungerArtist


3 Answers

Yes you can, I had the same issue but changed it to $VARIABLE and seemed to work the only issue was that you have to include a "." in the Local module directory. It took me a long time to find this out.

like image 78
Pedro_Nieto Avatar answered Sep 22 '22 11:09

Pedro_Nieto


Yes, you can. But you can't have Jenkins/Hudson monitor the SVN for changes. Even with parameters in place, that didn't work for me properly. But if you monitor the SVN from a job that does not have the Repository URL parameterized, have that job trigger a downstream job passing the entire Repository URL as a parameter, then have the downstream job use the Repository URL parameter, then it seems to work.

This is what we do for our build stuff. We have one job that can build the product from SVN, based on the Repository URL that you start the job with. Then we have a number of trigger jobs that monitor certain branches; when a change is noted, the startup the build job and pass their URL to it.

like image 35
Jason Swager Avatar answered Sep 19 '22 11:09

Jason Swager


If Hudson/Jenkins doesn't know the URL in advance, how is it suppose to do continuous build integration?

And, how does Hudson/Jenkins do an update if you keep changing the URL? You'll have to get Hudson/Jenkins to either do a fresh checkout each time, or get it to use the svn switch command.

The whole purpose of a tool like Hudson/Jenkins is to do continuous builds which you want to stop it from doing. Since you're not doing continuous builds, why bother with a tool like Hudson/Jenkins? Why not write your own Ant script that will checkout what you want and then do the build?

Each branch and each module should have its own Hudson/Jenkins job, and with the template plugin, you easily copy one job to be the template for another job. So, it's not all that difficult to setup all the builds you need.

like image 20
David W. Avatar answered Sep 18 '22 11:09

David W.