I've got a parameterized matrix build, one of the parameters is called
"Description" and in the "Prepare an environment for the run" section, under
"Script Content", I have this:
curl -G -s --data-urlencode "Description=$Description"
"http://localhost:8080/job/$JOB_NAME/$BUILD_NUMBER/submitDescription";
this works great to set the description of the build according to the
Description parameter, and do so early on in the build (I'm not as happy
with the plugins that set the description at the end of the build).

HOWEVER

when the Matrix part of the job kicks in, this code gets executed again on
my Linux box which chokes because it's only a slave so http://localhost:8080
doesn't mean anything.

I thought about actually specifying the IP, so the "submitDescription" would
go to the actual build server, but in the matrix build $JOB_NAME is now
"Job/Matrix=linux" so the URL isn't right anyway.

AND

I've also got a Windows slave, and "curl" just completely confuses him.

I tried writing an "if" statement in the "Script Content" - something like
this:

    if [[ "$NODE_NAME" = "master" ]]; then
    curl -G blah blah blah
    fi

but (1) Jenkins wasn't at all happy with that, and (2) even if Jenkins
accepted it, my Windows slave would choke on it.

* Is there a better way to set the build description from a parameter?
* Is there a way to have Jenkins prepare the environment differently on
different nodes?
* Is there a trick to putting a value in "Script File Path" such that it
runs correctly on both Windows and Linux slaves?
* Is there something clever I can do with a Groovy script here?

Thanks for any and all advice!
Chris





--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/How-can-I-set-the-build-description-from-a-parameter-tp4683192.html
Sent from the Jenkins users mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to