You can run a pipeline from the pipeline card, in pipeline edit mode, and from the pipeline execution. You can also use the available triggers to have Code Stream run a pipeline when certain events occur. Service Broker users can add and run a pipeline that has been released in Code Stream.

When all the stages and tasks in your pipeline are valid, the pipeline is ready to be released, run, or triggered.

To run or trigger your pipeline using Code Stream, you can enable and run the pipeline either from the pipeline card, or while you are in the pipeline. Then, you can view the pipeline execution to confirm that the pipeline built, tested, and deployed your code.

When a pipeline execution is in progress, you can delete the execution if you are an administrator or a non-admin user.

  • Administrator: To delete a pipeline execution when it is running, click Executions. On the execution to delete, click Actions > Delete.
  • Non-admin user: To delete a running pipeline execution, click Executions, and click Alt Shift d.

When a pipeline execution is in progress and appears to be stuck, an administrator can refresh the execution from the Executions page or the Execution details page.

  • Executions page: Click Executions. On the execution to refresh, click Actions > Sync.
  • Execution details page: Click Executions, click the link to the execution details, and click Actions > Sync.

To run a pipeline when specific events occur, use the triggers.

  • Git trigger can run a pipeline when developers update code.
  • Gerrit trigger can run a pipeline when code reviews occur.
  • Docker trigger can run a pipeline when an artifact is created in a Docker registry.
  • The curl command or wget command can have Jenkins run a pipeline after a Jenkins build finishes.

For more information about using the triggers, see Triggering pipelines in Code Stream.

The following procedure shows you how to run a pipeline from the pipeline card, view executions, see execution details, and use the actions. It also shows you how to release a pipeline so that you can add it to VMware Service Broker.

Prerequisites

Procedure

  1. Enable your pipeline.
    To run or release a pipeline, you must enable it first.
    1. Click Pipelines.
    2. On your pipeline card, click Actions > Enable.

      You can also enable your pipeline while you are in the pipeline. If your pipeline is already enabled, Run is active, and the Actions menu displays Disable.

  2. (Optional) Release your pipeline.
    If you want to make your pipeline available as a catalog item in VMware Service Broker, you must release it in Code Stream.
    1. Click Pipelines.
    2. On your pipeline card, click Actions > Release.
      You can also release your pipeline while you are in the pipeline.
      Note: If the pipeline requires more that 120 minutes to run, provide an approximate execution time as a request timeout value. To set or review the request timeout for a project, open Service Broker as administrator and select Infrastructure > Projects. Click your project name and then click Provisioning.

      If the request timeout value is not set, an execution that requires more than 120 minutes to run appears as failed with a callback timeout request error. However, the pipeline execution is not affected.

  3. On the pipeline card, click Run.
  4. To view the pipeline as it runs, click Executions.
    The pipeline runs each stage in sequence, and the pipeline execution displays a status icon for each stage. If the pipeline includes a user operation task, a user must approve the task for the pipeline to continue to run. When a user operation task is used, the pipeline stops running and waits for the required user to approve the task.
    For example, you might use the user operation task to approve the deployment of code to a production environment.
    If the User Operation task has an expiration timeout set in days, hours, or minutes, the required user must approve the pipeline before the task expires. Otherwise, the pipeline fails as expected.
  5. To see the pipeline stage that is waiting for user approval, click the status icon for the stage.
  6. To see the details for the task, click the task.
    After the required user approves the task, a user who has the appropriate role must resume the pipeline. For required roles, see How do I manage user access and approvals in Code Stream.
    If an execution fails, you must triage and fix the cause of the failure. Then, go to the execution, and click Actions > Re-run.
    You can only resume primary pipeline executions. You cannot resume nested executions.
  7. From the pipeline execution, you can click Actions to view the pipeline, and select an action such as Pause, Cancel, and more. When a pipeline execution is in progress, if you are an administer you can delete or sync the pipeline execution. If you are a non-admin user, you can delete a running pipeline.

Results

Congratulations! You ran a pipeline, examined the pipeline execution, and viewed a user operation task that required approval for the pipeline to continue to run. You also used the Actions menu in the pipeline execution to return to the pipeline model so that you can make any required changes.

What to do next

To learn more about using Code Stream to automate your software release cycle, see Tutorials for using Code Stream.