You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Mike van Hoof <m....@scheepens.nl> on 2008/06/26 09:23:15 UTC

Subversion workflow with PHP

Hello everyone,
 
We are using subversion for a while now, and it works like a charm, but
I think our workflow is incorrect:
- we have a svn server with svn and the repositories
- we also have a webserver, with all our projects in the wwwroot. This
projects are our working copies, so every developper works in the same
working copy.
 
So I think (no... i KNOW) that that is the wrong way to use subversion.
 
I want every developper to have it's own workingcopy, but if they put
everything local it means they have to have their own webserver running
locally.
An other option is that they copy every change they do to the webserver,
but this slows down development.
 
So now my question is: how would you approach this? Is there anyone who
did this before and wants to share this with me?
 
I did try to search for this on google, but didn't find what i was
looking for...

With kind regards, 

Mike van Hoof

Scheepens reclame adviseurs
Post > Postbus 954, 5000 AZ, Tilburg
Bezoek > Sportweg 14, 5037 AC, Tilburg
Telefoon > 013 5950 900
Fax > 013 5950 901
e-mail > m.vhoof@scheepens.nl <bl...@scheepens.nl> 
internet > www.scheepens.nl <blocked::http://www.scheepens.nl/> 

> Opvallend veelzijdig

 

Re: Subversion workflow with PHP

Posted by Jan Hendrik <li...@gmail.com>.
Concerning Re: Subversion workflow with PHP
Ulrich Eckhardt wrote on 26 Jun 2008, 12:09, at least in part:

> How about different virtual hosts for each developer? That way you
> would only have one webserver machine but each developer would have
> one working copy associated with one virtual host. However, that still
> isn't very far from running the server locally except that it has more
> dependencies.

And creates more load on the LAN.  That aside IIRC on the 
TortoiseSVN site it is (was?) strongly discouraged to keep working 
copies on network drives for speed reasons on update/commit and 
certainly other SVN operations more.

Jan Hendrik
---------------------------------------
Freedom quote:

     Je weniger wirtschaftliche Freiheiten den Bürgern gewährt werden,
     desto geringer sind der persönliche Wohlstand und der Wohlstand des ganzen Landes.
               -- Patrick Welter,
                    Frankfurter Allgemeine Zeitung, 6. Jan. 2005


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Subversion workflow with PHP

Posted by Ulrich Eckhardt <ec...@satorlaser.com>.
On Thursday 26 June 2008, Mike van Hoof wrote:
> We are using subversion for a while now, and it works like a charm, but
> I think our workflow is incorrect:
> - we have a svn server with svn and the repositories
> - we also have a webserver, with all our projects in the wwwroot. This
> projects are our working copies, so every developper works in the same
> working copy.

Yes, this isn't a terribly good idea because it leads to access conflicts in 
the working copy. In particular two developers working on different features 
of the same project can create problems.

> I want every developper to have it's own workingcopy, but if they put
> everything local it means they have to have their own webserver running
> locally.

So? That's not really terrible, that way they can even change the 
configuration if necessary or similar changes that shouldn't be done on a 
production system.

> An other option is that they copy every change they do to the webserver,
> but this slows down development.

rsync is one way which is actually pretty fast. Another would be to remotely 
mount a directory on the webserver. Having a single working copy on the 
webserver and updating that after checking in changes is another, but you 
should still somehow check your changes _before_ checking them in.

How about different virtual hosts for each developer? That way you would only 
have one webserver machine but each developer would have one working copy 
associated with one virtual host. However, that still isn't very far from 
running the server locally except that it has more dependencies.

Uli

-- 
ML: http://subversion.tigris.org/mailing-list-guidelines.html
FAQ: http://subversion.tigris.org/faq.html
Docs: http://svnbook.red-bean.com/

Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

**************************************************************************************
           Visit our website at <http://www.satorlaser.de/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Sator Laser GmbH ist für diese Folgen nicht verantwortlich.

**************************************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


RE: Post-commit hook export

Posted by Mike van Hoof <m....@scheepens.nl>.
Hi there,
 
i fixed it... with some help
 
the post-commit.bat file contains:
 
C:\Repositories\reponame\hooks\export.vbs %1 %2
 
