You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

Difference between revisions of "Deployments/Training"

From Wikitech-static
Jump to navigation Jump to search
imported>ArielGlenn
m (+ category)
imported>Ladsgroup
Line 25: Line 25:
* <code>git log -p HEAD..@{u}</code>
* <code>git log -p HEAD..@{u}</code>
* <code>git rebase</code>
* <code>git rebase</code>
* <code>ssh mwdebug1002.eqiad.wmnet && scap pull</code>
* [in another terminal] <code>ssh mwdebug1002.eqiad.wmnet && scap pull</code>
* [check in browser]
* [check in browser]
* <code>scap sync-file [FILE] '[Message]'</code>
* <code>scap sync-file [FILE] '[Message]'</code>
Line 36: Line 36:
* <code>git log -p HEAD..@{u}</code>
* <code>git log -p HEAD..@{u}</code>
* <code>git rebase</code>
* <code>git rebase</code>
* <code>ssh mwdebug1002.eqiad.wmnet && scap pull</code>
* [if extension] <code>git submodule update</code>
* [in another window] <code>ssh mwdebug1002.eqiad.wmnet && scap pull</code>
* [check in browser]
* [check in browser]
* <code>scap sync-file [FILE] '[Message]'</code>
* <code>scap sync-file [FILE] '[Message]'</code>

Revision as of 10:53, 6 April 2021

Deployments cause anxiety because there is a potential to break Wikipedia which is a site that billions of people use[citation needed]. The deployment system has evolved defense mechanisms that make Wikipedia harder to break. You do not need to be a deployment tooling expert to deploy Wikipedia; however, to reduce the anxiety of deployment you need to deploy.

The old saw, "if it hurts, do it more" applies to deploying your code.

The deployment system is never done: Write the doc you wish you had when you started, record a screencast, file a task for scap, find a relenger to rant at, make a patch — all encouraged!

Basic sync

  • All git activity happens in /srv/mediawiki-staging
  • +2 this patch
  • git fetch
  • git log -p HEAD..@{u}
  • scap sync-file [FILE] '[Message]'

Easy peasy.

Mw/Config change More advanced

Most of the time, you'll want to check the patch before it goes out. We do this on mwdebug servers.

  • +2 patch
  • git fetch
  • git log -p HEAD..@{u}
  • git rebase
  • [in another terminal] ssh mwdebug1002.eqiad.wmnet && scap pull
  • [check in browser]
  • scap sync-file [FILE] '[Message]'

MediaWiki patch

  • +2 patch for a deployed version of MediaWiki, skins, or extensions
  • cd /srv/medawiki-staging/php-[version]/ OR cd /srv/medawiki-staging/php-[version]/extension
  • git fetch
  • git log -p HEAD..@{u}
  • git rebase
  • [if extension] git submodule update
  • [in another window] ssh mwdebug1002.eqiad.wmnet && scap pull
  • [check in browser]
  • scap sync-file [FILE] '[Message]'

Helpful things to know

Deployment server directory structure
/srv/mediawiki-staging
├── dblists
│   ├── all.dblist
|   └── [...]
├── images
├── php -> php-1.36.0-wmf.26
├── php-1.36.0-wmf.36
│   ├── [...]
│   ├── extensions
│   │   ├── 3D
│   │   ├── [...] 100s of extensions
│   │   └── ZeroPortal
│   ├── skins
│   │   ├── CologneBlue
│   │   ├── [...] 8 skins
│   │   └── Vector
|   └── [...] # this is just mediawiki
├── portals
├── private
|   ├── [...]
│   └── PrivateSettings.php
├── README
├── wikiversions.json
└── wmf-config
    ├── CommonSettings.php
    ├── [...]
    ├── InitialiseSettings.php
    └── [...]
Deployment server git structure
    • /srv/mediawiki-staging is a git repo.
    • /srv/mediawiki-staging/php-[version] is a git repo not a submodule
    • /srv/mediawiki-staging/php-[version]/extensions/[extension] is a submodule of php-[version]
    • /srv/mediawiki-staging/php-[version]/skins/[skin] is a submodule of php-[version]
    • These are the only files I've ever cared about as a deployer for many years:
/srv/mediawiki-staging
├── .git
├── php -> php-1.36.0-wmf.26
├── php-1.36.0-wmf.36
│   ├── .git
│   ├── extensions
│   │   ├── 3D/.git
│   │   ├── [...] 100s submodules
│   │   └── ZeroPortal/.git
│   ├── skins
│   │   ├── CologneBlue
│   │   ├── [...] 8 skins
│   │   └── Vector
|   └── [...] # this is just mediawiki
├── portals
├── private
|   ├── [...]
│   └── PrivateSettings.php
├── README
├── wikiversions.json
└── wmf-config
    ├── CommonSettings.php
    ├── [...]
    ├── InitialiseSettings.php
    └── [...]