Hi all,

Since there is no TFS plugin support in pipeline [1] I am trying to do
the association of SCM to a job via groovy. Something like:

def jenkins = Jenkins.getInstance()
def job = jenkins.getItem("JOB_NAME")
def scm = new hudson.plugins.tfs.TeamFoundationServerScm(serverUrl,
                       projectPath, workspaceName, userName, password)

but then, I want to associate scm to my current job. I noticed that jobs
used to have a scm property, but not it's SCMs, I assume in preparation
to support several SCM's in a single pipeline.

I tried:

job.SCMs.put((scm.getKey()), (scm))

with no luck [2]. I also didn't find any method that will let me
dynamically set the SCM.

Any pointers on how to get this working?

I do get that the "right" solution is to add pipeline support for the
TFS plugin, and am willing to explore that options. For now, I just want
to get something going.

[1] https://issues.jenkins-ci.org/browse/JENKINS-31803
[2] No signature of method: java.util.LinkedHashMap$LinkedValues.put()
is applicable for argument types: (java.lang.String,
hudson.plugins.tfs.TeamFoundationServerScm)

-- 
Cheers,

Alejandro

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/bcaca3e5-3987-0e79-d951-2e5f1e8f1c44%40ni.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to