AND export.vbs contains:
 
var1 = Replace(WScript.Arguments.Item(0), "\", "/")
var2 = WScript.Arguments.Item(1)
 
folderArray = Split(var1, "/")
Repository = UBound(folderArray)
 
Set shell = CreateObject("WScript.Shell")
shell.Run Unescape("%22") & "C:\Program Files\CollabNet Subversion
Server\svn.exe" & Unescape("%22") & " export file:///" & var1 &
"/trunk/www C:\Inetpub\wwwroot\mike\test\" & folderArray(Repository) & "
--username web --password web --force", 1, false
Set shell = Nothing
 
Hope it helps someone who is looking for the same!
 

Met vriendelijke groet, 

Mike van Hoof

Scheepens reclame adviseurs
Post > Postbus 954, 5000 AZ, Tilburg
Bezoek > Sportweg 14, 5037 AC, Tilburg
Telefoon > 013 5950 900
Fax > 013 5950 901
e-mail > m.vhoof@scheepens.nl <bl...@scheepens.nl> 
internet > www.scheepens.nl <blocked::http://www.scheepens.nl/> 

> Opvallend veelzijdig

 

________________________________

Van: Mike van Hoof 
Verzonden: maandag 30 juni 2008 11:15
Aan: users@subversion.tigris.org
Onderwerp: Post-commit hook export


Hi,
 
i am trying to get a post-commit hook to work.
The current content in the script is:
 
#!/bin/sh
"C:\Program Files\CollabNet Subversion Server\svn" export
file:///$1/trunk/www C:\Inetpub\wwwroot\mike\test\ --username web
--password web --force
 
The next step will be that only the repository name is extracted from
the path, so that i can export to that subfolder.
 

Met vriendelijke groet, 

Mike van Hoof

Scheepens reclame adviseurs
Post > Postbus 954, 5000 AZ, Tilburg
Bezoek > Sportweg 14, 5037 AC, Tilburg
Telefoon > 013 5950 900
Fax > 013 5950 901
e-mail > m.vhoof@scheepens.nl <bl...@scheepens.nl> 
internet > www.scheepens.nl <blocked::http://www.scheepens.nl/> 

> Opvallend veelzijdig


Post-commit hook export

Posted by Mike van Hoof <m....@scheepens.nl>.
Hi,
 
i am trying to get a post-commit hook to work.
The current content in the script is:
 
#!/bin/sh
"C:\Program Files\CollabNet Subversion Server\svn" export
file:///$1/trunk/www C:\Inetpub\wwwroot\mike\test\ --username web
--password web --force
 
The next step will be that only the repository name is extracted from
the path, so that i can export to that subfolder.
 

Met vriendelijke groet, 

Mike van Hoof

Scheepens reclame adviseurs
Post > Postbus 954, 5000 AZ, Tilburg
Bezoek > Sportweg 14, 5037 AC, Tilburg
Telefoon > 013 5950 900
Fax > 013 5950 901
e-mail > m.vhoof@scheepens.nl <bl...@scheepens.nl> 
internet > www.scheepens.nl <blocked::http://www.scheepens.nl/> 

> Opvallend veelzijdig


Re: Subversion workflow with PHP

Posted by Bradley Holt <br...@foundline.com>.
Mike,

Glad I could help! You might want to check out
Springloops<http://www.springloops.com/>,
Capistrano<http://www.simplisticcomplexity.com/2006/8/16/automated-php-deployment-with-capistrano/>,
Phing <http://phing.info/trac/>, and
phpUnderControl<http://www.phpundercontrol.org/about.html>as a few
options for setting up your process. I haven't used any of them yet
but was planning on exploring them further. If you try any of them, let me
know how it works out for you!

Thanks,
Bradley

On Fri, Jun 27, 2008 at 7:08 AM, Mike van Hoof <m....@scheepens.nl> wrote:

>  Hey Everyone,
>
> Thanks for the advice!
>
> Had a discussion with my fellow developpers and the way Bradley explaned
> his new way of working is how we are going to do it. So everybody is going
> to get his own webserver in his local computer.
> When somebody commits his changes a hook script is going to export a
> version from the repository to the "beta" server.
>
> Again thanks, and if i run into trouble i'll let you know. Also i'll write
> a workflow document and post it sothat others can use it too!
>
>
> Met vriendelijke groet,
>
> Mike van Hoof
>
> *Scheepens reclame adviseurs
> Post **›** *Postbus 954, 5000 AZ, Tilburg
> *Bezoek **›** *Sportweg 14, 5037 AC, Tilburg
> *Telefoon **›** *013 5950 900
> *Fax **›** *013 5950 901
> *e-mail **›** **m.vhoof@scheepens.nl*
> *internet **›** **www.scheepens.nl*
>
> *› Opvallend veelzijdig*
>
>
>  ------------------------------
> *Van:* Bradley Holt [mailto:bradley.holt@foundline.com]
> *Verzonden:* donderdag 26 juni 2008 17:52
> *Aan:* Mike van Hoof
> *CC:* users@subversion.tigris.org
> *Onderwerp:* Re: Subversion workflow with PHP
>
> Mike,
>
> We're currently using Subversion for PHP projects and plan on setting up a
> similar process. First, let me explain our current process, then I'll
> explain the better process I'm planning on implementing. We currently have
> "beta" and "www" versions of each site. As work is done in the trunk, a user
> will upload files to beta through FTP (everyone has their own working copy
> from which they FTP their files). Sure, you can overwrite someone else's
> work and mess stuff up on beta but there are few things that mitigate this.
> The first rule is you should commit something before (or very shortly after)
> uploading it to beta. The second rule is you should run updates often to
> make sure you've got the latest code from everyone else. The third rule is,
> if you upload something and didn't commit it, don't complain when someone
> else overwrites your work! Files are rolled out from an svn export to www to
> make sure www is always consistent. This isn't a great process, but it works
> reasonably well as long as everyone understands and follows the rules.
>
> Now, the better process I'm currently working on implementing: each user
> has their own working copy which is tied to a local web server. This way
> each user has total control over their working copy and can test their
> changes (and only their changes) before committing. Also, users can have
> more control over how often they choose to run an update and merge in
> repository changes to their working copy. We're planning on using Apache's Dynamically
> Configured Mass Virtual Hosting<http://httpd.apache.org/docs/2.0/vhosts/mass.html>so that we don't have to setup a new virtual host for every new website we
> work on. So, we'd have the following entries in DNS (or you can just use
> your hosts file for the local version below):
>
>    - local.example.org - 127.0.0.1 (loopback address so you use your own
>    web server)
>    - beta.example.org - <beta IP address>
>    - www.example.org - <www IP address>
>
> The next step would be for every commit to automatically get pushed out to
> beta so that, at any given time, one can see exactly what the trunk looks
> like. We're not sure exactly what mechanism we'll use for that yet. Taking
> it a step further, you could have a "beta" equivalent for each maintenance
> branch where changes to a particular branch are pushed out to a common web
> server.
>
> Hope this helps! Let me know if you have any questions.
>
> On Thu, Jun 26, 2008 at 5:23 AM, Mike van Hoof <m....@scheepens.nl>
> wrote:
>
>>  Hello everyone,
>>
>> We are using subversion for a while now, and it works like a charm, but I
>> think our workflow is incorrect:
>> - we have a svn server with svn and the repositories
>> - we also have a webserver, with all our projects in the wwwroot. This
>> projects are our working copies, so every developper works in the same
>> working copy.
>>
>> So I think (no... i KNOW) that that is the wrong way to use subversion.
>>
>> I want every developper to have it's own workingcopy, but if they put
>> everything local it means they have to have their own webserver running
>> locally.
>> An other option is that they copy every change they do to the webserver,
>> but this slows down development.
>>
>> So now my question is: how would you approach this? Is there anyone who
>> did this before and wants to share this with me?
>>
>> I did try to search for this on google, but didn't find what i was looking
>> for...
>>
>> With kind regards,
>>
>> Mike van Hoof
>>
>> *Scheepens reclame adviseurs
>> Post **›** *Postbus 954, 5000 AZ, Tilburg
>> *Bezoek **›** *Sportweg 14, 5037 AC, Tilburg
>> *Telefoon **›** *013 5950 900
>> *Fax **›** *013 5950 901
>> *e-mail **›** **m.vhoof@scheepens.nl*
>> *internet **›** **www.scheepens.nl*
>>
>> *› Opvallend veelzijdig*
>>
>>
>
>
>
> --
> Bradley Holt
> bradley.holt@foundline.com
>
>


