Skip to main content

How to call a groovy function from a Jenkinsfile?

Comments

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

    Change 

    deployer = fileLoader.load ('deployer')
    

    For 

    deployer = load ('deployer.groovy')
    0

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.