pmendelson wrote:
> As a user who uses Hudson in conjunction with ANT and thinks about 1 day
> trying to customize something I have a few observations / requests:
>
> 1. In my application I have a few Hudson projects that build aspects of my
> system. I then have many more Hudson projects that take the artifacts of
> the builds and deploy them to various run-time projects. Right now I use a
> few environment variables for my deployment projects to find the outputs
> from my build projects. Typically
> ${BLDPROJ}/lastSuccessful/.../.../....war. My approach has a few
> problems:
>
> a. lastSuccessful is the last technically complete build. I would like
> another symbolic that designates the last really well-tested build. I think
> hudson supports it but I don't know to reference it.
I guess by "well-tested build", (for example) you mean a build of the
jaxb-ri project whose corresponding jaxb-tck build run and reported 0
failures?
Paul's basic misunderstanding #1: LastSuccessful in Hudson means that the build succeded and any automated tests also succeded. I don't know how to seperate those 2 steps in a hudson project so my ant build does both and reports success or failure. Before I (possibly) understood this concept I thought that stable meant some sort of human powered certification of the build and unstable means only good compile and unit tests. Before discussing pros and cons of more Permalinks what are user options for marking a build as good or not. I see the concept of putting a description on a build but I assume that is more for display than distinguishing build stability.
The prerequisite for this to work is that you have to enable fingerprint
tracking so that Hudson can track which build artifact is used where.
From there, I can think of two approachs.
I can provide more permalinks, like
http://myhost/hudson/job/jaxb-tck/21/upstream/jaxb-ri/ to point to the
build of the jaxb-ri project that corresponds to the jaxb-tck #21. If
you replace 21 with lastSuccessfulBuild permalink, this URL becomes the
permalink for the jaxb-ri build that corresponds to the last successful
jaxb-tck build, so that's the kind of URLs you wanted, right? Then you
can use wget or something to download the artifact.
Another option is for Hudson to expose more data in machine consumable
way, and you do a little scripting. First you go
http://myhost/hudson/job/jaxb-tck/lastSuccessfulBuild/xml
(hypothetically), and fetch the XML (or JSON or whatever) that has all
the build information, including the upstream builds. Your little
program would figure out from this that the corresponding jaxb-ri build
is #21. Then your program makes another call to
http://myhost/hudson/job/jaxb-ri/21/artifacts/... to get the stuff.
> b. I would like some sort of dashboard view to see which application
> build each deployment build grabbed.
Is this different from a fingerprint page?
> 2. I've thought about building various plugins but the hudson plugin process
> is somewhat daunting. Would you consider any of the following:
If you could elaborate on what you felt as daunting, that would be
really helpful. I'm really trying hard to make it easy to write plugins,
but apparently I'm failing.
> ${BLDPROJ}/lastSuccessful/.../.../....war. My approach has a few
> problems:
>
> a. lastSuccessful is the last technically complete build. I would like
> another symbolic that designates the last really well-tested build. I think
> hudson supports it but I don't know to reference it.
I guess by "well-tested build", (for example) you mean a build of the
jaxb-ri project whose corresponding jaxb-tck build run and reported 0
failures?
> a. Having a mechanism to build a plugin without needing to also build the
> hudson source?
There's no need to build hudson source when you build a plugin. Do I
have some stale old doc somewhere?
Paul's basic misunderstanding #2: It is better to understand maven than to fear it. When I saw all the maven references in your plugin building documentation I assumed that I need to build hudson in its entirity. After I got your reply I reread the doucmentation and it seems reasonable and complete. Personally, I would have done better with instructions built around ant and the user needing to do everything from scratch. I think that the approach you offer is simpler if the user can get past their maven phobias.
> b. Being able to build a plugin component without creating any UI stuff
> (maybe with a printf or logger like function to send a few messages to
> hudson to forward to the user.
You can create plugins that don't have any UI whatsoever. For example, I
think the JMX plugin has no GUI. There are more plugins whose only UI is
"on/off" checkbox.
Do you have any particular kind of plugins that you are trying to write?
I didn't follow what you mean by "logger like function ... to the user"
part of your e-mail.
*** Right now if i call System.err.println("foo") that output will go to the console.
I could imagine something like the AntTask.log(...) method if i called Hudson.Task.log("foo") foo could go into some nice corner of the basic hudson UI without mee knowing about how to manipualte jelly.
> c. A few ant tasks to allow my build to fire a hudson eveng during a
> build.
Ah, so you want a build that's going on inside Hudson to send some
information to the Hudson that's running it?
I'd recommend just printing out text with a marker (like !!!FOOBAR!!!)
and from your Hudson plugin you can search for that string in the
console output. So the ant task would be <echo>.
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi@sun.com