-- 
Bradley Holt
bradley.holt@foundline.com

RE: Subversion workflow with PHP

Posted by Mike van Hoof <m....@scheepens.nl>.
Hey Everyone,
 
Thanks for the advice!
 
Had a discussion with my fellow developpers and the way Bradley explaned
his new way of working is how we are going to do it. So everybody is
going to get his own webserver in his local computer.
When somebody commits his changes a hook script is going to export a
version from the repository to the "beta" server.
 
Again thanks, and if i run into trouble i'll let you know. Also i'll
write a workflow document and post it sothat others can use it too!
 

Met vriendelijke groet, 

Mike van Hoof

Scheepens reclame adviseurs
Post > Postbus 954, 5000 AZ, Tilburg
Bezoek > Sportweg 14, 5037 AC, Tilburg
Telefoon > 013 5950 900
Fax > 013 5950 901
e-mail > m.vhoof@scheepens.nl <bl...@scheepens.nl> 
internet > www.scheepens.nl <blocked::http://www.scheepens.nl/> 

> Opvallend veelzijdig

 

________________________________

Van: Bradley Holt [mailto:bradley.holt@foundline.com] 
Verzonden: donderdag 26 juni 2008 17:52
Aan: Mike van Hoof
CC: users@subversion.tigris.org
Onderwerp: Re: Subversion workflow with PHP


