[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: controlled files to be deployed to different environments

From: Kaz Kylheku
Subject: Re: controlled files to be deployed to different environments
Date: Wed, 21 Aug 2002 12:18:10 -0700 (PDT)

On Wed, 21 Aug 2002, Daniels, Dave F wrote:

> Currently, I have the development version controlled, and when my project is
> ready for deployment to production, I manually change the contents and send
> it off (but don't change the version in CVS). I would like suggestions on
> ways to control different versions of the same file. So far, the best idea
> we've come up with is to give each version a different extension and then
> use our make utility to pull the right one and rename it, so
> becomes Any other suggestions?

How you generate your drived object from version-controlled primary
objects isn't a CVS issue, because it's not a build system.

One solution would be to write a program which generates the file,
based on some inputs which determine the relevant characteristics of
the environment.

The program could be written in a scripting or macro preprocessing
language. For this type of thing, look for a language that has good
formatted output capabilities; the ability to write most of your text
in one large chunk, with a notation indicating where the variations are
to be inserted. Macro preprocessors like m4 are specialized to do this; the
body of the program *is* the output text, plus embedded notations
to define and expand macros, and do other useful things. The POSIX
shell language has a ``here document'' feature which allows a script to
send part of its body to a file or pipe, with variable references being
expanded into the text, so that:

    cat > myfile <<END
    The value of VARIABLE is $VARIABLE

will deposit the line ``The value of VARIABEL is foo'' into the file
called ``myfile''. The Perl language has a similar feature.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]