[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 535
  • Last Modified:

Development copy updates VisualSVN Server

Hi Experts,

I am making the very gradual move to version control for my developments via Tortoise SVN as a client and VisualSVN server as the (you guessed it) server.

There are two questions that have been bugging me for a while, and are currently stopping me making the switch.

1.) When I do a comit to the server of the latest version of some code, I would like for that server to then automatically update the client viewing version of it.

So basically, our testing is in two stages.

 a.) Local testing on my machine after updates, to check functionality.
 b.) Uploaded then to live development server for client to see

So when I comit a change, I would like the system to also update another directory on that same server with the newer files.

Is this even possible with Visual SVN server? Should I change to something else to make this easier?


The second question is about updating the production server.

Basically, my question is, do I have to install a version control client like Tortoise SVN on my main server, and then every time I want to update it, then let it pull down a specific revision of the application?



I do have another point, that's less of a question and more of a request for your ideas.

3.) The databases on some of our projects are anywhere from 10 to 100mb in size. Now when users are in the office, this is not an issue, they use the development server copy of the database (which is updated automatically every night to shadow the live database).

However when they leave the office, they would have to take an SQL dump of the database and import it.

Would you think it worth it for me to write a script that does this?

That literally downloads a copy of the database from our development server before the user leaves the office, and then updates their local database?

What are your thoughts on that? How do you do it?

For reference by the way, almost all projects are web applications written in PHP and MySQL

Thanks!
0
billy_howard
Asked:
billy_howard
1 Solution
 
gr8gonzoConsultantCommented:
Your last question should probably be asked separately. It's large enough in scope and really doesn't have much to do with the first two parts, so you're probably not going to get a lot of quality answers for it.

To address your first two questions (which are actually kind of the same question in a way)...

SVN servers usually have "hooks" that are basically mini-scripts that run after certain actions. I'm not familiar with VisualSVN specifically, but I've run SVN servers on Windows before, so I assume VisualSVN has all the necessary parts, including a directory called "hooks" . The normal SVN server comes with a bunch of template files you can use if you want, but you don't need to use them.

If you have a file called "post-commit.bat" in the hooks folder, then the server should execute that batch file after every successful commit. So you can put instructions into the batch file to run an SVN update command, like this:

post-commit.bat:
"C:\Program Files\Subversion\bin\svn.exe" update C:\path\to\the\working\copy

That one line should look for the Subversion client, and use it to update a working copy that is located in C:\path\to\the\working\copy. Assuming that your "live" view is a working copy, that's all you should have to do  in order to have a commit trigger a working copy to automatically update.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now