dcloud ci environments put

Create an environment or change its protection rules

IAM ci:PutEnvironmentChanges state

Fields left out keep their value. `reviewers` are IAM user ids of this organization (up to six); one of them must approve each job. `deploymentBranchPolicy`: all, protected (branches with a protection rule) or custom (`deploymentPatterns`). Environment secrets are the org secrets environment with the same slug.

Synopsis

dcloud ci environments put repoId name [flags]

Arguments

  • <repoId>Required

    string

    Also accepted as --repo-id. Constraints: uuid

  • <name>Required

    string

    Also accepted as --name. Constraints: 1-255 chars

Flags

  • --urlOptional

    string

    Link shown for the environment (where it is deployed), up to 2000 characters; null clears it; omitted: unchanged (none on a new environment)

    Constraints: url, max 2000 chars

    May be null.

  • --wait-timer-minutesOptional

    number

    Minutes a job waits at the environment before it continues, 0 to 43,200; omitted: unchanged (0 on a new environment). A job is held at most 5 h 30 min, so a longer timer never ends

    Constraints: integer, 0-43200

  • --reviewersOptional

    array of string

    IAM user ids of this organization (400 otherwise), up to 6; one of them must approve each job; empty: no review; omitted: unchanged (none on a new environment)

    Constraints: uuid

  • --prevent-self-reviewOptional

    boolean (--prevent-self-review / --no-prevent-self-review)

    The person who started the run may not approve it; omitted: unchanged (off on a new environment)

  • --deployment-branch-policyOptional

    enum

    Which refs may deploy: all; protected (branches with a protection rule); custom (refs matching deploymentPatterns, which must then be in the same request, 400 otherwise); omitted: unchanged (all on a new environment)

    One of: all, protected, custom

  • --deployment-patternsOptional

    array of json

    Up to 50 { type: branch | tag, pattern } globs (pattern 1 to 255 characters), used by the custom policy; replaces the list; omitted: unchanged (none on a new environment)

Example

dcloud ci environments put repoId name

Generated from the API description, the same one the API checks requests against and the CLI is built from.