Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web-development with version control workflow

Brief:
I work in a 2-men team (we may expand in future).
We've got a web-dev server and we've got a production server.
Currently, when we start development, we start them on localhost, then we deploy them to web-dev (which we have access through a mounted drive) and we submit changes from this "shared" drive to SVN. Final test on web-dev, approval from the top and off it goes through FTP to our production server.
(I can hear lynch coming...)
Yes, I'm aware it's all wrong with sharing files from one location and submitting it from there, but this wasn't such a bad idea back then when I got to know SVN. And now I want to change it.

So, I know basics of version control, and that the way it works now is wrong big time. I've gone through wikipedia and some svn pages, but I couldn't find a perfect solution how it should actually work.

Could some of you well experienced people suggest how this should actually work?

Things I've found out:

  • we should work on local copies on our machines
  • then we submit changes to SVN.

Things I want to know:

  • how do we make web-dev update after SVN commit?
  • how to deploy patches to production server? ftp files? is this what you do? or some other clever solutions?
  • anything else I should know about web-dev workflow.
like image 878
Michal M Avatar asked Jul 16 '09 10:07

Michal M


People also ask

What is VCS in web development?

A version control system (VCS) tracks changes to a file or set of files over time. The most common type is a centralized VCS, which uses a server to store all the versions of a file. Developers can check out a file from the server, make changes, and check the file back in.

What is Web based version control?

Version Control (aka Source Control or Revision Control) is the management and control of a project. Particularly in the web space though, version control is software that stores, tracks, and updates changes made to a master copy of the project that multiple people might be working on.


3 Answers

Subversion has post commit hooks which allow you to perform actions on a commit.

You could also look at a continuous integration solution like CruiseControl.net or Team City.

Our process is individual developers work on local configurations. We commit to Subversion and CruiseControl.net checks out and builds the system every time one of us commits.

There's a scheduled build for update installer that runs weekly and updates the install on a server that QA use to verify fixes. Once the fixes are verified, someone (manually) applies the update that was applied to the QA server on the production sites.

like image 50
nickd Avatar answered Oct 17 '22 23:10

nickd


I'd recommend looking at post commit hooks, like nickd suggests. You can even reject a commit, if it fails to build (say you generate HTML files from some 'source' files and if that build fails you can expect the person to fix that prior to a commit).

  • how do we make web-dev update after SVN commit?
  • how to deploy patches to production server?

Either automatically, via the hook, or you can consider a manual "svn update" on the production machines, which gives you control of when, which revision and so forth to take into use.

The SVN book is great reading. One can read only the relevant sections and come later back for more. Are you using trunk and tags - they are bread and butter for svn usage and release control.

like image 36
akauppi Avatar answered Oct 17 '22 23:10

akauppi


This is how I've been doing it for a few years now.

Dev Server - Located in house, contains LAMP stack, the repository and a working copy. This has the same versions of software as the production server.

Production Server - Has Staging environment with working copy of repo, also has production environment with non-svn version of project (i.e. the live site).

Developer - Has LAMP stack and working copy of repository on their local machine.

Typical process:

Developer updates working copy of project. Works on local copy, when current changes are done and bug-free they check copy back into repository.

Post-commit hook updates Dev Server's working copy. You may want to do this manually, especially if your team starts to grow.

If changes are working on Dev Server then the working copy on the Staging environment is manually updated.

If changes are working in staging environment then we use RSYNC to push any changes from the staging environment's working copy to the production environment.

Obviously this is a very general explanation of what goes on as you'll want to integrate things like unit testing to the process, but I hope this helps.

like image 2
Jeff Busby Avatar answered Oct 17 '22 23:10

Jeff Busby