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

JobDSL plugin doesn't reset customWorkspace setting

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • job-dsl-plugin
    • None
    • Jenkins ver. 1.597 installed on Windows 8.1 (local test) and Windows Server 2008 R2 (production)

      Use JobDSL plug in to create a job like this:

      job('testjob') {
          customWorkspace('c:\\')
      }
      

      Then delete customWorkspace and run JobDSL again:

      job('testjob') {
      }
      

      The setting in the job is still activated and points to "c:\".

          [JENKINS-26825] JobDSL plugin doesn't reset customWorkspace setting

          Rolf Geuenich added a comment -

          I've tried the following things, but none of them deactivated customWorkspace:

          customWorkspace()
          customWorkspace('')
          customWorkspace(false)
          

          In GitHub wiki I didn't find any solution and google search brings no answer.

          Rolf Geuenich added a comment - I've tried the following things, but none of them deactivated customWorkspace: customWorkspace() customWorkspace('') customWorkspace( false ) In GitHub wiki I didn't find any solution and google search brings no answer.

          This is caused by another issue, JENKINS-21017. The Job DSL plugin, the CLI and the REST API all use a similar API and the problem exists for all those components and needs to be fixed in Jenkins core or the xstream library.

          Daniel Spilker added a comment - This is caused by another issue, JENKINS-21017 . The Job DSL plugin, the CLI and the REST API all use a similar API and the problem exists for all those components and needs to be fixed in Jenkins core or the xstream library.

          As a (lame) workaround, you can restart Jenkins after deleting the customWorkspace settings. Then the configuration is loaded from scratch and any runtime information is discarded.

          Daniel Spilker added a comment - As a (lame) workaround, you can restart Jenkins after deleting the customWorkspace settings. Then the configuration is loaded from scratch and any runtime information is discarded.

          Rolf Geuenich added a comment -

          Thank you for this information. This will help me because we need to switch some jobs and don't want to change them manually.

          Rolf Geuenich added a comment - Thank you for this information. This will help me because we need to switch some jobs and don't want to change them manually.

          Daniel Beck added a comment -

          The effective "default" custom workspace is usually workspace/ followed by the project's full name. Just as the effective custom display name is the same as the project's name. Not sure whether that helps in the context of Job DSL, it's what I do for Cloudbees Template Plugin.

          Daniel Beck added a comment - The effective "default" custom workspace is usually workspace/ followed by the project's full name . Just as the effective custom display name is the same as the project's name . Not sure whether that helps in the context of Job DSL, it's what I do for Cloudbees Template Plugin.

          S H added a comment -

          Any progress on this issue?

          S H added a comment - Any progress on this issue?

          Jesse Glick added a comment -

          Verified duplicate of JENKINS-21017.

          Jesse Glick added a comment - Verified duplicate of  JENKINS-21017 .

            daspilker Daniel Spilker
            kaltokri Rolf Geuenich
            Votes:
            6 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: