|
|
  
License
See here
CVSNTUpd Synchronizes CVS to any Filesystem Folder - Automatically
CVSWebSync Commits Web Sites (or any other directory structure) to
CVS
Sometimes forcing website authors to use CVS is unrealistic. FrontPage
Extensions make it easy to modify content but at the risk of losing change
history. With CVSWebSync, you can commit content from your website into
CVS at whatever interval you choose.
Caveats:
- This program only works if your computer has filesystem access (at least
read access) to the web site's files, either locally or via a network share.
In other words, if the website files are only accessible via FTP, you can
still use CVSWebSync but you have to script the FTP download yourself, which
is usually unrealistic due to FTP timeouts over the Internet.
- CVS commits only occur when you invoke CVSWebSync. If someone
modifies a file twice between invocations, CVSWebSync will only save the last
revision to CVS.
- CVSWebSync is unable to keep track of who modified which files. CVSWebSync commits all changes using the same CVS user account.
- CVSWebSync doesn't yet remove deleted files from your web server from CVS
Given these caveats, CVSWebSync may not be for you. Or, CVSWebSync may
be better than having no revision history of your website.
Instructions:
-
Download FileTools 1.8.1.5 or later
- For Windows, get the latest FILETOOLS_*.TAR.GZ (1.8.1.5 or later)
- If you want to use the Perl source code option:
- Install
Perl
- Extract FILETOOLSPERL_*.TAR.GZ to a location in your PATH
- Extract FILETOOLSPERL_LIB_*.TAR.GZ to the Perl lib directory
e.g.,
c:/perl/site/lib (keep the root directory for the
archive which is cfgmgmt)
- Install the
Clone module
ppm
install Clone
- Please note that if you use the Perl source code, you must
invoke scripts as
scriptname.pl or perl -S
scriptname.pl rather than as scriptname
-
Create a dummy CVS repository for testing
- Create a new directory, e.g.,
c:/cvs/cvswebsync
- Enter the following command:
cvs -d :local:c:/cvs/cvswebsync init
- Create the web module:
mkdir c:\cvs\cvswebsync\web
- Create a sandbox and check out CVS
c:
cd \
mkdir sandbox
cd sandbox
cvs -d :local:c:/cvs/cvswebsync co CVSROOT
cd CVSROOT
- Modify the
cvswrappers file in the CVSROOT
directory in your sandbox. This file lists all binary file
extensions that appear in your website.
Here is a recommended file.
- Run the following commands from the command line:
c:
cd \sandbox\CVSROOT
cvs -d :local:c:/cvs/cvswebsync commit
-
Create a new directory, e.g.,
c:/cvswebsync
-
Add the following XML file to that directory. See
the description of this XML file. Save the file as
package.XML
<Package-Doc>
<CVS>
<CVSModule>web</CVSModule>
<CVSROOT>:local:c:/cvs/cvswebsync</CVSROOT>
<CommitMessage>Committing Files</CommitMessage>
<Tag></Tag>
</CVS>
<DeleteDir>CVS</DeleteDir>
<DeleteDir>_vti_cnf</DeleteDir>
<DeleteDir>_vti_log</DeleteDir>
<DeleteDir>_reqdis</DeleteDir>
<DeleteDir>_private</DeleteDir>
<DeleteDir>_vti_script</DeleteDir>
<DeleteDir>_vti_pvt</DeleteDir>
<DeleteDir>_vti_text</DeleteDir>
<DeleteDir>_vti_txt</DeleteDir>
<DeleteDir>_derived</DeleteDir>
<DeleteDir>Copy of _vti_cnf</DeleteDir>
<DeleteDir>Copy of _vti_log</DeleteDir>
<DeleteDir>Copy of _borders</DeleteDir>
<DeleteDir>Copy of _reqdis</DeleteDir>
<DeleteDir>Copy of _private</DeleteDir>
<DeleteDir>Copy of _vti_script</DeleteDir>
<DeleteDir>Copy of _vti_pvt</DeleteDir>
<DeleteDir>Copy of _vti_text</DeleteDir>
<DeleteDir>Copy of _vti_txt</DeleteDir>
<DeleteDir>Copy of _derived</DeleteDir>
<Delete>_vti_inf.*<Recursive>1</Recursive></Delete>
<Source>
<CVS>1</CVS>
</Source>
<Source>
<Filespec>*</Filespec>
<Filespec>images/<Recursive>1</Recursive>
<KeepDirectoryStructure>1</KeepDirectoryStructure>
</Filespec>
<Filespec>eng/docs/<Recursive>1</Recursive>
<KeepDirectoryStructure>1</KeepDirectoryStructure>
</Filespec>
<Destination>web/</Destination>
</Source>
</Package-Doc>
-
Modify the
<Filespec> tags, delete them, and/or add new ones. These
specify the files and directories in your web site that you want to
check into CVS. If you specify a directory name, either make sure
you end the directory name with a slash or use foo/* as the filespec.
-
Run the following commands:
c:
cd \cvswebsync
dgprune c:/cvs/cvswebsync/web
dgprune sandbox
dgpackage -s [[websitepath]] -d sandbox . package.xmlWhere [[websitepath]] is the full path of the root of your
website, e.g., c:/inetpub/wwwroot
Note: There is a period between sandbox and package.xml
-
This above commands perform the following actions:
- Remove the contents of the
c:\cvs\cvswebsync\web directory (which is your local
throw-away CVS repository only used for testing)
- Delete the contents of the
c:\cvswebsync\sandbox
directory
- Check out the "web" module from CVS to
c:\cvs\sandbox
- Copy the website contents to the
c:\cvs\sandbox\web
directory, using only the files and directories that are specified in
the package.xml file
- Remove IIS administrative directories from the sandbox (
vti_text,
etc.)
- Add new files and folders under
c:\sandbox\web which
have not been committed to CVS yet
- Commit new and changed files in
c:\sandbox\web to CVS
- Test until it works to your satisfaction
- When you're ready to put the script into production,
- Change
<CVSROOT>, <CVSModule>, and
<Destination> in package.xml to work with
your "real" CVS server (<CVSModule> and
<Destination> should not be altered)
- Ensure that the current user has CVS access; i.e., do "
cvs login"
if necessary. If SSH is used, make sure pageant is running and has
your key loaded.
- Create a batch file
c:\cvswebsync\webcopy.bat with the
following commands
c:
cd \cvswebsync
dgprune sandbox
dgpackage -q -s [[websitepath]] -d sandbox . package.xml
Note: There is a period between sandbox and package.xml
- Run the batch program when you want to post your website to CVS
Emailing Notification of CVSWebSync Execution Success or Failure
The CVSWebSync program (dgpackage) returns 0 if it succeeds and
1 if it fails. If you run CVSWebSync in an automated fashion, you can
use another DevGuy FileTool, dgscript, to
receive failure or success notifications via email. dgscript is also
included in the Programmers' Canvas Toolkit (pctk).
- Modify the file
globals.xml in your Program Files/DevGuy/FileTools
folder
- Change the
<SMTPServer> element to contain the name of your
SMTP server
Globals.xml is described
more here
- Add the following XML file to
c:\cvswebsync -- save it as
script.xml
<Script>
<!-- These are the commands to run
-->
<Do>
<Step name="CVSWebSync">
<Run
command="c:\cvswebsync\webcopy.bat"
checkExitCode="true" />
<!-- Use condition="fail" to only receive emails
on failure
-->
<Notify
condition="end">
<!-- Send Email
All values for email addresses can be comma
or semicolon delimited lists
-->
<NotifySMTP to="yourname@yourdomain.com"/>
</Notify>
</Step>
</Do>
</Script>
- Change the
to attribute in <NotifySMTP> to your
email address
- Run the "script" as:
dgscript c:/cvswebsync/script.xml
- If you would like to use the Perl source code, you must also install
the
XML::Simple module
ppm
install Clone
install XML::Simple
- There are two situations which result in new revisions being committed
when modifications have not occurred:
- File contains CVS keywords ($HEADER$, etc.)
- Run the following command for each file that contains CVS keywords:
cvs admin -ko filename
- UNICODE (UCS2, not UTF-8)
- Run the following command for each UCS2 file:
cvs admin -ku filename
|