11

Jenkins jobs have config.xml files that store the configuration of that job.

I have a "job manager" job that modifies the configuration of other jobs, but I can't seem to get it to acknowledge the new configuration without restarting Jenkins.

The jenkins-cli.jar command line tool strangely doesn't seem to have an option for this action.

It is possible to edit the configuration through the web interface, and have that save/acknowledged without a restart, so it doesn't seem that it would be a technical impossibility.

My best try was to try and post to the same address that the web interface does

wget --post-file=config.xml --user=joe.shmoe --password=secret01 \
     --no-check-certificate                                      \
     https://jenkins.company.com/job/myProject/config.xml

...but I get a 403 despite using valid credentials (copy pasted to ensure no typos)

Anyone have any ideas or know something simple that I'm missing?

1
  • holy crap. THAT ACTUALLY WORKS !!! (with the authentication fixed as Catskul suggests below, or in my case with no auth) I've been looking for this technique for hours now... Nov 8, 2011 at 2:14

2 Answers 2

8

It turns out the crutial info seems to be wget's "--auth-no-challenge" option which apparently is for obscure webserver configurations like Jenkins that don't follow expected protocol:

wget --auth-no-challenge --user=joe.shmoe --password=secret  \
     --post-file=config.xml --no-check-certificate           \
     https://jenkins.company.com/job/myProject/config.xml
4

I prefer curl....

curl "http://localhost:18080/jenkins/job/npm-package-aaa/config.xml" -si --data-binary "$XML" -H "Content-Type: text/xml" 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .