Using automation rules

This document describes automation rules, which are actions that can be taken on your delivery pipeline automatically. For example, you can configure your delivery pipeline so that promotion into a specific target happens automatically, under the right circumstances.

You can only use automation rules that are built into Cloud Deploy. The available automation rules are listed in this document.

Available automation rules

The following automation rules are available in Cloud Deploy:

Rule Description
timedPromoteReleaseRule Automatically promote from one target to the next

based on a cron schedule.

promoteReleaseRule Automatically promotes a release into the indicated target after successful

rollout in the previous target in the progression.

advanceRolloutRule Automatically advances a rollout from the indicated

phase to the next phase.

repairRolloutRule Automatically retry the failed job or jobs in the rollout a

specified number of times, and roll back if all retries fail.

Configure automation rules

Configuration for each automation rule depends on the specific rule. This section describes configuration that all rules have in common, as well as how to configure each of the available rules.

Each automation rule is configured as part of the configuration for the automation resource. This can be inside the same file as configuration for the relevant delivery pipeline (usually called clouddeploy.yaml) or in any file you want. Learn more about configuring automations.

The following sections describe configuration specific to individual automation rules. See Automate your deployment for configuration of the automation itself.

Configure a timedPromoteReleaseRule automation rule

The timedPromoteReleaseRule rule lets you schedule when to promote a release from the selected target or targets to the next target in the progression, or to a specified target. When you configure a timedPromoteReleaseRule automation, you specify when to promote the release, based on a cron schedule.

rules:
- timedPromoteReleaseRule:
    id: "[RULE_ID]"
    schedule: "[CRON]"
    timeZone: "[TIME_ZONE]"
    destinationTargetId: "[TO_TARGET]"
    destinationPhase: "[TO_PHASE]"

Where:

  • [RULE_ID]

    Is any name you want to give to this rule. This name must be unique within the automation resource.

  • [CRON]

    Is the cron schedule that specifies when to promote the release. Use this schedule to specify the date and time when you want to promote the release.

    This schedule uses the standard cron syntax:

    * * * * *

    In this schedule...

    • The first position is the minute (0-59).
    • The second position is the hour (0-23).
    • The third position is the day of the month (1-31).
    • The fourth position is the month (1-12).
    • The fifth position is the day of the week (0-6, Sunday to Saturday)

    For example, if your timed-promote rule includes the following schedule: 0 9 * * 1, your release is promoted every Monday at 9am.

    You can also use standard cron schedule features, such as:

    • A range (0-5)
    • A list (1,3,5)
    • A step function (for example, */3 in the hours field activates every third hour)
  • [TIME_ZONE]

    Is the time zone you want to use for scheduling the promotion, in IANA format.

  • [TO_TARGET]

    Is the targetId of the target to promote to, or @next to promote the release automatically to the next target after the target specified in the selector.targets property in this automation config. This is optional; the default is @next.

  • [TO_PHASE]

    Is the phase name of the phase you want to promote to, for example canary-25 or stable. This property is optional; if you omit it, the release is promoted to the first phase in the target.

Configure a promoteReleaseRule automation rule