Mike,

We're currently using Subversion for PHP projects and plan on setting up
a similar process. First, let me explain our current process, then I'll
explain the better process I'm planning on implementing. We currently
have "beta" and "www" versions of each site. As work is done in the
trunk, a user will upload files to beta through FTP (everyone has their
own working copy from which they FTP their files). Sure, you can
overwrite someone else's work and mess stuff up on beta but there are
few things that mitigate this. The first rule is you should commit
something before (or very shortly after) uploading it to beta. The
second rule is you should run updates often to make sure you've got the
latest code from everyone else. The third rule is, if you upload
something and didn't commit it, don't complain when someone else
overwrites your work! Files are rolled out from an svn export to www to
make sure www is always consistent. This isn't a great process, but it
works reasonably well as long as everyone understands and follows the
rules.

Now, the better process I'm currently working on implementing: each user
has their own working copy which is tied to a local web server. This way
each user has total control over their working copy and can test their
changes (and only their changes) before committing. Also, users can have
more control over how often they choose to run an update and merge in
repository changes to their working copy. We're planning on using
Apache's Dynamically Configured Mass Virtual Hosting
<http://httpd.apache.org/docs/2.0/vhosts/mass.html>  so that we don't
have to setup a new virtual host for every new website we work on. So,
we'd have the following entries in DNS (or you can just use your hosts
file for the local version below):


*	local.example.org - 127.0.0.1 (loopback address so you use your
own web server)
	
*	beta.example.org - <beta IP address> 
*	www.example.org - <www IP address>

The next step would be for every commit to automatically get pushed out
to beta so that, at any given time, one can see exactly what the trunk
looks like. We're not sure exactly what mechanism we'll use for that
yet. Taking it a step further, you could have a "beta" equivalent for
each maintenance branch where changes to a particular branch are pushed
out to a common web server.

Hope this helps! Let me know if you have any questions.


On Thu, Jun 26, 2008 at 5:23 AM, Mike van Hoof <m....@scheepens.nl>
wrote:


	Hello everyone,
	 
	We are using subversion for a while now, and it works like a
charm, but I think our workflow is incorrect:
	- we have a svn server with svn and the repositories
	- we also have a webserver, with all our projects in the
wwwroot. This projects are our working copies, so every developper works
in the same working copy.
	 
	So I think (no... i KNOW) that that is the wrong way to use
subversion.
	 
	I want every developper to have it's own workingcopy, but if
