Skip to main content

How to call a groovy function from a Jenkinsfile?


1 comment

  • Carlos Rodriguez Lopez

    Please, have a look at the following example for loading files, it is not for declarative pipelines but it could be a good starting point. Have a look at the files that are being loaded are in the same directory.

    Validate those steps with the Snippet Generator to verify that they are valid in your environment.

    Assuming that deployer.groovy file is in the current directory with your Jenkinsfile


    deployer = fileLoader.load ('deployer')


    deployer = load ('deployer.groovy')

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.