Promotion Flow YAML

YAML specifications for defining the orchestration flow for product promotion

Codefresh provides two options for defining manifests for promotion entities: Chart mode and YAML mode.

If you prefer working with YAML, create the manifest using the example Promotion Flow YAML below, and the table with field descriptions.

Once configured and committed, the settings are saved as a Custom Resource Definition (CRD) within the Shared Configuration Repository in the GitOps Runtime specified as the Configuration Runtime.

Promotion Flow YAML example

Here’s an example of the Promotion Flow manifest. The table that follows describes the fields in the Promotion Flow manifest.

apiVersion: codefresh.io/v1beta1
kind: PromotionFlow
metadata:
  name: global-parallel-flow
spec:
  triggerEnvironment: dev
  steps:
    - environment: staging
      dependsOn:
        - dev
      policy:
        action: commit
      hooks:
        onStart: slack-start-hook
        onSuccess: simple-fail
        onFail: jira-open-bug
    - environment: production
      dependsOn:
        - staging
      policy:
        action: commit
  hooks:
    onStart: slack-start-hook
    onSuccess: success-hook-test
    onFail: slack-fail-hook

Promotion Flow YAML field descriptions

Field Description Type Required/Default
metadata.name The name of the Promotion Policy, which must conform to the naming conventions for Kubernetes resources. Useful if the name indicates the purpose of this Promotion Policy - where and how it is intended to be used. For example, productionDeployments. string Required
spec.steps The step in the Promotion Flow that defines the list of target environments and their dependencies.
At least one target environment and dependency must be defined.
array Required
spec.steps.environment The name of the specific target environment for which to trigger the promotion. string Required
spec.steps.environment.dependsOn One or more environments that must be successfully promoted before promotion can be triggered in the succeeding environments. array Required
spec.steps.environment.policy The Pre-Action Workflow, Action, and Post-Action Workflow to implement for the Promotion Policy through the action, preAction, and postAction attributes.
The Action attribute is required.
An policy attribute defined here overrides global Policies that match the product/environment. See Promotion Policy implementation logic for information on how they are applied.
object Optional
spec.steps.environment.policy.preAction The name of the Promotion Workflow to execute before spec.steps.policy.action. string Optional
spec.steps..environment.policy.postAction The name of the Promotion Workflow to execute after spec.steps.policy.action. string Optional
spec.steps.environment.policy.action The action that should trigger the promotion in the target environment for this Promotion Policy.
Can be one of the following:
  • commit: Executes a commit operation on the target application.
  • pr: Executes a commit and opens a pull request for the target application.
    Useful when you need manual approval before commit.
  • none: Does not execute any action on the target application.
    In this case, the Post-Action workflow must include a step that is equivalent
string Required
spec.steps.environment.hooks The promotion hooks to run for the environment, and can be any of the following:
  • onStart: The promotion hook to run when the promotion reaches the environment.
  • onSuccess: The promotion hook to run when the promotion completes successfully in the environment.
  • onFail: The promotion hook to run when the promotion fails in the environment.
string Optional
spec.hooks The promotion hooks to run for the product release, and can be any of the following:
  • onStart: The promotion hook to run when the release is initiated.
  • onSuccess: The promotion hook to run when the release completes successfully.
  • onFail: The promotion hook to run when the release fails.
string Optional

Configure Promotion Flows
Configure hooks in Promotion Workflows
Product YAML
Promotion Policy YAML
Promotion Template YAML