I would like to set the name of a build programmatically during an "Execute 
shell" step.  The new name of the build must be calculated based on some 
code that runs in the shell.

To clarify, the build name is the value that shows up in the "Build 
Executor Status" left sidebar on the main Jenkins page and also the "Build 
History" left sidebar from any Job page.  Normally this value is the build 
number prefixed with a pound sign.

I have looked at the Build Name Setter Plugin 
(https://wiki.jenkins-ci.org/display/JENKINS/Build+Name+Setter+Plugin), but 
I do not believe I can use it to set the build name as early in the build 
process as I would like.  Therefore I am investigating the REST API.


First, I was able to retrieve the build name (referred to as the 
"displayName") via the REST API using curl:

curl -s --user <username>:<password> --data-urlencode "tree=displayName" 
http://jenkins.teslamotors.com/job/firmware-repo/5111/api/json



As an experiment, I was able to set the build "description", using the curl 
command described here:
http://stackoverflow.com/a/25428716
but I was not able to set the build "name".


I came across this Python code that purports to update the build name 
("displayName"), but I could not get it to work myself:
http://stackoverflow.com/a/21710010


Does there exist a method (that works today) for one to set a new build 
name via curl?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/17438749-d4c0-4a36-90a2-9bd6c298c1c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to