Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-8797

Add support for retrieving job configuration via Jenkins CLI

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • cli
    • None

      The Jenkins CLI is missing support for retrieving the configuration of a job. The http://jenkins/job/name/config.xml URL only works when no authentication/authorization is required to access the file. The new command for the Jenkins CLI would complement the already existing create-job command.

          [JENKINS-8797] Add support for retrieving job configuration via Jenkins CLI

          I am also interested in this. In addition to getting the job config via CLI, we also need capability to set the job config via CLI. This is a legit use case for several of my customers and a CLI capability which other CI toolkits include.

          Parameters to the edit-job would be the job name and/or updated xml file on the filesystem. Seems easy to implement.

          -Anthony

          anthonyjeffery added a comment - I am also interested in this. In addition to getting the job config via CLI, we also need capability to set the job config via CLI. This is a legit use case for several of my customers and a CLI capability which other CI toolkits include. Parameters to the edit-job would be the job name and/or updated xml file on the filesystem. Seems easy to implement. -Anthony

          Mirko Friedenhagen added a comment - - edited

          Hm, curl -u USERNAME http://jenkins/job/name/config.xml works for me. curl wants me to enter the password then or I could provide it via -uUSERNAME:PASSWORD.

          Mirko Friedenhagen added a comment - - edited Hm, curl -u USERNAME http://jenkins/job/name/config.xml works for me. curl wants me to enter the password then or I could provide it via -uUSERNAME:PASSWORD .

          Karl Scheer added a comment - - edited

          Additionally, if you want to use wget, you can use

          wget --user=username --password=password http://jenkins/job/name/config.xml.

          This also works for the node toggleOffline command.

          Karl Scheer added a comment - - edited Additionally, if you want to use wget, you can use wget --user=username --password=password http://jenkins/job/name/config.xml . This also works for the node toggleOffline command.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/src/main/java/hudson/cli/GetJobXmlCommand.java
          core/src/main/java/hudson/cli/UpdateJobXmlCommand.java
          core/src/main/java/hudson/model/AbstractItem.java
          http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9
          Log:
          [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML
          definitions.

          Compare: https://github.com/jenkinsci/jenkins/compare/297aff0...6b2af91

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/cli/GetJobXmlCommand.java core/src/main/java/hudson/cli/UpdateJobXmlCommand.java core/src/main/java/hudson/model/AbstractItem.java http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9 Log: [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML definitions. Compare: https://github.com/jenkinsci/jenkins/compare/297aff0...6b2af91

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1038
          [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML

          Kohsuke Kawaguchi : 6b2af9157a45d26f549bd2279d0f57fe8484bef9
          Files :

          • changelog.html
          • core/src/main/java/hudson/cli/UpdateJobXmlCommand.java
          • core/src/main/java/hudson/model/AbstractItem.java
          • core/src/main/java/hudson/cli/GetJobXmlCommand.java

          dogfood added a comment - Integrated in jenkins_main_trunk #1038 [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML Kohsuke Kawaguchi : 6b2af9157a45d26f549bd2279d0f57fe8484bef9 Files : changelog.html core/src/main/java/hudson/cli/UpdateJobXmlCommand.java core/src/main/java/hudson/model/AbstractItem.java core/src/main/java/hudson/cli/GetJobXmlCommand.java

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/src/main/java/hudson/cli/GetJobXmlCommand.java
          core/src/main/java/hudson/cli/UpdateJobXmlCommand.java
          core/src/main/java/hudson/model/AbstractItem.java
          http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9
          Log:
          [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML
          definitions.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/cli/GetJobXmlCommand.java core/src/main/java/hudson/cli/UpdateJobXmlCommand.java core/src/main/java/hudson/model/AbstractItem.java http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9 Log: [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML definitions.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/src/main/java/hudson/cli/GetJobXmlCommand.java
          core/src/main/java/hudson/cli/UpdateJobXmlCommand.java
          core/src/main/java/hudson/model/AbstractItem.java
          http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9
          Log:
          [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML
          definitions.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/cli/GetJobXmlCommand.java core/src/main/java/hudson/cli/UpdateJobXmlCommand.java core/src/main/java/hudson/model/AbstractItem.java http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9 Log: [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML definitions.

            Unassigned Unassigned
            sebastian_bergmann sebastian_bergmann
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: