Groovy Subversion Hook Scripts
I'd like to write some Subversion (SVN) hook scripts in Groovy. The SVN server will be running on windows, and according to the SVN book:
you would need to supply a program whose basename is the name of the hook and whose extension is one of the special extensions recognized by Windows for executable programs, such as .exe for programs and .bat for batch files.
Apart from installing Groovy on the local machine, setting the GROOVY HOME
env var, and adding 开发者_开发知识库%GROOVY_HOME%\bin
to the PATH
, what else do I need to do before SVN can execute Groovy hook scripts?
Thanks, Don
You should make sure your groovy scripts are associated to grooovy with the correct parameters, in order for Windows to execute them with their options when double-clicking them.
Notice you must set that association in a way that allow groovy script to be run with parameters.
Anyway, seems like a good page on that very subject could help : Debugging Subversion Repository Hooks in Windows
If you're not doing it as Riduidel recommends, you have to create a batch file calling groovy, for a precommit hook, it would be called pre-commit.bat
and will be called with the parameters
[1] REPOS-PATH (the path to this repository)
[2] TXN-NAME (the name of the txn about to be committed)
These have to be passed to your groovy script...
精彩评论