Forums / General / Working with eZ publish and Subversion

Working with eZ publish and Subversion

Author Message

Cristian G. L.

Tuesday 15 June 2004 12:37:42 am

Hi

I work often with Subversion and i would like use it with eZ publish too.
But i have problems when working with SVN and eZ publish:
The configuration files can be modified by changing the local copy and commiting, but also can be modified from the web interface. The changes made from web interface aren't commited to repository, then i can't get them to my local copy with "update" command.
But i have problems with the templates also. When i define an override from web interface, it creates an empty template. If i want to commit my own personalized template (that will have the same name), i get a conflict (the file does exist because eZ publish created it, but i can't see it in my local copy).

The question it's... someone work with eZ publish and version control systems? How do you work with them?

Thanks in advance (and sorry for my poor english)

Cristian

Tony Wood

Tuesday 15 June 2004 1:04:03 am

Hi Cristian,

SVN will work well with eZ publish. We use SVN for our development and have had no problems. How are you getting eZ publish? Are you using a download or the svn version?

If you are using the svn version try exporting the code before you start changing it. svn export etc. It sounds like the eZ svn setup and yours are getting mixed up.

-- tony
http://www.visionwt.com

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Cristian G. L.

Tuesday 15 June 2004 1:45:08 am

Hi Tony

I don't work with SVN repository versions of eZ publish, but that i downloaded release packages. This isn't the problem.
I am talking about develop web sites with eZ publish using version control systems, not develop eZ publish itself (sorry if i explained it confusedly).
The problem is the versioning of templates and some configuration files like <i>override.ini.append</i>, because i change them from my local copy and from web interface.
Should i modify files only from local copy (and commit to repository) and forget the web interface facilities?
Always i make changes (that affect to some file, not database) from web interface i get SVN conflicts that cause a lost of time. This is frequent when i define overrides from web interface (eZ publish modify a configuration file with changes that i can't see in my local copy and creates an empty template that i can't overwrite from my local copy without get a SVN conflict).
I am interesed in know how people develop sites with eZ publish using version control systems like SVN.

Bye

Cristian

Paul Forsyth

Tuesday 15 June 2004 1:53:52 am

Cristian,

Which OS do you use?

Here we develop with Linux and take advantage of symbolic links to separate eZ publish from our templates. In general we have sym links for:

- design/user
- settings/override
- settings/siteaccess/admin
- settings/siteaccess/user
- var/storage
- extensions

These directories, and the files within, are the only ones we version control. By running a script we make sure eZ publish can link to those files and have the correct user and file permissions.

We dont really use the admin to save files but it shouldnt be a problem. Providing the modified files save into the above directories you shouldnt get conflicts.

Does this help at all?

paul

--
http://www.visionwt.com

Cristian G. L.

Tuesday 15 June 2004 8:26:07 am

Hi Paul

The web server with eZ publish and the SVN repository are in a Linux machine. The SVN clients are running on Windows 2003 Server.
About the symbolic links... i can't understand how you can avoid the conflicts between changes from the web interface and changes commited from local copies.
Subversion data is stored in a database (not in a directory), therefore you can't configure the repository so that the changes are commited in the <i>/var/www</i> directory. Then, i know two ways of work with SVN and eZ publish:
- In the <i>/var/www</i> i can put an local copy (and configure SVN so that it do an <i>update</i> every time somebody do a <i>commit</i>).
- Configure SVN so that do an <i>export</i> to the <i>/var/www</i> directory every time somebody do a <i>commit</i>.
With both methods i can't get the changes made from web interface in my local copies. With the second method i overwrite all changes made from web interface when i do a commit. With the first method, if i change some configuration file or i define an override from web interface, i will get a conflict when i commit some change in those files.
How i should configure SVN for work without problems with eZ publish? Should i forget some facilities of web interface like override management and <i>ini</i> files modification?

Thanks (and sorry for my bad english)

Cristian

Paul Forsyth

Tuesday 15 June 2004 8:54:56 am

I didn't realise you were speaking about local/remote management, sorry.

Obviously changes on your remote/deployed environment wont be the same as locally. Unless you rsync the files at some point this is difficult to manage.

We always work locally and periodically rsync our files with the server. Never the other way around. The directories i mentioned previously are the only ones we version control, never the eZ system, so its quite easy to separate files.

paul

--
http://www.visionwt.com

Pablo C. Vergara Castro

Thursday 17 June 2004 2:36:26 am

The problem that have Cristian and me is that we do not know how could subversion synchronizes the changes that the Web server does in "his local working copy" (using the interface of administration) on "our local working copies".

We have setup subversion like I say: If we made commit on "our local working copy", for example, from our directory design subversion (using a post-commit script) made update to directory design that there is in /apache/www/directory. But, for expale, if apache creates a template we will not have this template.

Paul Forsyth

Thursday 17 June 2004 2:48:49 am

One way around this is to use rsync and diff to determine if there any changes.

Start by making an export of your files to a local directory, and then upload/rsync these files to your apache directory. Periodically, download your apache files to *another* directory and perform a directory diff on both directories. If anything has changed the diff will record it. You can then apply that diff to your repository files and perform a commit.

Does this make sense? We dont do this but it should in theory work :)

