Skip to main content

Groovy scripting in place of shell scripting



  • Official comment
    Owen Mehegan

    Hi Tim -

    It is true that any Groovy code you write inside a Scripted Pipeline job is always going to be run on the master. Thus, depending on what you use Groovy for, this can definitely have a negative impact on performance. It's just something that you should be aware of as a user; I think the greater point of the "keep things in shell scripts" advice is to encourage habits that farm that work out to executors. It's not a hard and fast rule, you can do what you want, but you should be aware of the implications. 

    This blog post has some more technical details and best practices for making use of Pipeline:

    I hope this is helpful, if you have further questions feel free to ask!

  • Denys Digtiar

    Jenkins Pipeline does interpret all its Groovy scripts on the master. It is also not your regular Groovy runtime. It writes to the disk heavily since it tries to persist the whole state of execution for durability. Here are links that should shed more light on it:

    Scaling Pipelines

    Best Practices for Scalable Pipeline Code


Please sign in to leave a comment.

About CloudBees Support

Our Support Engineers are available to help with any questions or problems you may have with any of our products.