Quantcast

Newbie Question--Including UpStream build artifacts in downstream Project

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

Newbie Question--Including UpStream build artifacts in downstream Project

russ2008
I am sure this is a very simple question so please forgive me becauase I am REALLY new to Hudson.  

I have three projects.  The third project must wait on project one and two to build before starting.  The results (jar files) from project one and two are placed in the WEB-INF/lib directory.  Once this is accomplished, project three can build.

I have the projects building .  I have identified the upstream projects and Husdon builds accordingly.  What is not happening is Project three is not obtaining the jar files from project one and two.  I had to manually add jars in project three to get it to work.

Can someone please share their knowledge on how one can automate capturing the jar files from project one and two, please?  I did try reading the instructions one breaking up build process, but the logic escaped me.  

Thank you for allowing me to ask such a simple question.  

Russ
Thanks for taking the time to read my post!

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

RE: Newbie Question--Including UpStream build artifacts in downstream Project

Matt Brown-3
I would suggest using something like Maven or Ivy to handle project dependencies like this; in other words, the solution should work both inside Hudson and outside of Hudson.

In my experience, build scripts for a project which require other projects to be build first for their output lead to lots of headaches. Better, IMO, to have a versioned number of Project A that Project B can depend on so that B's build script can intelligently go out and fetch A v1.2.3 or whatever instead of having to have the projects built in a certain order each time.

I could be wrong but I don't think there is anyway to do what you want within Hudson, outside of having Project A copy it's output to B's workspace. I believe that upstream/downstream projects in Hudson are meant to be a little more abstract - for example, I have a job that compiles (and deploys to a test server) a webapp, and a downstream project which runs automated tests against that deployed webapp. I wouldn't want the output of the first job bundled in the output of the second by default.

-----Original Message-----
From: HarleyGuy [mailto:[hidden email]]
Sent: Tuesday, July 21, 2009 7:22 PM
To: [hidden email]
Subject: Newbie Question--Including UpStream build artifacts in downstream Project


I am sure this is a very simple question so please forgive me becauase I am REALLY new to Hudson.  

I have three projects.  The third project must wait on project one and two to build before starting.  The results (jar files) from project one and two are placed in the WEB-INF/lib directory.  Once this is accomplished, project three can build.

I have the projects building .  I have identified the upstream projects and Husdon builds accordingly.  What is not happening is Project three is not obtaining the jar files from project one and two.  I had to manually add jars in project three to get it to work.

Can someone please share their knowledge on how one can automate capturing the jar files from project one and two, please?  I did try reading the instructions one breaking up build process, but the logic escaped me.  

Thank you for allowing me to ask such a simple question.  

Russ
--
View this message in context: http://www.nabble.com/Newbie-Question--Including-UpStream-build-artifacts-in-downstream-Project-tp24597336p24597336.html
Sent from the Hudson users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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
|  
Report Content as Inappropriate

Re: Newbie Question--Including UpStream build artifacts in downstream Project

Fabrizio Giudici
Matt Brown wrote:
> I could be wrong but I don't think there is anyway to do what you want within Hudson, outside of having Project A copy it's output to B's workspace. I believe that upstream/downstream projects in Hudson are meant to be a little more abstract - for example, I have a job that compiles (and deploys to a test server) a webapp, and a downstream project which runs automated tests against that deployed webapp. I wouldn't want the output of the first job bundled in the output of the second by default.
>  
I'm working with staging builds too and for sure there are many things
that I have to do better. In any case, I'm facing with a similar issue
because I have to prepare the whole workspace created by a job and serve
to another job. What I did is:

1. Make sure the requested files are archived by the job at stage n-1
2. Go to the page of the job n-1 so I see the artifact links (related to
the latest successful build).
3. In project at stage n add a script before running your stuff that
does a wget http://url-of-the-archived-artifact, and of course move it
where you want.

