For what it's worth, Phil, when I used the Job DSL plugin, I used it to
modify existing jobs. I admit it's been about a year since I worked with
it, but that's what we would do. We had it tied in with the job template
plugin, and I can't 100% remember which piece of it over-wrote existing
jobs, but IIRC both plugins could do that?

So, that aspect is worth a closer look, IMO. The job template plugin might
be worth a look as well, now that I'm mentioning it.

Kudos for seeking automated solutions. I hope you get there.

Ben

On Fri, Jun 12, 2015 at 9:58 AM, Phil C <phils...@gmail.com> wrote:

> Hi Ben,
>
> Yes, I looked at the Job DSL plugin a bit.  It looks like it currently
> only provides the ability to create new jobs.  I couldn't find a way to
> modify an existing job.  I only read through the documentation, and haven't
> actually tried messing around with it yet though.  Maybe I'm missing
> something?
>
> In any case, if I do end up implementing job modification functionality, I
> will look into adding this functionality to the Job DSL plugin, rather than
> creating an entirely new plugin.
>
> Phil
>
> On Friday, June 12, 2015 at 5:50:05 AM UTC-7, Ben Patterson wrote:
>>
>> Phil, have you looked at the Job DSL plugin? It sounds to me like that
>> might be useful for you here.
>>
>> https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin, and
>> https://github.com/jenkinsci/job-dsl-plugin/wiki
>>
>> On Friday, June 12, 2015 at 1:05:48 AM UTC-4, Phil C wrote:
>>>
>>> Hi,
>>>
>>> I'd like to be able to modify another job's configuration from a build.
>>> Specifically, I would like to modify the git branch that is used by another
>>> job.
>>>
>>> I'm looking for any ideas on how this would be possible currently.  And
>>> I am considering writing a plugin (or contributing to an appropriate
>>> plugin) for this.
>>>
>>> The only way I can think of how this is possible right now (without a
>>> plugin) is to have a script (groovy?) access the REST interface to retrieve
>>> and set the config.xml.  e.g.:
>>>
>>>    1. Get a project's config.xml by issuing an HTTP GET
>>>    /job/jobname/config.xml.
>>>    2. Modify the config.xml in the script
>>>    3. HTTP POST the modified config.xml back to the same address
>>>
>>> The downside of this approach is that it requires credentials to make
>>> the POST, and it requires complex logic in the script for step 2.
>>>
>>> I'm thinking a plugin could accomplish the same thing easily without
>>> going through HTTP, but instead using internal apis.  The plugin would take
>>> a job name as input, and a set of modifiers to be performed on that job's
>>> config.xml.  Modifiers for common things like git branch can be provided
>>> out of the box.  Also, a generic XSLT modifier can be provided to allow
>>> modification of ANY part of the config.xml (user would provide the XSLT
>>> transformation).  Extension points could be provided to allow other
>>> modifiers to be developed.
>>>
>>> Anyway, let me know your thoughts?  Any other ways this can be done?
>>> Any existing plugins where this logic would be a good fit?
>>>
>>> Thanks,
>>>
>>> Phil
>>>
>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-dev/_i6FYBEnES0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/5794ed87-5005-4ee3-ad16-952dc592d1fa%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/5794ed87-5005-4ee3-ad16-952dc592d1fa%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAAT-2mVnvOcd5xkngR%3D2FgwZZA0EqQyM8o28F0mP-Pr2giFmew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to