I am running hudson on Vista and calling MSBuild for C++ solutions (VS 2008).
I have not been able to find a way to export the existing user or system environment variables.
I can manually set env variables via hudson, but I prefer not to do that – I want to use the existing ones that are already set. Is there a way to do this?
Essentially I want to be able to pick from a list of env vars and tell hudson to map those/export those to the processes/workspaces it spawns.
Hudson is running as a service.
I just did a quick test by downloading the latest version of Hudson (1.316), and creating a job that runs simply “set” (if you’re not familiar with this, running set by itself in the console lists all the environment variables within the current scope).
Here’s the console output, these are all the environment variables – user and system, plus variables defined by Hudson itself to make the Hudson meta information available to the jobs:
I suspect your variables are simply not defined within the environment of the owner of the Hudson process (or something like that, we’ll need more information about your Hudson set up to really know).
Edit: Another note, you can have a look at /systemInfo to see all the system properties and environment variables that are available to Hudson. Keep in mind that when Hudson spawns a new process to do work, all environment variables should be available to the child process, unless Hudson explicitly remove them first (this is more a nature of the operating system than Java, I believe). So unless you see any documentation detailing the removal of certain environment variables (and if so, I’m sure the developers would have a reason for it), I’d first check to see if the variables are available to Hudson in the first place.