paul

--
http://www.visionwt.com

Pablo C. Vergara Castro

Thursday 17 June 2004 3:10:06 am

The problem of this solution is that you sopouse that we have access to the server computer (using ftp or telnet) to catch the files once in a while but, what can we do if we only have access to the server computer using svn for security reasons and for use only one method to access to this file (if you can get the files using svn why you need ftp)?.

The idea is try to use Apache like an "other subversion user" and them, when this "user" create/modify any file of his local working copy. can make an svn update.

I know it's really complicate but the question is... it will be possible to be done?

Tony Wood

Thursday 17 June 2004 4:23:32 am

Hi,

A couple of questions,

* are the users on the apache server updating the templates via eZ publsh editor or via FTP or vi etc?
* could you install SVN client on the apache server?

If you are able to install SVN client on the apache server then you could write a workflow or a shell script that ran svn commit /your directory/to/templates/ and updated the repository everytime a change was made.
Of course you would need to ensure that b4 they edit a template you run svn up /your directory/to/templates/ to ensure they have the latest copies.
Secuirty is of course an issue, but as long as you cover that you should be ok.

Have I understood your problem correctly?

--
tony
http://www.visionwt.com

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Pablo C. Vergara Castro

Thursday 17 June 2004 4:46:44 am

Well... the question:

* are the users on the apache server updating the templates via eZ publsh editor or via FTP or vi etc?
* could you install SVN client on the apache server?

The users "may" update the templates via commit her working copies or via editor... in this moment can do via ftp too... but I'm trying to use only one access method (I reconise...I am the administrator :-) )
Yes the server computer have an svn client.

THHAANKKSS REAAALLYY THAAANNNKSSS BY THE ANSWER but..."If you are able to install SVN client on the apache server then you could write a workflow or a shell script that ran svn commit /your directory/to/templates/ and updated the repository everytime a change was made." How can I do this?... how can i writ a workflow? this is exclaty my problem :-(.

Tony Wood

Thursday 17 June 2004 5:17:03 am

ok,

Workflow info can be found here.
http://ez.no/ez_publish/documentation/building_an_ez_publish_site/the_guestbook/connecting_the_workflow_to_a_trigger_function
http://ez.no/ez_publish/documentation/building_an_ez_publish_site/the_guestbook/creating_a_workflow

Can't find any examples of writing workflow so here is an example
http://pubsvn.ez.no/websvn/listing.php?repname=community&path=/trunk/extension/worldpay/eventtypes/event/worldpay/&rev=0&sc=1

you could also rewrite some of the kernel to add a commit to the end of the template edit command. To be honest though I would run a script every hour from cron that checks for updates to the template directory. If it finds one then it will do the commit. The advantage here is that you can su to the right user for the commit. This means that you do not need to give "apache|nobody" svn commit rights

-- tony
http://www.visionwt.com

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Pablo C. Vergara Castro

Thursday 17 June 2004 6:01:36 am

Only one think...THANKS.

Pablo C. Vergara Castro

Thursday 24 June 2004 12:54:58 am

> ok,

>Workflow info can be found here.
>http://ez.no/ez_publish/documenta...g_the_workflow_to_a_trigger_function
>http://ez.no/ez_publish/documenta...te/the_guestbook/creating_a_workflow

I read the short,short,shor documentation but I did not find the form to do "svn update" when templates are created or modified from the administration interface.

One week ago I received the book but it has not helped me either much in that sense (I did not read everything either).

>you could also rewrite some of the kernel to add a commit to the end of the template edit command.

Please can you said me the name of the template? (design/standart/content/edit.tpl?)