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

Append node not working when adding TFS to MultiScm node

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • job-dsl-plugin
    • None

      I'm trying to add multiple TFS branches to a MultiScm. Because the Job DSL doesn't support TFS at the moment I'm using the configure block like this:

          freeStyleJob('tfs-multi-scm') {
              configure {
                  it / scm (class: 'org.jenkinsci.plugins.multiplescms.MultiSCM') / scms << 'hudson.plugins.tfs.TeamFoundationServerScm' {
                      serverUrl('http://tfs:8080/tfs/MyProduct')
                      projectPath('$/Branch1')
                      cloakedPaths()
                      localPath('branch1')
                      workspaceName('Jenkins_${COMPUTERNAME}_${JOB_NAME}_Branch1')
                      credentialsConfigurer(class: 'hudson.plugins.tfs.model.AutomaticCredentialsConfigurer')
                      useUpdate('false')
                  }
              }
              configure {
                  it / scm (class: 'org.jenkinsci.plugins.multiplescms.MultiSCM') / scms << 'hudson.plugins.tfs.TeamFoundationServerScm' {
                      serverUrl('http://tfs:8080/tfs/MyOtherProduct')
                      projectPath('$/Branch2')
                      cloakedPaths()
                      localPath('branch2')
                      workspaceName('Jenkins_${COMPUTERNAME}_${JOB_NAME}_Branch2')
                      credentialsConfigurer(class: 'hudson.plugins.tfs.model.AutomaticCredentialsConfigurer')
                      useUpdate('false')
                  }
              }
          }
      

      All the documentation indicates that '<<' should always add a new node so I would expect there to be two nodes of the 'hudson.plugins.tfs.TeamFoundationServerScm', however the result is only the last node as if I had used '/'. I have tried many other options as described on the configure wiki page. All of them either lead to getting two empty 'hudson.plugins.tfs.TeamFoundationServerScm' nodes (which I can't for the life of me add any sub-nodes to), or one single, filled, node

            daspilker Daniel Spilker
            petrikvandervelde Petrik van der Velde
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: