开发者

Using 2 SVN repositories for website - publishing question

开发者 https://www.devze.com 2023-04-03 00:38 出处:网络
I am a complete noob to this so if there is a completely obvious answer by all means make fun and point and laugh then give the answer.

I am a complete noob to this so if there is a completely obvious answer by all means make fun and point and laugh then give the answer.

We use Visual Studio 2010 to compile our published website. I have a repository that I use for my source code and one which I publish the compiled code to. I then check out the publish repository on the testing server and once it tests good I check out the repository on my main server. This is fine a开发者_开发知识库nd all but I am using Tortoise SVN and automating the commit. Problem is, I really need to wipe the publish SVN repository, then copy the files, then commit. I just can't get that to happen and have it still recognize it as a SVN repository. Suggestions?


First of all, don't put compiled code into your source repository. It's bad form.

Look at Jenkins as a build server. Jenkins can use the msbuild.exe command to build .NET projects using the .sln file your project creates.

When you do a commit in Subversion, Jenkins will automatically fire off the build. If you have NUnit tests, Jenkins will run those and give you the results. You can have Jenkins store the compiled files for you in its archive. If someone wants to install a particular build, they can directly download it from Jenkins without having to do a checkout in Subversion first.

Jenkins offer all of these advantages:

  • It shows you all the changes in your repository and what changed in each commit.
  • It can run all sorts of tests automatically for you.
  • You can mark builds that are released using the "Simple Promotion" plugin.
  • You can tag builds in Subversion directly in Jenkins without needing a command line or working directory.
  • It can alert the developers if a build fails due to bad code, or if testing fails. These alerts can be done via Email, instant messaging, phone text messages, Twitter, and many other ways. All it takes is the right plugin which Jenkins makes easy to install.
  • Jenkins can act as a release repository which makes it easy to find the release, what's in the release and why.
  • Jenkins integrates with Bamboo, ViewVC, and Sventon. These are web-based repository browsers. This way Jenkins not only shows you the file changed, but what changed in the file.

Jenkins is easy to use and install. Download it and give it a try.


Unless you have a hard and fast requirement which forces you to use two separate repositories, i'd suggest taking a look at SVN tagging and branching functionality.

http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-branchtag.html


Having a repository for the published code really doesn't buy you anything. IMO, you would be better off with a bunch of zip files (one per release) with the date and SVN branch reflected in the name. DO have a changelog .txt file in the zip, and also check that into the repo.


Problem is, I really need to wipe the publish SVN repository, then copy the files, then commit.

You don't need wiping in repo. Just make commit to production repo with exported HEAD from dev-repo (post-commit hook for commit message)

And tags, yes, are more natural and bulletproof way.

0

精彩评论

暂无评论...
验证码 换一张
取 消