workflow scm step

122 views
Skip to first unread message

James Nord (jnord)

unread,
Aug 15, 2014, 11:34:08 AM8/15/14
to jenkins...@googlegroups.com

Hi all,

 

I’m trying to get the new workflow to checkout from git with some additional behaviours (clone to specific dir)

 

Because of this the “git” step won’t work – so I need to fall back to

scm $class: 'hudson.plugins.git.GitSCM’ ….

But the additional behaviours aren’t defined in the top of the <scm…> block so I’m wondering how would I pass something like the following as a command.

 

  <scm class="hudson.plugins.git.GitSCM">

    <userRemoteConfigs>

      <hudson.plugins.git.UserRemoteConfig>

        <url>ssh://foobar@whizbang/git/repo</url>

      </hudson.plugins.git.UserRemoteConfig>

    </userRemoteConfigs>

    <branches>

      <hudson.plugins.git.BranchSpec>

        <name>*/master</name>

      </hudson.plugins.git.BranchSpec>

    </branches>

    <extensions>

      <hudson.plugins.git.extensions.impl.IgnoreNotifyCommit/>

      <hudson.plugins.git.extensions.impl.RelativeTargetDirectory>

        <relativeTargetDir>myfunkydirectory</relativeTargetDir>

      </hudson.plugins.git.extensions.impl.RelativeTargetDirectory>

    </extensions>

  </scm>

 

Anyone any suggestions?

 

/James

Clifford Sanders

unread,
Feb 18, 2015, 11:53:40 AM2/18/15
to jenkins...@googlegroups.com, jn...@cisco.com
Hi James,

try:

  checkout changelog: true, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, , extensions: [[$class: 'hudson.plugins.git.extensions.impl.RelativeTargetDirectory', relativeTargetDir: 'myfunkydirectory']], submoduleCfg: [], userRemoteConfigs: [[url: 'ssh://foobar@whizbang/git/repo']]]


Clifford
Reply all
Reply to author
Forward
0 new messages