Project:Develop and Test Mediawiki Code on Production

From MaRDI portal
Revision as of 10:05, 22 July 2022 by Johannes (talk | contribs)

To test changes on MediaWiki-Extensions on production system IntellJ IDE's can be setup to synchronize

files automatically with remote-connections. This shows how to enable such a setup on base of the example of

creating a development setup wih MathSearch-Mediawiki extension to mardi01.

Prerequisites:
  • Working ssh connection to mardi01 on your development machine, in many cases this includes VPN access.
  • Git and IntelliJ installed on development machine
Information Sources:
  • Most steps regarding the IDE setup are described here
Steps for the setup:
For IDE
  • Create an ssh configuration in IntelliJ IDEA for mardi01: "File | Settings | Tools | SSH Configurations" (host: mardi01, user:your-username, ....)
  • In IDE configuration in "File | Settings | Build, Execution, Deployment | Deployment" create a new setup for mardi01 with SFTP (there are probably other options, but this one worked in test)
    • In the mappings tab - Set the root path and the folder mappings here according to the extensions which shall get synced on the server
    • For the mappings of extension, it is recommended to specify a path in your user's directory, so there are permissions to modify the files.
  • In IDE configuration in "File | Settings | Build, Execution, Deployment | Deployment | Options", in the setting "Upload changed files .." uploading behavior can be set
    • Recommendation is to set it here to "On explicit save action", so files are not synced while writing and cause the portal to crash because typos
  • To upload all files from exension-folder once initially, folder can be clicked and 'deployment->upload to mardi01' can be pressed

On Mardi01

  • login to mardi01 with mardi-test-user
  • edit the file (or similar) /home/mardi-test-user/portal-compose/docker-compose.override.yml
  • add a volumes-mapping entry for wikibase which maps your local changes to exensions, example mappings
    • Example for a mediawiki-extension: - /home/jstegemu/development/MathSearch:/var/www/html/extensions/MathSearch)
    • Example for Settings: - /home/jstegemu/development/LocalSettings.d:/var/www/html/LocalSettings.d)
  • restart wikibase, eventually it can take up to 10 minutes (check with crontab -e) until the override is read by portal-compose