Declarative pipeline: how to execute steps before SCM checkout

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Declarative pipeline: how to execute steps before SCM checkout

elifarley
The checkout scm step, as I understand it, is automatically executed in a declarative pipeline. You don't have to declare it.

However, I need to execute a shell script just before checking out the code.

How can I achieve this in a declarative pipeline?

Thanks!

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/42c32096-03db-474f-996e-9a7008e9c45a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Declarative pipeline: how to execute steps before SCM checkout

Mark Waite-2
As far as I understand it, you'll need to prevent the implicit checkout that is part of declarative, and then perform the checkout yourself within the declarative pipeline.

Refer to declarative options and the skipDefaultCheckout.

Mark Waite

On Mon, Sep 11, 2017 at 7:32 PM Elifarley Cruz <[hidden email]> wrote:
The checkout scm step, as I understand it, is automatically executed in a declarative pipeline. You don't have to declare it.

However, I need to execute a shell script just before checking out the code.

How can I achieve this in a declarative pipeline?

Thanks!

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/42c32096-03db-474f-996e-9a7008e9c45a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtH07MAduFd2r0b9HA1AiQD6_aCVw9yiW3qXzsPMjzrJBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Declarative pipeline: how to execute steps before SCM checkout

elifarley
Thanks, that worked as you described, but what if I need to perform a script BEFORE the code of a global shared library is checked out?

On Monday, September 11, 2017 at 10:51:47 PM UTC-3, Mark Waite wrote:
As far as I understand it, you'll need to prevent the implicit checkout that is part of declarative, and then perform the checkout yourself within the declarative pipeline.

Refer to <a href="https://jenkins.io/doc/book/pipeline/syntax/#options" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fbook%2Fpipeline%2Fsyntax%2F%23options\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfZBHdUzreKJ09udL0pvBNjjlr_Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fbook%2Fpipeline%2Fsyntax%2F%23options\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfZBHdUzreKJ09udL0pvBNjjlr_Q&#39;;return true;">declarative options and the skipDefaultCheckout.

Mark Waite

On Mon, Sep 11, 2017 at 7:32 PM Elifarley Cruz <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ypq8YtkYAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">elif...@...> wrote:
The checkout scm step, as I understand it, is automatically executed in a declarative pipeline. You don't have to declare it.

However, I need to execute a shell script just before checking out the code.

How can I achieve this in a declarative pipeline?

Thanks!

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ypq8YtkYAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/42c32096-03db-474f-996e-9a7008e9c45a%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/42c32096-03db-474f-996e-9a7008e9c45a%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/42c32096-03db-474f-996e-9a7008e9c45a%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/42c32096-03db-474f-996e-9a7008e9c45a%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b7255966-a7fb-4691-8ba9-65528ab67465%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Declarative pipeline: how to execute steps before SCM checkout

Mark Waite-2
I don't know of a way to inject yourself prior to a shared pipeline library.

On Tue, Sep 19, 2017 at 2:37 PM Elifarley Cruz <[hidden email]> wrote:
Thanks, that worked as you described, but what if I need to perform a script BEFORE the code of a global shared library is checked out?


On Monday, September 11, 2017 at 10:51:47 PM UTC-3, Mark Waite wrote:
As far as I understand it, you'll need to prevent the implicit checkout that is part of declarative, and then perform the checkout yourself within the declarative pipeline.

Refer to declarative options and the skipDefaultCheckout.

Mark Waite

On Mon, Sep 11, 2017 at 7:32 PM Elifarley Cruz <[hidden email]> wrote:
The checkout scm step, as I understand it, is automatically executed in a declarative pipeline. You don't have to declare it.

However, I need to execute a shell script just before checking out the code.

How can I achieve this in a declarative pipeline?

Thanks!

--
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 [hidden email].

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b7255966-a7fb-4691-8ba9-65528ab67465%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtECr55xvGTDfBjMiFQKmYb2twDVN7MoMvRRu%3DbX3YhUWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.