Tech:Deploy-mediawiki

deploy-mediawiki is a new deployment tool currently available on test3 as part of the rollout of scap-like deploy process.

It is currently only deployed on test3 but in future the rollout will allow all deploy commands to be ran from a single server for production (mw11).

The --servers argument must currently be included. You should just append every command with --servers=skip for now. This means that it is only deployed to the server you are running the command on.

You can also add a --no-log command. This will direct output to your terminal rather than logsalmsg.

To deploy config changes (should happen automatically once puppet runs, is logged):
 * deploy-mediawiki --config --servers=skip

To deploy MediaWiki with no i18n/l10n changes
 * deploy-mediawiki --world --servers=skip

To deploy MediaWiki with i18n/l10n changes (equivalent to running MergeMessageLists and RebuildLC):
 * deploy-mediawiki --world --l10n --servers=skip

To deploy MediaWiki with gitinfo changes (this should be done when updating or installing extensions):
 * deploy-mediawiki --world --gitinfo --servers=skip

You can use any mix of the 3 --world --config and --l10n parameters.

If you wanted to deploy a change to only a single file without syncing all:
 * deploy-mediawiki --files=w/index.php,w/api.php --servers=skip

To sync a folder:
 * deploy-mediawiki --folders=w/extensions/Echo,w/Skins/Vector --servers=skip

Failover a canary server
While it won't cause issues to have a short loss of service on the active canary server, you just won't be able to deploy new stuff. Eventually you might need to fail over to a replacement. Follow these steps if you do. If the old server is being moved to a normal setup: If the server is being decommissioned:
 * 1) ensure the replacement is fully up to date
 * 2) enable use_staging and is_canary on the new server, disable remote_sync and switch default_sync to 'all' in puppet.
 * 3) run puppet on the new server - this should add the staging clones, remove the ssh access from the current canary to the the new and set the config to sync everywhere.
 * 4) add the ssh key to ssh agent and ensure it is started. If a new ssh key is needed, generate one and update puppet to use the new key.
 * 1) disable is_canary, use_staging, enable remote_sync and set default_sync to 'skip' (default in puppet).
 * 2) run puppet. This will enable remote access from the new canary. It will not wipe the old staging folder.
 * 1) follow the normal server lifecycle procedure.
 * 2) wipe /srv/mediawiki-staging/, disable ssh agent to wipe the key.