Skip to content

cub variant promote

cub variant promote

Promote a variant space to match its upstream space

Synopsis

Promote a variant space to match changes in its upstream space.

The space must have been created by "cub variant create", which stamps an "UpstreamSpaceID" annotation recording the upstream space it was cloned from. Promote reconciles the variant with that upstream in three steps:

  1. Upgrade every unit whose upstream unit has advanced (the unit's UpstreamRevisionNum is behind the upstream unit's HeadRevisionNum), merging the upstream changes. Equivalent to "cub unit update --patch --upgrade --where 'UpstreamRevisionNum < UpstreamUnit.HeadRevisionNum'".
  2. Clone any units added to the upstream space since the variant was created or last promoted, linking each clone to its upstream unit.
  3. Copy the new units' non-UpgradeUnit links, retargeting a link to its downstream copy when it points at another unit in the upstream space.

Promote waits for triggers to complete. Use --dry-run to preview: the units that would be upgraded (add -o mutations to see the changes) and the units that would be added.

Examples:

  # Promote a variant to match its upstream
  cub variant promote web-prod

  # Preview the changes, including the mutations
  cub variant promote web-prod --dry-run -o mutations

  # Promote within a changeset, with a change description
  cub variant promote web-prod --changeset release-2024-06 --change-desc "Promote to prod"
cub variant promote <space> [flags]

Options

      --change-desc string   change description recorded on the upgraded and cloned units
      --changeset string     changeset to associate the upgraded and cloned units with
      --dry-run              preview the units that would be upgraded and added without changing anything
  -h, --help                 help for promote
  -o, --output string        Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
      --quiet                No default output.
      --verbose              Detailed output, additive with default output

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output

SEE ALSO