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

From MaRDI portal
No edit summary
No edit summary
Line 1: Line 1:
To test changes on MediaWiki-Extensions on production system IntellJ IDE's can be setup to synchronize  
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
files automatically with remote-connections. This shows how to enable such a setup on base of the example of
Line 23: Line 23:
*In IDE configuration in "File | Settings | Build, Execution, Deployment | Deployment | Options", in the setting "Upload changed files .." uploading behavior can be set  
*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
**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  
*To upload all files from extension-folder once initially, folder can be clicked and 'deployment->upload to mardi01' can be pressed
On Mardi01  
On Mardi01  
* login to mardi01 with mardi-test-user
* login to mardi01 with mardi-test-user
Line 29: Line 29:
* add a volumes-mapping entry for wikibase which maps your local changes to exensions, example mappings
* 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 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
** 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
* restart wikibase, eventually it can take up to 10 minutes (check with crontab -e) until the override is read by portal-compose
'''For the configuration mapping to LocalSettings.d make sure to remove the mapping docker-compose.override.yml on mardi01 after testing the configuration!'''

Revision as of 11:41, 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 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 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
  • restart wikibase, eventually it can take up to 10 minutes (check with crontab -e) until the override is read by portal-compose


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