The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Pipeline: Groovy

load: Evaluate a Groovy source file into the Pipeline script

Takes a filename in the workspace and runs it as Groovy source text.

The loaded file can contain statements at top level or just load and run a closure. For example:

    def pipeline
    node('agent') {
        pipeline = load 'pipeline.groovy'
        pipeline.functionA()
    }
    pipeline.functionB()
    

Where pipeline.groovy defines functionA and functionB functions (among others) before ending with return this;

  • path : String

    Current directory (pwd()) relative path to the Groovy file to load.

parallel: Execute in parallel

Takes a map from branch names to closures and an optional argument failFast which will terminate all branches upon a failure in any other branch:

    parallel firstBranch: {
        // do something
    }, secondBranch: {
        // do something else
    },
    failFast: true|false
    

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.