I’ve figured out how to use a before-clientcheckin
trigger with a file in our repo to prevent people accidentally checking in temporary local changes to important project files (i.e. **/ProjectSettings/. and some specific assets under **/Assets/ ), but sadly it’s not a good solution.
The problem we have is that some of our team are on Mac and some are on Windows so we can’t use the same client trigger script for all users - we’re a completely distributed team, so getting everyone to install a cross platform scripting solution is a far less than ideal solution.
What I would like to do instead is to run a server side trigger on before-checkin
, but our UVCS server is in Unity DevOps so we have no access to put actual files onto the server to accomplish this…
Whilst there is a bunch of documentation on the trigger it doesn’t really explain how to get server side trigger scripts onto the server, and it definitely doesn’t anything about a triggers with Unity DevOps (i.e. how do you get a trigger script onto a server if you don’t have access to the server’s filesystem?!)
I assume it is possible to set up an trigger for before-checkin
on a DevOps UVCS server, so I would really really reall appreciate it if someone from Unity could post a detailed how-to for this.
I don’t mind what scripting language the trigger needs to be is as long as I can easily test it (and debug it - e.g. ideally need some way of being able to access debug logging from the script when it runs).
Specifically what we need to do is:
-
compare the files being checked in vs. a set of protected paths (i.e. **/ProjectSettings/. and a few assets in the Assets folder)
-
if no files match:
- allow the check in to happen
-
if a file matches a protected path:
- check the commit comment for a specific string e.g. “ForceProtectedCheckin”:
- if it’s present:
- allow the check in to happen
- if it’s not present:
- log an error message telling the user why their checkin has failed
- don’t allow the check in
- if it’s present:
- check the commit comment for a specific string e.g. “ForceProtectedCheckin”:
Thanks for your help.
Alex