dcloud deploy previews configureSet up, change or turn off an app's preview environments
A preview is an app of its own on one small machine, at https://<branch>.<app>.<org>.apps.<root>. With trigger pull_request, a pull request into the app’s branch gets one when it opens and loses it when it merges or closes; with branch, every pushed branch other than the app’s gets one and loses it when the branch is deleted. A push to the branch redeploys it. It is deleted idleDays after the last push unless kept. Its env: the app’s plain variables, the secrets named in sharedSecretKeys, then envOverrides. With databaseBranch, a Postgres branch of the app’s bound database (pr-<n> for a pull request); without it, no database. Each step is the commit status `ews/preview`; the pull request gets one comment with the URL and the cost when it first serves. Previews are made as the person who pushed or opened the pull request, who needs deploy:CreatePreview on the app; at most maxPreviews at once.
Synopsis
dcloud deploy previews configure id --enabled enabled [flags]Arguments
<id>Requiredstring
Also accepted as
--id. Constraints: uuid
Flags
--enabledRequiredboolean (--enabled / --no-enabled)
Whether pull requests (or branches) get preview environments
--triggerOptionalenum
pull_request: a preview per open pull request into the app’s branch; branch: one per pushed branch
One of:
pull_request,branchDefault:
"pull_request"--env-overridesOptionalmap of string
Plain variables set in every preview on top of the app’s (a key here wins)
Constraints: key=value
Default:
{}--shared-secret-keysOptionalarray of string
Secret-bound variables of the app that previews get too; every other secret is withheld (plain values are copied)
Constraints: max 128 chars, /^[A-Za-z_][A-Za-z0-9_]*$/
Default:
[]--database-branchOptionalboolean (--database-branch / --no-database-branch)
Give each preview a Postgres branch of the app’s bound database; off: previews get no database binding
Default:
false--idle-daysOptionalnumber
Delete a preview this many days after the last push to its branch, unless kept
Constraints: integer, 1-90
Default:
7--max-previewsOptionalnumber
At most this many previews at once; the next one is refused with a commit status
Constraints: integer, 1-20
Default:
10--instance-typeOptionalstring
Machine type of a preview; null: the smallest the region offers
Constraints: 1-32 chars
Default:
nullMay be null.
Example
dcloud deploy previews configure id --enabledGenerated from the API description, the same one the API checks requests against and the CLI is built from.