Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use the Jenkins REST API with a JENKINS_SERVER_COOKIE?

My goal is to ask questions of the Jenkins server within a Jenkins-run script (specifically when it's run on a remote agent). I'd like to use a Perl or Python script with the REST API. I'd like to ask data known by the Jenkins server.

In my specific case, I'd like a build-display-name of a most-recent successful build of a different project. I'd like to do this without username/password credentials. I'd expect to be able to use the environment variable JENKINS_SERVER_COOKIE as a credential as a cookie or header as I use the Jenkins REST API for GET-based requests.

Is that possible? If not, what is the environment variable JENKINS_SERVER_COOKIE used for?

Thanks!

like image 773
macetw Avatar asked Oct 29 '22 08:10

macetw


1 Answers

JENKINS_SERVER_COOKIE is not used for anything related to the REST API; best to ignore it.

What you request is not currently possible.

like image 117
Jesse Glick Avatar answered Nov 15 '22 05:11

Jesse Glick