exp:expmigrationdeploy
Deploy this installation's migrations to one or many remotes at once, in sync: preflight and verify on all, then switch all, or take all back.
Script bin/php/expmigrationdeploy.php, code in kernel/private/classes/commands/expmigrationdeploy.php. Run it from the installation root, as the user the web server runs as:
./console exp:expmigrationdeploy --help
./console exp:migration:deploy --help
php bin/php/expmigrationdeploy.php --helpHelp text
Deploy migrations to remotes, all at once and in sync
Sends this installation's migrations (the site's and the active extensions') to the selected remotes of
migration.ini ([RemoteSettings] RemoteList[], one [Remote_<id>] each) and runs them there. A preflight
on every remote in parallel (reachable, run lock free, nothing failed, the same kernel version, no file
changed after it was applied) must pass before anything changes; the files go to every remote and are
verified there; then every remote applies with one shared run id. When one remote fails, every remote
that applied is taken back to its caption, so all of them stay in the same state. Without --apply it is
a dry run: the preflight and the plan, nothing is sent or changed.
./console exp:migration:deploy --remotes=stage,production
./console exp:migration:deploy --remotes=production --apply
./console exp:migration:deploy --remotes=all --transfer-only --apply
./console exp:migration:deploy --remotes=beta --only=20261102090000_add_news_class --apply --format=json
Staged: --staged puts the remotes in stages by their environment ([RemoteSettings] StageOrder[]); the
first stage is switched, then the deploy waits at a gate until --continue=<deploy id> switches the
next one. --rollback=<deploy id> takes back every remote that applied a deploy.
./console exp:migration:deploy --remotes=all --staged --apply
./console exp:migration:deploy --continue=20261102-120000-a1b2c3 --apply
./console exp:migration:deploy --rollback=20261102-120000-a1b2c3 --applyOptions
| Option | Value | Help |
|---|---|---|
--remotes | required | The remotes: ids or group names of [RemoteSettings] RemoteList[] in migration.ini, or all (a comma list or repeated) |
--apply | Make the changes (the default is a dry run that lists them and changes nothing) | |
--dry-run | The default, accepted for scripts that pass it: list what would change, change nothing | |
--transfer-only | Send and verify the migration files, but do not run them (with --apply; the only mode for an FTP remote without a trigger) | |
--only | required | Only these migrations (migration ids, a comma list or repeated) |
--format | required | text (default) or json (the machine output exp-migration/1) |
--parallel | required | How many remotes are worked on at the same time (default [RemoteSettings] Parallel) |
--timeout | required | Seconds each remote may take for one phase (default [RemoteSettings] Timeout) |
--retries | required | How often a connection failure is tried again (default [RemoteSettings] Retries) |
--staged | Deploy stage by stage ([RemoteSettings] StageOrder[] by environment): the first stage now, a gate before each next one (with --apply) | |
--continue | required | Approve the gate of a staged deploy and deploy its next stage (the deploy id; with --apply) |
--rollback | required | Take back every remote that applied this deploy (the deploy id; with --apply) |
--login | required | Run as this user (default: [RunSettings] RunAsUser of migration.ini) |
--run-id | required | The id of the run to start (default a new one: <date>-<time>-<6 hex digits>); the administration names it before it starts the run |
--progress | required | Append the progress of the run to this file, one JSON object per line (what the administration shows while the run goes on) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Related
Generated by ./console exp:help:examples from bin/php/expmigrationdeploy.php, kernel/private/classes/commands/expmigrationdeploy.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.