Adding a Trigger Deployment Stage

Learn how to add a Trigger Deployment stage in the build pipeline.

The Trigger Deployment stage automatically triggers a deployment from the build pipeline. DevOps supports deployment to Kubernetes clusters, instance groups, and Functions.

Before you add the Trigger Deployment stage, you must have a build pipeline and a deployment pipeline associated with your DevOps project. The Trigger Deployment stage can't be added as the first stage to a build pipeline. The pipeline must have at least one Managed Build stage first.

For accessing DevOps using the Oracle Cloud Console, REST API, and CLI, see Accessing DevOps.

Using the Console

  1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
  2. Select a project and a build pipeline.
  3. Click the + icon below the Managed Build stage.
  4. To add the stage sequentially, select Add stage, or select Add parallel stage.
  5. For the stage type, select Trigger Deployment, and then click Next.
  6. Enter a name and optional description for the stage.
  7. Click Select Deployment Pipeline, select a deployment pipeline associated with your DevOps project, and then save.

    The Send Build Pipelines Parameters check box is selected by default.

    You can modify the parameters before running the build. See Configuring Parameters.

  8. (Optional) To add tags to the stage, click Show tagging options. Tagging is a metadata system that lets you organize and track the resources in your tenancy.

    If you have permissions to create a resource, you also have permissions to add free-form tags to it.

    To add a defined tag, you must have permissions to use the tag namespace.

    For more information, see Resource Tags.

  9. To add the stage to the pipeline, click Add.

    A stage preview provides a snapshot of the configuration.

You can manually run the build or automatically trigger a build run when you commit your changes to the code repository.

Using the CLI

To create a build pipeline, run the create command:

oci devops build-pipeline create --project-id

To add a Trigger Deployment stage for the pipeline, run the create-trigger-deployment-stage command:

oci devops build-pipeline-stage create-trigger-deployment-stage

Required parameters:

  • --build-pipeline-id
  • --deploy-pipeline-id
  • --is-pass-all-parameters-enabled
  • --stage-predecessor-collection

To get all the commands for build-pipeline and build-pipeline-stage:

oci devops build-pipeline -h
oci devops build-pipeline-stage -h

To get help for the create-trigger-deployment-stage command:

oci devops build-pipeline-stage create-trigger-deployment-stage -h

Using the API

To create a build pipeline, use the CreateBuildPipeline operation.

To add a Trigger Deployment stage for the pipeline, use the CreateBuildPipelineStage operation. For the buildPipelineStageType attribute, specify the value as TRIGGER_DEPLOYMENT_PIPELINE.