Hello everyone,
I have the following problem. I need to set an environment variable to
set a library path and I would like to do this from the
cruisecontrol.net configuration file to have all configuration in one
file. This did not work, so I created a test project. Here is the
ccnet.config file:

<cruisecontrol xmlns:cb="urn:ccnet.config.builder" xmlns="http://
thoughtworks.org/ccnet/1/6">
        <project name="Environment Test">
                <category>Test</category>
                <artifactDirectory>C:\CruiseControl\Artifacts\EnvTest\</
artifactDirectory>
                <workingDirectory>C:\CruiseControl\EnvTest\</workingDirectory>
                <tasks>
                        <devenv>
                                <environment>
                                        <variable name="LibDir" 
value="C:\CruiseControl\Release\" />
                                </environment>
                                <solutionfile>EnvTest.vcxproj</solutionfile>
                                <buildtype>Rebuild</buildtype>
                                <configuration>Release|Win32</configuration>
                        </devenv>
                </tasks>
                <publishers>
                        <xmllogger />
                </publishers>
        </project>
</cruisecontrol>

The EnvTest.vcxproj only has a post-build step which echoes
environment variables. A snippet:
    <PostBuildEvent>
      <Command>echo Environment variables:
echo LibDir is $(LibDir)
echo USERNAME is $(USERNAME)
</Command>

I guess I need to either:
- set the environment variable before starting the ccnet server, or
- make a separate user for the ccnet server which has the environment
variables set.

Both options work, but we would much rather have all build
configuration in the ccnet.config file and not need to make other
settings. Plus, the documentation mentions the environment variable
option, so I guess this is a bug.

Can anyone confirm?

Reply via email to