"checkout scm+recursiveSubmodules"?

7 views
Skip to first unread message

Cristian Morales Vega

unread,
Sep 30, 2020, 11:19:36 AM9/30/20
to jenkins...@googlegroups.com
Hi,

I have limited control over the Jenkins instance and I can't configure
it to send me a scm global variable with recursiveSubmodules already
set.

I'm new to Jenkins, don't know Groovy and I'm using a declarative pipeline.

Ideally I guess I would like to put something in my Jenkinsfile to
modify the scm global variable adding recursiveSubmodules if it isn't
already there, before anything else tries to read it. But I don't
think this is going to be possible.

So I'm fine with using skipDefaultCheckout() and explicitly calling
the "checkout" step. But I would like to do it with the contents of
the scm global variable... plus recursiveSubmodules if it isn't
already set.

If the Jenkinsfile hardcodes the supposition that the scm global
variable contains a GitSCM I don't care too much.

Is this possible?

Regards.

Mark Waite

unread,
Sep 30, 2020, 11:39:27 AM9/30/20
to Jenkins Users
If an example is OK, you might refer to https://github.com/MarkEWaite/jenkins-bugs/blob/3b4e8e2a638851b2b7c96abc5a70892836d14b2f/Jenkinsfile#L19 for one way of expressing that in a declarative pipeline.

There are other examples on various branches in that repository if that one is not sufficient

--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAOWQn3RhxchV7_R9AQySahN6zk7ekT6WorXSqXfCOz7vexuVDA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages