========================================================================

========================================================================

This program exists only to make up for the lack of background processing under WindowsNT. It allows you to maintain multiple web sites in CVS and keep a current version checked out on the web server all times. It only operates under WindowsNT, which shouldn't be a problem since CVSNT only works under NT itself.

This program assumes that all of the web sites are located in a single folder (though that could be the root of a drive) and that the CVS module name is the same as the name of the directory storing that site. The CVS server does not need to be the same machine as the web server, but if it is not, the CVS service needs to be run under a user account that is a member of the Local Admin group in order to schedule the remote task.

========================================================================

========================================================================

The program, as shipped, will run a "cvs -q update -dP" in the directory of each file which is committed to the repository. Since CVS is, by default, recursive, this will walk the directory structure and update all files below the current directory. Consider the following layout:

When I commit that file to the repository, approximately a minute later the follow commands will execute:

And all files in the W:\websites\SomeSite\htdocs\sales\ directory and below will be updated to the current repository revision.

========================================================================

========================================================================

Copy the CVSNTUpd.exe and CVSNTUpd.ini files to the $CVSROOT/CVSROOT directory. Alternatively, copy the executable to somewhere in the PATH and copy the ini file to WINNT. See below for instructions on setting the INI file configuration.

Insert a line into the LOGINFO file like this:

That's it! Your websites will now be kept in sync with the repository. If you work on a development branch, you can move your web site to that branch and this will still keep the site in sync with that branch.

========================================================================

========================================================================

To eliminate a lot of the command line options, I created an INI file to store the unchanging settings.

This will schedule the update to run 1 minute from the current time. NOTE: if you schedule it at 14:59:59, it will run at 15:00:00. It is not 1 minute from when you schedule it, but rather the next minute after you schedule. You can set this delay higher, but I don't know why you would want to. ;~)

This is what will be passed to the "cvs -d" option to set the repository. Obviously, this is relative to the server, not the client. I suggest using :local: rather than some other connection method if you can. If your web server is not the same machine as the repository server, you will need to use :ntserver: (to connect as the account which was used to schedule the task) or :pserver: (include the user and password). Basically, whatever you need to run as your CVSROOT when updating the web site from a command prompt should be what you store here.

This is the actual CVS command which will be run in that directory. It is an optional parameter and will default to the command shown above. This is usually what you want to do. CVS will, additionally, always be run with the "-q" option, since there is no point in logging the normal server chatter.

This is the initial portion of the path to the directory to update. If you add the module path %{} to this, you must have a legal directory on the web server machine. This is the directory which will be the base for the CVS command. In essence, the scheduled command will CD to the directory WWWRoot\%{} and then run the update. Therefore you can not specify a UNC filename and instead must use mapped drive letters to shared folders and make sure the mapped drive letter is created when the CVS server boots.

An optional parameter, which allows you to schedule the update to occur on a different server from the CVS repository server. The account used to run the CVS server needs to be a member of the Local Admin ground to schedule a remote job (or possibly Domain Admin if your servers are in a domain). IMPORTANT NOTE: I have not tested this extensively! YMMV! Please let me know of any changes you need to make to the code to get this to work; I am only going off what Microsoft's documentation states.

========================================================================

========================================================================

All of my test web sites are stored under a single folder called "websites" on the W:\ drive of the same machine that contains the CVS repository. I do not use this automatic updating for my production sites! See below for details.

I am using the MODULES file to name the web sites in a consistent fashion. From the top level site directory, i.e.

I run the following import command

Then I add the following line to the CVSROOT\modules file

and then delete (or rename away) the W:\websites\SomeSite folder. Lastly, I check out the site in W:\websites

which will create the CVS controlled folder SomeSite and within that create all of the appropriate files/folders.

In order to use CVSNTUpd, I then add the following line to the LOGINFO file:

NOTE: if all of the web sites are set up in this fashion, you can use the following line instead:

and all of the websites will be automatically updated and you can still have other modules in the repository which do not need this special handling.

Once any changes have been made and tested, my production web sites are also checked out copies from the CVS repository. However, the production sites are always HEAD revisions, so that the test server can be off on some branch and I can still make a quick change to the production site by checking out the HEAD revision. Once a branch is merged back into the main stream, the new changes can be checked out to the production site.

CvsNtUpd (last edited 2006-03-05 17:13:24 by devguy)