Of course there are variants. You could just set up a script to copy the
artifact from the n-1 workspace - I prefer using wget since I have
slaves and job n doesn't necessarily run on the same computer as job
n-1. If you go with local copy because you don't have slaves, you could
even trigger a downstream job by passing parameters, and - by using
environment variables - job n-1 could directly tell job n where to find
the stuff.

Alternatively, there's a plugin (I believe it's called the "artifact
aggregator") which will offer an option "Aggregate the archived
artifacts". It allows you to copy a selection of files to a certain
directory on your computer (you choose it arbitrarily). With it, the
problem of finding artifact is simplified, since both jobs know the
exact position. I think this approach, though, has some possible racing
issues (what about another run of job n-1 overwriting the artifact while
job n is still reading it? OTOH I believe (or I hope...) that once a
wget initiated a download, Hudson will continue to serve the same file
until it finishes.

I agree that we need something easier for doing this job.

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
[hidden email] - mobile: +39 348.150.6941


---------------------------------------------------------------------
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: Newbie Question--Including UpStream build artifacts in downstream Project

Sami Tikka
In reply to this post by russ2008
2009/7/22 HarleyGuy <[hidden email]>:

>
> I have three projects.  The third project must wait on project one and two
> to build before starting.  The results (jar files) from project one and two
> are placed in the WEB-INF/lib directory.  Once this is accomplished, project
> three can build.
>
> I have the projects building .  I have identified the upstream projects and
> Husdon builds accordingly.  What is not happening is Project three is not
> obtaining the jar files from project one and two.  I had to manually add
> jars in project three to get it to work.
>
> Can someone please share their knowledge on how one can automate capturing
> the jar files from project one and two, please?  I did try reading the
> instructions one breaking up build process, but the logic escaped me.

I have no knowledge what is the best way to handle this if you are
using a Maven project. We use freestyle projects.

Our downstream projects download the needed modules from upstream
projects. They do it by calling "wget" or "curl" in Makefile to
download upstream project artifacts.

Each Hudson project has a page which contains links to projects latest
artifacts. We use those links.

When building by hand, Makefile gets executed by the developer who
types "make" on the command line on his workstation. When Hudson makes
the build, the freestyle project's shell build script calls "make"

-- Sami

---------------------------------------------------------------------
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: Newbie Question--Including UpStream build artifacts in downstream Project

Chris Marks
I too would recommend either Maven or Ivy to manage these artifacts.  If you publish the jars to a private Maven repository as snapshots, then you can get everything you need using these standard approaches.  An easy private Maven repository to set up and manage is Artifactory (www.jfrog.org).  If you can't/don't want to use that and are using Ant, you can use the "get" task to retrieve the jar files from the other projects, you just need to make sure you use the "latest artifact" url provided by Hudson and make sure the jar files don't contain a build number or other identifier that makes it hard to  generate the right url when you need to.

Hope this helps.

Thanks,
topher


On Wed, Jul 22, 2009 at 7:22 AM, Sami Tikka <[hidden email]> wrote:
2009/7/22 HarleyGuy <[hidden email]>:
>
> I have three projects.  The third project must wait on project one and two
> to build before starting.  The results (jar files) from project one and two
> are placed in the WEB-INF/lib directory.  Once this is accomplished, project
> three can build.
>
> I have the projects building .  I have identified the upstream projects and
> Husdon builds accordingly.  What is not happening is Project three is not
> obtaining the jar files from project one and two.  I had to manually add
> jars in project three to get it to work.
>
> Can someone please share their knowledge on how one can automate capturing
> the jar files from project one and two, please?  I did try reading the
> instructions one breaking up build process, but the logic escaped me.

I have no knowledge what is the best way to handle this if you are
using a Maven project. We use freestyle projects.

Our downstream projects download the needed modules from upstream
projects. They do it by calling "wget" or "curl" in Makefile to
download upstream project artifacts.

Each Hudson project has a page which contains links to projects latest
artifacts. We use those links.

When building by hand, Makefile gets executed by the developer who
types "make" on the command line on his workstation. When Hudson makes
the build, the freestyle project's shell build script calls "make"

-- Sami

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


Loading...