[wpkg-users] Passing Environment Variables to wpkg.js on the command line

Rainer Meier r.meier at wpkg.org
Wed Oct 20 18:55:51 CEST 2010


Hi Andy,

On 20.10.2010 10:41, Andy Welch wrote:
> What I would like to do is invoke a certain build from more than one shortcut –
> passing in values for environment variables on the command line.

WPKG already supports several ways to perform this task.

You can specify variables in <host /> and <profile /> XML nodes. E.g.
<profile id='hosts-A'>
  <variable name="SQLSERVER" value="SQLDEV-2005-A" />
  ..
</profile>

This would set the variable SQLSERVER for all hosts using this profile. So
simply creating the correct profiles for your hosts will set the correct values
for your host. In general it's anyway a good idea to make sure that hosts with
different configuration are assigned to an independent profile. If both profiles
are very similar you might just prepare two profiles for the hosts and a third
one containing the packages and the host profiles depend on this one.

<profile id='hosts-A'>
  <variable name="SQLSERVER" value="SQLDEV-2005-A" />
  <depends profile-id="default" />
  ..
</profile>

<profile id='hosts-B'>
  <variable name="SQLSERVER" value="SQLDEV-2005-B" />
  <depends profile-id="default" />
  ..
</profile>

<profile id='default'>
  <package package-id="..." />
  ..
</profile>


You might also put your environment values into WPKG client configuration. WPKG
client allows you to set any environment variable on the environment where
wpkg.js is launched.

Or just wrap wpkg.js execution in a simple cmd script which sets the correct
environment.


br,
Rainer



More information about the wpkg-users mailing list