Sunday 30 April 2017

Is it possible to set up a local QGIS Plugin repository?


I've developed a couple of custom QGIS Plugins for use by our office. I can't post them to the official QGIS Plugins repository as they reference/utilize sensitive data on our own servers.


For distribution, I'm currently just having users copy the plugin folder over to their local plugins folder. However, this is inconvenient and won't give them an easy way to update.


Can I set up a custom repository on a network drive or server (behind our firewall) that users can connect to?



Answer



It is possible, yes. I have not done it myself, but I have read about it in this book. (I hope this does not count as an ad; if someone thinks so, please edit the post and remove the link).


You would first have to create an XML file that looks like the following:






This plugin shows sensitive data
www.gisisfun.com
2.2
somePlugin.zip
YourName
http://my-site.com/somePlugin.zip




That file and your plugin(s) would then be uploaded to a web server (of course you’d configure your server so only people from your company can access its contents).


Now, what is important here, and what you might have guessed already, is that you create a 'plugin section' for each plugin that you want to upload to your repository, so basically you'd have to add the following tags (and any info in between) multiple times:


   INFO HERE    

After uploading the XML and your plugins to your server you have already done the bulk of the work.


Now you would start QGIS and open the Plugin Manager, just like you would normally do to find and add plugins. You would have to navigate to the Settings tab, where you can add connections to repositories:


enter image description here


Now you will give the repository a Name (it really does not matter what this name is, but something that makes sense and lets you recognize it; kind of like when you define a database connection in QGIS), and then under URL you would provide the full URL to your XML file on your server (e.g. http://gisiscool.com/gis/plugins/plugins.xml).


enter image description here



That should do it. You can now search and find your own plugins!


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...