they put everything local it means they have to have their own webserver
running locally.
	An other option is that they copy every change they do to the
webserver, but this slows down development.
	 
	So now my question is: how would you approach this? Is there
anyone who did this before and wants to share this with me?
	 
	I did try to search for this on google, but didn't find what i
was looking for...

	With kind regards, 
	
	Mike van Hoof

	Scheepens reclame adviseurs
	Post > Postbus 954, 5000 AZ, Tilburg
	Bezoek > Sportweg 14, 5037 AC, Tilburg
	Telefoon > 013 5950 900
	Fax > 013 5950 901
	e-mail > m.vhoof@scheepens.nl
	internet > www.scheepens.nl

	> Opvallend veelzijdig

	 




-- 
Bradley Holt
bradley.holt@foundline.com



Re: Subversion workflow with PHP

Posted by Bradley Holt <br...@foundline.com>.
Mike,

We're currently using Subversion for PHP projects and plan on setting up a
similar process. First, let me explain our current process, then I'll
explain the better process I'm planning on implementing. We currently have
"beta" and "www" versions of each site. As work is done in the trunk, a user
will upload files to beta through FTP (everyone has their own working copy
from which they FTP their files). Sure, you can overwrite someone else's
work and mess stuff up on beta but there are few things that mitigate this.
The first rule is you should commit something before (or very shortly after)
uploading it to beta. The second rule is you should run updates often to
make sure you've got the latest code from everyone else. The third rule is,
if you upload something and didn't commit it, don't complain when someone
else overwrites your work! Files are rolled out from an svn export to www to
make sure www is always consistent. This isn't a great process, but it works
reasonably well as long as everyone understands and follows the rules.

Now, the better process I'm currently working on implementing: each user has
their own working copy which is tied to a local web server. This way each
user has total control over their working copy and can test their changes
(and only their changes) before committing. Also, users can have more
control over how often they choose to run an update and merge in repository
changes to their working copy. We're planning on using Apache's Dynamically
Configured Mass Virtual
Hosting<http://httpd.apache.org/docs/2.0/vhosts/mass.html>so that we
don't have to setup a new virtual host for every new website we
work on. So, we'd have the following entries in DNS (or you can just use
your hosts file for the local version below):

   - local.example.org - 127.0.0.1 (loopback address so you use your own web
   server)
   - beta.example.org - <beta IP address>
   - www.example.org - <www IP address>

The next step would be for every commit to automatically get pushed out to
beta so that, at any given time, one can see exactly what the trunk looks
like. We're not sure exactly what mechanism we'll use for that yet. Taking
it a step further, you could have a "beta" equivalent for each maintenance
branch where changes to a particular branch are pushed out to a common web
server.

Hope this helps! Let me know if you have any questions.

On Thu, Jun 26, 2008 at 5:23 AM, Mike van Hoof <m....@scheepens.nl> wrote:

>  Hello everyone,
>
> We are using subversion for a while now, and it works like a charm, but I
> think our workflow is incorrect:
> - we have a svn server with svn and the repositories
> - we also have a webserver, with all our projects in the wwwroot. This
> projects are our working copies, so every developper works in the same
> working copy.
>
> So I think (no... i KNOW) that that is the wrong way to use subversion.
>
> I want every developper to have it's own workingcopy, but if they put
> everything local it means they have to have their own webserver running
> locally.
> An other option is that they copy every change they do to the webserver,
> but this slows down development.
>
> So now my question is: how would you approach this? Is there anyone who did
> this before and wants to share this with me?
>
> I did try to search for this on google, but didn't find what i was looking
> for...
>
> With kind regards,
>
> Mike van Hoof
>
> *Scheepens reclame adviseurs
> Post **›** *Postbus 954, 5000 AZ, Tilburg
> *Bezoek **›** *Sportweg 14, 5037 AC, Tilburg
> *Telefoon **›** *013 5950 900
> *Fax **›** *013 5950 901
> *e-mail **›** **m.vhoof@scheepens.nl*
> *internet **›** **www.scheepens.nl*
>
> *› Opvallend veelzijdig*
>
>



-- 
Bradley Holt
bradley.holt@foundline.com