Configure chains to run other chains

When you create a chain, you can configure it to run child chains. The parent chain can interrupt its child jobs whenever it is stopped.

Note: PulseUno uses agents to run chains. By default, an agent can run one chain at a time. To run multiple chains in parallel, make sure you have enough available agents. For details about agents, see Manage agents.

To configure a chain to run another chain:

  1. On the top navigation bar, select a space from the spaces list.
  2. On the Products page, select a product or Git repository.
  3. On the sidebar, select Chains.
  4. Open a chain from the chain list and click Edit.

    Or create a new chain, as described in Create chains.

  5. In the Steps tab, click Add step to chain .

  6. From the Add Step list, add the Run another chain step.

  7. Click the step you just added and enter the following configuration details.

    Field Description
    Title (Optional) Rename the plugin step.
    Chain

    Select the chain you want to run using this step.

    You can select a chain from a product in a different space, if you have defined that product as a trusted product. For details, see Define trusted products for Git repository.

    Variables to pass to chain

    (Optional) Specify the variables to use in the child chain. If the same variables are defined in the child chain, they are overridden.

    Enter each variable on a separate line in this format:

    KEY=VALUE

    Two variables are defined by default:

    • branch: The branch to fetch in the child run. By default, the child chain runs on the same stream/branch as the parent chain.

      Note: To run the child chain on a branch in a different Git repository, your product must be set as trusted for the specified Git repository. For details, see Define trusted products for Git repository.

    • changeset_id: The ID of the changeset to fetch in the child run. This variable supports the following special values:

      • <DEFAULT> Depends on the location of the child chain. If the child chain is in the same product as the parent chain, the child chain is run with the same changeset IDs as the parent. If the child chain is in a different product, the changeset IDs are the latest.

      • <PARENT> IDs of changesets with which the parent chain runs.

      • <HEAD> The latest changeset IDs in the child chain's product.

    Wait for 'other' chain run results

    By default, the parent chain does not wait for the child chain to finish, and continues to run.

    Select this option to make the parent chain wait until the child chain finishes. This way, the parent chain can take account of the child chain's result. If you stop the parent chain while it is waiting for a child chain, the child chain also stops.

    Note: Some steps, such as Maven or Gradle, may not be interruptible, to avoid leaving the build in an indeterminate state. In this case, PulseUno waits for the step to complete and then stops the child chain.

    Caution: By default, only one chain at a time can run on an agent. If you choose to wait for chain run results, make sure you have an available agent on which to run the child chain. Otherwise, the child chain is triggered but doesn't run.

    Output variables (Optional) Specify the output variables to be passed to other steps down the chain. For details, see Publish output variables.
    Control options

    (Optional) Define the control options for the plugin step:

    • Enable step. By default, the step is enabled to run. Clear this option if you need to deactivate the step.

      Disabled steps are skipped when the chain runs.

    • Fail the step. Specify the conditions for failing the step, such as unit test failures, findings criteria, and/or console log entries.

    • Mark step as unstable. Specify the conditions for making the step unstable, such as unit test failures, findings criteria, and/or console log entries.

Back to top

See also: