cwp deploy
shipped 1.0.0cwp deploy [env] [flags]
Acts on the environment the project makes obvious: the only one it defines, or the one called dev. Name another to act there. A project with several and no dev has to name one.
| Argument | What it is | Default |
|---|---|---|
[env] | environment to write to (default: default_environment in cwp.yml) |
| Flag | What it does | Default |
|---|---|---|
--only <what> | narrow to one artifact, or to code for the tracked paths | |
--force | override the refusals a crossing makes | off |
--no-backup | skip the remote backup taken before the write | on |
--delete | mirror the tracked paths: also remove remote files that are absent locally | off |
--prune | with —only roles or —only inventory: delete what the file does not list | off |
--exact | with —only inventory: pin to the recorded versions | off |
--replace | with —only bricks: overwrite items that already exist instead of skipping them | off |
--sensitive | does nothing since 2.0: credentials never enter the tree, and customCss travels on its own | off |
--skip-in-use | with —only bricks: leave items the site still references in place | off |
--skip-incomplete-fonts | with —only bricks: push everything except fonts the tree carries no faces for | off |
--keep-superseded-fonts | with —only bricks: leave the font files this import replaces in the media library | off |
--no-snapshot | with —only bricks: skip the local design-system export taken before a replace | on |
--overwrite-conflicts | with —only content: overwrite posts that changed on the target since cwp last saw them | off |
--media <mode> | with —only content: attachments the target lacks, upload | require | |
--publish | with —only content: a post the target does not have yet arrives published | off |
--status <status> | with —only content: set an existing post’s status too | |
--delete-terms | with —only content: remove terms of a declared taxonomy the tree no longer describes | off |
--skip-missing-targets | with —only content: drop a menu entry whose target is absent instead of refusing | off |
--yes | skip the confirmation prompt | off |
--with-agent | with —dry-run on a host with no shell: install and remove the PHP agent so the plan is real | off |
Plus the shared flags --json, -v, --verbose, -q, --quiet and --dry-run.
What it does
Everything cwp push does, and then the remote post-steps:
wp cache flush, the record of what this deploy sent, the builder’s own
regeneration (for Bricks, the CSS) and the post-deploy hook.
They run whether or not your project tracks any code. They belong to the
run, not to the file transfer. The cache is stale because of the pages as much
as the files, and a project that carries content and no tracked paths deploys
like any other. The record says what moved:
{ "command": "deploy", "items": { "content": 12, "settings": 3, "paths": 1 } }
One factory in the command manifest generates push and deploy. Their
arguments, their flags and their guard ladder are the same objects, not two
lists that somebody keeps in step. Read cwp push for the guards,
the verification and the --delete semantics; all of it applies here unchanged.
Use deploy unless you have a reason not to. push moves the files and
leaves the site holding a stale cache and, on Bricks, stale generated CSS. That
looks like a deploy that did not work.
Example
cwp deploy dev # the ordinary case
cwp deploy prod --force # prod is protected; --force is required
cwp deploy dev --delete # make the remote match local exactly
What it does not do
It does not push the database. It does not run the post-steps during a dry run: a dry run runs no hooks at all.
It does not deploy anything outside tracked. If a change needs a plugin that is
not there, that is cwp plugins apply.