Scripting and Functions

In some situations, using commands and utils is not enough. For example in cases like:

  • Complex data mappings.

  • Complex or very long running algorithms.

  • Complex string manipulations.

In such cases, it makes sense to delegate the task to a script or function which can execute it in a more clean and efficient way.

In PIPEFORCE you have multiple options to do so. Here are the most common options and their pros and cons:

Option

Pros

Cons

Option

Pros

Cons

Pipeline Expression Language

  • Embedded in the pipeline YAML syntax → easy to use.

  • Good performing for short running executions

  • Limited to eval (one-line expressions)

  • Not easy readable for complex expressions

Embedded Groovy

  • Can be called via a simple command: script.groovy

  • Script is directly embedded into the pipeline → Easy to read

  • Good performing for short and medium running executions

  • Additional language to learn / use.

Python as a Service

  • Can be easily called from inside a pipeline

  • Good performing for long running executions.

  • Additional language to learn / use.

  • Overhead to transfer data to the service slows down execution time and increases resource consumption.

  • Additional deployment step required (but this is by default automated in PIPEFORCE).

  • Available only in Enterprise subscription.

Custom Microservice

  • You can use any language you prefer

  • Can be scaled nearly “unlimited”

  • Very good performing for long and very long running executions.

  • No timeout limit.

  • Additional language to learn / use.

  • Overhead to transfer data to the service slows down execution time and increases resource consumption.

  • Additional effort to create and manage the microservice (but with many tooling support from PIPEFORCE).

  • Available only in Enterprise subscription.