Project:Develop and Test Mediawiki Code on Production: Difference between revisions

From MaRDI portal
No edit summary
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
For formulasearch (mediawiki extension) it is necessary to test everything on production, production env often differs from local env.
To test changes on MediaWiki-Extensions and the MediaWiki configuration 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 with MathSearch-Mediawiki extension and/or configuation-testing for LocalSettings.d on mardi01.


ssh tunnel to mardi01
===== Prerequisites: =====


server settings in Intellij Idea sync files to mardi01 (within ide folder)
* Working ssh connection to mardi01 on your development machine, in many cases this includes VPN access.
override file which mounts the specified folder to the MathSearch extension folder
* Git and IntelliJ (or probably other JetBrains IDE) installed on development machine
override folder should be mounted by cron already, can be renamed or moved
 
===== Information Sources: =====
 
* Most steps regarding the IDE setup are described [https://www.jetbrains.com/help/idea/creating-a-remote-server-configuration.html 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.
***It is advised to locate your testing source code in your personal home folder, i.e.:  /home/jstegemu/development/MathSearch
*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 extension-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
* It can take up to 10 minutes (check current timing with crontab -l on mardi01) until the override is read by portal-compose
* Restart wikibase to make it load the new override after this time.
 
'''For the configuration mapping to LocalSettings.d make sure to remove the mapping docker-compose.override.yml on mardi01 after testing the configuration!'''

Latest revision as of 11:53, 22 July 2022

To test changes on MediaWiki-Extensions and the MediaWiki configuration 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 with MathSearch-Mediawiki extension and/or configuation-testing for LocalSettings.d on mardi01.

Prerequisites:
  • Working ssh connection to mardi01 on your development machine, in many cases this includes VPN access.
  • Git and IntelliJ (or probably other JetBrains IDE) 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.
      • It is advised to locate your testing source code in your personal home folder, i.e.: /home/jstegemu/development/MathSearch
  • 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 extension-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
  • It can take up to 10 minutes (check current timing with crontab -l on mardi01) until the override is read by portal-compose
  • Restart wikibase to make it load the new override after this time.

For the configuration mapping to LocalSettings.d make sure to remove the mapping docker-compose.override.yml on mardi01 after testing the configuration!