You can add your own custom commands or custom utils to PIPEFORCE in a few steps.
After this you can use them inside your pipeline similar to the built-in commands and utils.
It is also possible to shadow any of the built-in commands and utils so you can change behaviour or mock certain parts for development or testing for example.
This can can be done by creating script in your app.
Custom Command with Python
Since Version 9.0
Once this function has been auto-deployed, you can call it similar to a command from inside any pipeline or using the Command API.
The function name will become the command name and the parameters will become the arguments to the function. For example, lets assume a function like this, which is deployed in an app with name io.pipeforce.myapp:
This example will execute the function myfunction(text) on the script myscript inside the app io.pipeforce.myapp. The result will then be returned to the pipeline body and can be processed by subsequent commands as usual. The final output of the pipeline in this example would be:
In order to create your own custom util, you have to simply do this:
Create a Groovy script with a method of name function in it at property store path global/app/io.pipeforce.myapp/util/<utilName>.<utilFunction> and with type set to text/x-groovy. After this, you can use it inside a Pipeline Expression using @<utilName>.<utilFunction>().