Reload job configuration

3 messages Options
Embed this post
Permalink
avaso

Reload job configuration

Reply Threaded More More options
Print post
Permalink
Hi,

I need to update a job configuration file from a client program using the Hudson API before calling a job build, then I need to revert back to the original configuration. Is there a way to refresh the config.xml file for an specific job? Something similar to /reload but just for an specific job.

Regards
Mirko Friedenhagen-2

Re: Reload job configuration

Reply Threaded More More options
Print post
Permalink
Am 03.11.2009 um 20:24 schrieb vasof:
> I need to update a job configuration file from a client program  
> using the
> Hudson API before calling a job build, then I need to revert back to  
> the
> original configuration. Is there a way to refresh the config.xml  
> file for an
> specific job? Something similar to /reload but just for an specific  
> job.

Hello,

I do not know how your workflow would be exactly. Otherwise you could:
- do a GET to http://HOST/hudson/job/JOBNAME/config.xml to get the  
current configuration
- change the configuration locally
- do a POST to http://HOST/hudson/job/JOBNAME/config.xml with your  
configuration (will refresh),
- start your build by POSTing to http://HOST/hudson/job/JOBNAME/build
- restore the old version after the build ended via POST again.

Regards
Mirko

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

avaso

Re: Reload job configuration

Reply Threaded More More options
Print post
Permalink
I followed those steps, but the build returns a strange 404 error code, the url is ok.

Thanks!

Mirko Friedenhagen-2 wrote:
Am 03.11.2009 um 20:24 schrieb vasof:
> I need to update a job configuration file from a client program  
> using the
> Hudson API before calling a job build, then I need to revert back to  
> the
> original configuration. Is there a way to refresh the config.xml  
> file for an
> specific job? Something similar to /reload but just for an specific  
> job.

Hello,

I do not know how your workflow would be exactly. Otherwise you could:
- do a GET to http://HOST/hudson/job/JOBNAME/config.xml to get the  
current configuration
- change the configuration locally
- do a POST to http://HOST/hudson/job/JOBNAME/config.xml with your  
configuration (will refresh),
- start your build by POSTing to http://HOST/hudson/job/JOBNAME/build
- restore the old version after the build ended via POST again.

Regards
Mirko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hudson.dev.java.net
For additional commands, e-mail: dev-help@hudson.dev.java.net