Build on commit with subversion

2019-02-03 19:47发布

Simple question. I use Visual studio and I've just installed subversion, how can i force the project to be build with msbuild, and if successfully build commit it else warn the user. I would use TortoiseSVN or VisualSVN or AnkhSVN (whatever it's called) if they have the ability to force build on commit built-in (I know that this is not their usage, I know they are just used as just GUI for committing to SVN) I would like to know if any of these tools can be used to do this extra thing.

To wrap up I am just searching for a painless way to build before commit for subversion.

6条回答
等我变得足够好
2楼-- · 2019-02-03 20:04

TortoiseSVN has client-side hook scripts which you could use. For example, you could write a script which does the build and only returns true if the build was successful. Then add that script as a pre-commit hook.

查看更多
贼婆χ
3楼-- · 2019-02-03 20:10

Take a look at TeamCity's "pre-tested commit" a.k.a "delayed commit" a.k.a "private build" feature.

In a nutshell, you "commit" to TeamCity, TeamCity verifies your build and commits to the real repository only if the build passes. If not, you're told so. The advantage here is that your trunk is never broken. You can go here to read more about it https://confluence.jetbrains.com/display/TCDL/Pre-Tested+(Delayed)+Commit

查看更多
叛逆
4楼-- · 2019-02-03 20:15

Well, you may also educate your co-workers if you are not willing to pay for special tools...

查看更多
Viruses.
5楼-- · 2019-02-03 20:19

You could also use CruiseControl, Hudson or another continuous integration tool.

These could run in the background, watch for changes and then build.

查看更多
三岁会撩人
6楼-- · 2019-02-03 20:20

The method Stefan suggested seems to be potentially the best for you.

However an alternative depending on what your trying to gain, might be to run with some sort of Automated Continuous Integration so every time a commit is made a build / test will be run, then if there are problems it could raise an alert or whatever. Since your using visual studio guessing your using .NET so CruiseControl might be worth a look.

查看更多
何必那么认真
7楼-- · 2019-02-03 20:24

I think this might work for you since you use SVN.

In all what you are asking for is like what mausch suggested, a CI server. In that case TeamCity fits the bill.

But perhaps you didnt need all the bells and whistles that came with a CI server. Then SIN might work for you. Check it out if you have time!

查看更多
登录 后发表回答