Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st November 2011, 17:40
alleks alleks is offline
Senior Member
 
Join Date: Nov 2010
Posts: 157
Thanks: 9
Thanked 9 Times in 9 Posts
Default Best way of version control of a live site

Sorry if I posted in the wrong place but where else?

Can any1 help me with this question I made some time ago:
http://stackoverflow.com/questions/7...of-a-live-site

Quote:
I want to test on one of my servers the version control of a live website and implement it the best way possible.

That one of the servers is running on Debian Lenny with Apache2 and wanting to use Mercurial (1.9.3 installed) as version software.

I have followed this tutorial (http://www.isnull.com.ar/2010/03/how...debian-or.html) till a certain point where these doubts showed up: How can I do version control of a live website, thinking of implementing multiple users support in the future. Explain:

I have my live website which I want to add the feature of the version control and it to be the master branch with it's user and password for commits (in the beginning).
From my local computer where I have the development area, I want to be able to commit to the master branch through whatever protocol (http, ssh, ...).
I also would like to know which method would be the most efficient to have the multiple user support and than each user to push to a stable repository and when the push is accepted the administrator will push to live site / master branch. Explication: I have the master branch, a stable clone of the master and each user will have his clone/s of the stable repository and finally each user will push to the stable repo where from there if accepted will go to the master branch.
It does occur to me another question, won't be there conflict problems when a user pushes a file/s different from what other user pushed 1 minute ago? Of course there can be the task separation and each to do certain things but what if not, what if X commits submit.php and Y also commits submit.php 1 minute before? I am asking this because I am sure that I will encounter this problem with the friend I work with, so what any ideas?

Or it's that I didn't fully experimented CVS and neither fully understood it? Even though I think other have encounter the same problems as I but I didn't find no where these questions asked.

Thank you, Alex

PS: Mercurial is not a must, It's just I used that one mostly but I am open to any other software that will help me

Quote:
I have the following structure: Production, Stable , Development and Testing (for testing purposes only) and of course Production is the master branch and each other is a copy of another (Production -> Stable -> Development -> Testing or Production <- Stable <- Development <- Testing) and all of them are workable inclusive the master branch
By that I mean that when everything is ok and goes great I push to Production (Development -> Stable (Stable copy of production) -> Production) and what mainly I am looking for is for a way that automatically when new changes are submitted to Production it updates the LIVE Site through ftp or whatever type of transfer protocol.

Thanks,
Alex
Reply With Quote
Sponsored Links
  #2  
Old 22nd November 2011, 15:16
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,036
Thanks: 841
Thanked 5,656 Times in 4,464 Posts
Default

I used SVN for this purpose some time ago on several servers and it worked quite well.

Quote:
It does occur to me another question, won't be there conflict problems when a user pushes a file/s different from what other user pushed 1 minute ago?
SVN takes care about that. If a file has been modified and commited by user 1 while user 2 works on it too and user 2 then tries to commit his work, svn will inform the user that he has to run a update on his repository first so that svn can merge the changes in his local copy before he can commit his work. This kind of version control (with svn or git) is used by most OpenSource projects weher a lot of poeple are working at the same time on the code.

I wont use CVS as its quite old and not that easy to use, better use SVN or Git. If you develop on windows systems, then take a look at tortoisesvn client.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 24th November 2011, 13:12
alleks alleks is offline
Senior Member
 
Join Date: Nov 2010
Posts: 157
Thanks: 9
Thanked 9 Times in 9 Posts
Default

Thank you Till, that's very useful to know... but what about the synchronization problem?
Reply With Quote
  #4  
Old 24th November 2011, 14:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,036
Thanks: 841
Thanked 5,656 Times in 4,464 Posts
Default

You create e.g. 3 branches in SVN:

/yoursite/trunk
/yoursite/testing
/yoursite/stable

All developers have access to trunk. The release managers have access to testing and stable.

Changes from trunk were merged (applied) to testing and if they work you can merge them to stable.

You can then export the revisions from testing and stable to the webservers with svn export command.

To get a easy way to switch back to a old revision later in case that somethin does not work in stable, then you can create a tag for every released version, so its easy to get back to that version.

/yoursite/tags/1.0
/yoursite/tags/1.1
/yoursite/tags/1.2

etc.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 24th November 2011, 19:14
alleks alleks is offline
Senior Member
 
Join Date: Nov 2010
Posts: 157
Thanks: 9
Thanked 9 Times in 9 Posts
Default

So subversion (the one and only I was avoiding) seems to have the solution , but my question is how would that work if people have to push changes from a remote place (another pc) and I don't have a Fix/Stable/Own public IP but a dynamic one? I wouldn't like to make branches on a production server and work with them there, there should be only the Live/Production branch. I hope you understand my question.

I do have another idea but I will have to test it first and then I will let you know, it involves a Shorcut/Copy/Remote folder called Production (like a shared folder over the network) of the live website and that will be a masterbranch and when merged changes to that folder they auto update because it's a "shared" folder copy of the webXX/web/.
Reply With Quote
  #6  
Old 24th November 2011, 23:04
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,036
Thanks: 841
Thanked 5,656 Times in 4,464 Posts
 
Default

Quote:
So subversion (the one and only I was avoiding) seems to have the solution , but my question is how would that work if people have to push changes from a remote place (another pc) and I don't have a Fix/Stable/Own public IP but a dynamic one? I wouldn't like to make branches on a production server and work with them there, there should be only the Live/Production branch. I hope you understand my question.
You have one central svn server. This svn server can be any server that is reachable over the internet, it is normally not the productions system. All developers authenticate at this server with username and password of their svn account, svn has its own user and group management. So the IP addresses or connections of the developers dont matter.

If you want to get a version of the code live, then a script on the live server connects to the svn repository server and pulls a copy of the code to its local harddisk.

Quote:
I do have another idea but I will have to test it first and then I will let you know, it involves a Shorcut/Copy/Remote folder called Production (like a shared folder over the network) of the live website and that will be a masterbranch and when merged changes to that folder they auto update because it's a "shared" folder copy of the webXX/web/.
Thats not required. SVN can do this much better.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Version 1.3 of the ISPConfig 3 Manual is finally available! falko General 44 2nd December 2011 13:04
Centos5.4/ISPConfig 3--Virtual site not working MichaelCaditz Installation/Configuration 25 25th March 2011 12:37
ISP Config Server Apache admins Installation/Configuration 3 14th October 2009 11:13
Broken php5-mysql dclardy Installation/Configuration 8 9th October 2009 10:49
Squid Proxy Caching on Linux obzerver Installation/Configuration 4 13th August 2008 20:51


All times are GMT +2. The time now is 12:51.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.