Custom script

2 minute read

If you want to execute another step before or after a deploy step in your pipeline, you can use a custom script in CloudBees Release Orchestration SaaS. You can configure a custom script to execute a build step or run a regression or performance test from a pipeline automatically. You can use Shell, Maven, or Gradle in a custom script.

Adding a custom script

Set up your custom script step and any associated job parameters in Pipeline composer. You can also set a schedule and enable notifications.

To add a custom script step:

  1. From the CloudBees Release Orchestration SaaS Home page, select Orchestration  Pipeline composer.

  2. Select an existing pipeline, or create a new pipeline. Refer to Working with pipelines for more information.

  3. Select Custom from the icon options, which adds it to your pipeline.

    The custom tool
    Figure 1. Adding a custom script step to a pipeline
  4. On the right pane:

    1. Select Custom tool name from the options.

    2. Depending on the custom tool added, enter any other required settings, such as Controller name or Job name.

    3. Enter any required job parameters, depending on the selected custom tool. To learn more about configuring specific tools, refer to Setting up.

    4. (Optional) Select Modify parameters during execution if you want to update your custom tool job parameters during the pipeline execution.

    5. (Optional) Select Schedule. Refer to Scheduling for more information.

    6. (Optional) Select Notification. Refer to Notifications for more information.

  5. Select UPDATE.

You have added a custom script step to your pipeline.

Creating a custom script

With CloudBees Release Orchestration SaaS, you can create a new pipeline with a custom script.

When you add a custom script step, a new job is created. If your CI tool is not able to access the pipeline definition and enable the pipeline, the agent returns an error. You can edit the custom script only after enabling the pipeline.

To create a custom script:

  1. From the CloudBees Release Orchestration SaaS Home page, select Orchestration  Pipeline composer.

  2. Select an existing pipeline, or create a new pipeline. Refer to Working with pipelines for more information.

  3. Select Custom from the icon options, which adds it to your pipeline.

  4. On the right pane:

    1. Select Custom script from the custom tool name options.

    2. Select Add New Script +.

      Creating script
      Figure 2. Accessing Add New Script + by selecting Custom Script
    3. Enter a Script name.

    4. Select Type of script from the options.

    5. Enter or paste your custom script into Add new custom script.

    6. Select SAVE.

  5. Select Update.

You have created a custom script and added it to your pipeline.