The way I usually do it is by deploying a cloud-based git repo as an extension to pyRevit, coupled with a startup script that always maintains and checks for updates to be pulled either at the startup of Revit or by pressing the update tool button from pyRevit’s main toolbar (which you can create an instance-of in your toolbar to keep everything in the same place for the end user).
if you are using github or bitbuckit for example, you can create a read-only access token and run a cmd process with the pyRevit cli to install the extension directly from your cloud git repo.
here’s a simple command you can put in a batch file that any user can double-click to install the toolbar with:
echo Installing myAwesomePluginName Extension for Revit...
pyrevit extend ui myAwesomePluginName "https://x-token-auth:PlaceYourTokenHere@bitbucket.org/YourCompanyAccount/myAwesomePluginRepo.git" --branch=master
echo myAwesomePluginName Installed!
Also, you can work with your IT team to run the command directly at startup of the users machines or at users login to automatically install it for everyone:
When I pull this from github, the entire repo is dumped into a .extension folder.
Which is quite inconvenient as I then have a .extension folder, filled with .extension folders, and the root folder is added to the extensions
I could then ofcourse then use a shell script and pyrevit_cli to add those sub_extensions to pyRevit but I think that’s rather messy.
Is it possible to do this with multiple extensions in a single repo? Or should I bite the bullet and split my plugin into different repos?
Coding workflow won’t change I suspect. It’ll introduce some repository juggling though.
Might need to run a few tests. It kind of depends on how easy it is to split up a project and manage multiple repos from within PyCharm.
I have a hunch that i’ll be able to make work but better be safe than sorry right?
One thing about the token that I need. Which access rights does it need for this read-only acces? I only tried it with a temporary full-access one.
Ok seems to work, pretty straight forward actually, I like it!
Only question remaining is where to store that token.
Those fine-grained tokens only live for one year, so at some point I’ll need to create a new one.
Jean-Marc I suppose you update it in your startup script so that takes care of that I suppose.
Ali: you provide a token inside your git url, does that store the token somewhere?
Or is that a bad idea?
I was hoping to combine both your suggestions into a single win.
unfortunatly storing the token inside a url in the extension.json doesn’t seem to work
none of these worked: <uname>:<token>@github <token>@github oauth2:<token>@github
then again if I use your idea jean-marc, users would never need to update in the first place so… I think I’m totally fine with that approach.
There was an issue on this topic that was closed during the summer cleaning (for which I complained with @Jean-Marc because it was not really solved ).
I’m still waiting for the instruction on how to properly develop and debug the c# part of pyRevit, and lacking time/willpower to figure it out myself, so I didn’t work on it yet.
A few remarks:
administrative task can be automated in many ways, by using GPO or other tools like ansible
if the problem is the ability to keep the extension private, but avoid user registering to github, you can spin up a local git server like gitea and make the repository public, so that can be reached only via lan or vpn