User:ATomasevich (WMF)/Docker basics

Links

 * Setting up your Docker environment
 * Installing git-review
 * Configuring git-review

Useful commands

 * : Start containers so you can run your local site. You will need to do this after stopping containers or after restarting your machine
 * : Stop containers
 * Pull an in-progress branch from Gerrit (we'll use https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MachineVision/+/575350 as a sample)
 * First, run  to get into the git repository of the correct extension (check the URL of the gerrit patch for the extension name
 * Copy the number in the URL, e.g. 575350 for our sample patch, and run . This will create a new branch on your local site with the in-progress code. You can do a hard refresh on your local site to see the updates.
 * When you're done, you can go back to the master branch with git checkout master
 * To check out the in-progress branch again, run the command in step #2 again. This will check out the same version of the code that you pulled before.
 * If you need to update that code, while on the in-progress branch, run  to pull updates.
 * Update Mediawiki core
 * Start from the root of the Mediawiki repository
 * Run  to pull updates from Gerrit
 * Run  to run any database updates associated with the new code you just pulled
 * You may see a message that you need to run composer install before the update script can run. If so, run, then run the update.php command again
 * Update extensions
 * From the root of the Mediawiki repository, run  to get into the git repository of the extension you want to update
 * Make sure you're on the master branch. You can run  to see which branch you're on and   to go back to the master branch.
 * Run git pull to pull updates from Gerrit
 * Special tip for Wikibase: you need to pull changes from git submodules as well. To do so, from the Wikibase extension, run
 * If you run into issues after updating extension code, try following step 3 in the "Update Mediawiki core" instructions to run database updates