Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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... –  Dave Dopson Nov 8 '11 at 2:14

2 Answers 2

up vote 4 down vote accepted

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
share|improve this answer

I prefer curl....

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.