Can I mass edit jenkins jobs by modifying the config.xml files?

15,271

Solution 1

Under the "Managr Hudson" option, there's a "Reload Configuration from Disk" item that will do what you want - re-reads the config.xml for projects while Hudson is running. You can always restart Hudson to get the same effect.

Solution 2

Another way to mass edit jobs is to use the REST API; you can edit the job configurations manually and then use HTTP POST to commit them back to Hudson. If you go to [Your Hudson URL]/job/[example job name]/api Hudson will display help information on using the API.

Solution 3

You should probably make use of this plugin https://wiki.jenkins-ci.org/display/JENKINS/Configuration+Slicing+Plugin

Solution 4

You can use XSLT (templates) to automatically generate configuration xmls and configure via rest api. Use Jenkins to configure its own jobs

Share:
15,271

Related videos on Youtube

chrisst
Author by

chrisst

Full stack work most recently in python

Updated on June 04, 2022

Comments

  • chrisst
    chrisst almost 2 years

    I have a lot of jobs in jenkins and we have decided to make some wide ranging changes to all of them which will be very tedious to change through the UI. It would be much easier to edit them using scripts on the jenkins master machine but I'm not sure how to get jenkins to recognize changes to the the config.xml that haven't come through the UI or another api.

    Is there a way to get jenkins to refresh job configurations from disk? Or a better way of mass editing jobs?

  • BogdanSorlea
    BogdanSorlea about 10 years
    this should be the appropriate answer for this question.
  • kubanczyk
    kubanczyk about 8 years
    Brilliant plugin (nevermind plugin's name is a bit confusing).