[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

web interface for managing export a website from repository

From: Yuri Timofeev <tim4dev_at_gmail.com>
Date: Sat, 20 Sep 2008 20:38:41 +0300

Hi
Written on PHP for himself, perhaps these scripts will be somebody
needed. Write to me, I put the code, for example, in Sourceforge.

Description:

A set of scripts named "svnexport" is intended to update the Web site
from the Subversion repository by using
"svn export [options]" command.
You can work through a Web interface or from the command line.

The scheme of works
~~~~~~~~~~~~~~~~~~~

Attention! The script svnexport.php should be placed outside catalog
the Web site.
Attention! Catalog/section of the website (or DocumentRoot for the
entire website),
which will be updated through the "svn export" must be a symlink!

Approximate scheme directories on a website:

[some dir]
 |
 +--site_dir --(symlink)--> site_dir.1
 |
 +--site_dir.1
 |
 +--site_dir.2
 |
 |
 +--svnctrl (web interface for svnexport)

The scheme of a works through a Web interface:
    - user authorization (names, passwords are set up in the
configuration file);
    - enter in web form the revision parameter (optional). See "svn
help export" for details.
    - after clicking "Run svn export" button in the web form on the
disk creates a file FLAG with data for export;
    - svnexport.php script runs in cron, for example, every 10-15
minutes and monitors the presence of a file FLAG;
    - if the FLAG file exists, then read the data for export, mainly
is setting "revision";
    - further deleted all the files/subdirectories from off-site
catalog site_dir.2
(see above diagram of directories on the webserver);
    - do svn export in site_dir.2;
    - if all successful, the symlink
        site_dir -> site_dir.1
      is replaced by
        site_dir -> site_dir.2
NOTE. The next launch svnexport.php will be cleaned a off-site
directory site_dir.1.
svn export will be into site_dir.1 and symlink site_dir will reassign
from site_dir.2 to site_dir.1.
    - after the successful completion of works, called a user script HOOKAFTER.
In the script HOOKAFTER can be, such as setting rights for files and
directories.
    - the user(s) receives an email detailed report.

The scheme of a works through a command line:
    - sure to specify a parameter -f (force)
    - FLAG file and its contents are ignored, but at the end of it is
removed (if exists);
    - the rest work is being done as described above.

System requirements
~~~~~~~~~~~~~~~~~~~

PHP4 and later, http server, access to the server file system and crond.

Notes
~~~~~

Method autoupdate website after each commit described here
http://subversion.tigris.org/faq.html#website-auto-update
but in some systems, it does not work.

-- 
with best regards
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-09-20 20:38:54 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.