Skip to content

cub changeorder create

cub changeorder create

Create a new changeorder or bulk create changeorders

Synopsis

Create a new changeorder or bulk create multiple changeorders by cloning existing ones.

SINGLE CHANGEORDER CREATION:

Create a new changeorder to record an entity changeorder specification.

Examples:

  # Create a change order
  cub changeorder create --space my-space bump-base-image --description "Bump the base image to 1.42"

  # Create one that says where it is headed: a Filter over Spaces
  cub changeorder create --space my-space bump-base-image --description "Bump the base image" \
    --space-filter platform/prod-spaces

  # End it at an existing boundary rather than at each unit's head
  cub changeorder create --space my-space bump-base-image --end-tag my-space/release-42-end

  # Create a changeorder from JSON
  cub changeorder create --space my-space -o json my-changeorder --from-stdin < changeorder.json

BULK CHANGEORDER CREATION:

When no positional arguments are provided, bulk create mode is activated. This mode clones existing changeorders based on filters and creates multiple new changeorders with optional modifications.

Bulk Create Examples:

  # Clone all changeorders matching a pattern with name prefixes
  cub changeorder create --where "Description LIKE '%release%'" --name-prefix archive- --dest-space archive-space

  # Clone specific changeorders to multiple spaces
  cub changeorder create --changeorder my-changeorder --dest-space dev-space,staging-space

  # Clone changeorders using a where expression for destination spaces
  cub changeorder create --where "Description LIKE 'Release%'" --where-space "Labels.Environment IN ('dev', 'staging')"

  # Clone changeorders with modifications via JSON patch
  echo '{"Description": "Archived changeorder"}' | cub changeorder create --where "CreatedAt < '2024-01-01'" --name-prefix old- --from-stdin
cub changeorder create [<slug> [--description <description>]] [flags]

Options

      --allow-exists             Allow creation of resources that already exist
      --annotation strings       annotations in key=value format; can separate by commas and/or use multiple instances of the flag
      --changeorder strings      target specific changeorders by slug or UUID for bulk create (can be repeated or comma-separated)
      --delete-gate strings      delete gates in key[=true] format; can separate by commas and/or use multiple instances of the flag
      --description string       human-readable description of the change
      --dest-space strings       destination spaces for bulk create (can be repeated or comma-separated)
      --end-tag string           tag (slug, space/slug, or UUID) marking the last revision of each unit to promote; without one, the change order tags each unit's head revision
      --filename string          Read the ConfigHub entity JSON from file, URL (https://), or stdin (-); mutually exclusive with --from-stdin
      --filter string            Filter entity to apply to the list. Specify as 'space/filter' for cross-space filters or just 'filter' for current space. Supports both slugs and UUIDs. The filter will be combined with any --where clause using AND logic. Examples: "production-filters/security-check", "my-filter-uuid", "validation-rules"
      --filter-space string      filter entity containing WHERE expression to select destination spaces for bulk create (slug or UUID)
      --from-stdin               Read the ConfigHub entity JSON (e.g., retrieved with cub <entity> get --quiet --json) from stdin; merged with command arguments on create, and merged with command arguments and existing entity on update
  -h, --help                     help for create
      --label strings            labels in key=value format; can separate by commas and/or use multiple instances of the flag
      --name-pattern string      a pattern string for name generation of clones, prefix 'template:' to use a Go template with .SourceEntitySlug to access the original ChangeOrder and .Labels to access variant labels, example: 'template:{{.SourceEntitySlug}}-{{.Labels.env}}'
      --name-prefix strings      name prefixes for bulk create (can be repeated or comma-separated)
  -o, --output string            Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
      --quiet                    No default output.
      --space-filter string      filter over Spaces (slug, space/slug, or UUID) selecting the Spaces this change order propagates into
      --update-type string       link update type to follow when propagating: UpgradeUnit (the clone lineage, the default) or MergeUnits
      --variant-labels strings   labels for bulk create in the format of key1=value1|value2,key2=value1|value2|value3
      --verbose                  Detailed output, additive with default output
      --where string             Filter expression using SQL-inspired syntax. Supports conjunctions with AND. String operators: =, !=, <, >, <=, >=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*. Pattern matching with LIKE/ILIKE uses % and _ wildcards. Regex operators (~, ~*, !~, !~*) support POSIX regular expressions. Examples: "Slug LIKE 'app-%'", "DisplayName ILIKE '%backend%'", "Slug ~ '^[a-z]+-[0-9]+$'"
      --where-space string       where expression to select destination spaces for bulk create

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output
      --space string     space ID to perform command on

SEE ALSO