Trigger Pipeline
Start another pipeline from within a pipeline using the trigger-pipeline step. Split your automation across pipelines and filter triggers by branch or tag.
Start the execution of one pipeline from another pipeline.
Use this step to split your automation across two or more pipelines for better management and reusability.
This step initiates the pipeline execution and does not wait for it to finish. The triggered pipeline continues running asynchronously.
Syntax
steps:
step-name:
type: trigger-pipeline
pipeline: "2efeaf06-7d87-4092-ba66-94877c6f2d47" # pipeline ID
branch_filter: master # optional
ref: refs/heads/master # optional| Parameter | Description | Required |
|---|---|---|
| title | The display name of the step. | No |
| type | The type of the Microtica built-in step. Should always be trigger-pipeline for this type of step. | Yes |
| pipeline | The ID of an existing pipeline to be triggered. | Yes |
| branch_filter | Initiate pipeline execution only for commit/manual trigger on specified branch. If not specified, pipeline will be triggered on every pipeline execution. E.g. develop, feature/upgrade-eks etc. | No |
| ref | Branch or tag ref the triggered pipeline should pull the code from. Default: refs/heads/master | No |
Trigger a pipeline on commits to a specific branch
You can trigger another pipeline only when the parent pipeline was triggered from a specific branch or tag.
This is useful when you want to split pipeline logic across two or more pipelines. For example, one pipeline can run the build, test, and packaging, then trigger another pipeline that deploys the code to a specific environment (dev, test, prod) based on the branch the parent pipeline was triggered from.
steps:
Clone:
title: Clone my source code from Git
type: git-clone
BuildAndTest:
title: Build and test my service
image: node:12-alpine
commands:
- npm install
- npm run build
TriggerAnotherPipeline:
title: Trigger my deployment pipeline
type: trigger-pipeline
pipeline: "2efeaf06-7d87-4092-ba66-94877c6f2d47" # pipeline ID
branch_filter: develop
ref: refs/heads/developWith this configuration, the pipeline triggers another pipeline with ID 2efeaf06-7d87-4092-ba66-94877c6f2d47 only if the parent pipeline was triggered from the develop branch.
Setting the ref value to the develop branch tells the triggered pipeline to pull the code from the develop branch.
Next steps
Deploy Application
Re-deploy an application to a Kubernetes cluster with the deploy step. Set the cluster, service, and image tag, and optionally filter the deploy by branch.
CloudFormation Component
Package a CloudFormation template into a deployable Microtica component with the cfn-component step. Map template parameters to component inputs, with a schema.