3

I'm running Visual Studio 2010, VisualSVN and TortoiseSVN.

Each time I use webdeploy to deploy the website, I'd like it to commit all of my files to SVN. What's the best way to accomplish this?

bahrep
  • 29,961
  • 12
  • 103
  • 150
Kyle
  • 1,172
  • 1
  • 8
  • 23

4 Answers4

2

Visual Studio does a build when you hit the publish button. You can create a build configuration in VS2010 that executes commands after a successful build. You should install the command line SVN client and use that to execute a commit. Call the SVN command line client from the Build Configuration.

A more common approach would be to commit your change to the version control system instead of using WebDeploy. Then have a build server get the source from version control and incorporate the changes into the server. CruiseControl.NET is a good tool for doing that.

maddoxej
  • 1,662
  • 13
  • 19
1

You should investigate https://github.com/loresoft/msbuildtasks which once installed and integrated into your project file, offer support for creating custom msbuild actions.

With it installed you can create 'SvnCommit' actions and associate it with a beforebuild or afterbuild target in your project file.

zeFrenchy
  • 6,541
  • 1
  • 27
  • 36
0

probably this is not the answer you are looking for - but I do not think you can get this out-of-box. I would suggest you to create a visual studio plugin and integrate it with SharpSVN (subversion client API) to achieve what you want.

UPDATE:

as @maddoxej mentioned, post-build action might work as well. However, I find it's easy to miss what configuration is selected - and press F5. And committing to SVN by accident is not generally a good thing.

Another option I thought about could be VS macro. Just record a macro which clicks deploy and then commits to SVN.

avs099
  • 10,937
  • 6
  • 60
  • 110
0

The answers that suggest making the check-in a build action is slightly flawed because the publication process will presumably increment a published build number as part of the publication process. This will modify the source code which will then need checking-in.

Kev
  • 1,832
  • 1
  • 19
  • 24