Feature request: read environment variables into variables

I know you are working on an API so people are able to automate Continua CI. However I want it now :-)

I think you can really easily fix this by allowing the Set variable action to read an environment variable from the build agent. Then I can run an executable setting the value, and then read the value.

What needs to be done

1) Additional textbox with variable name on the action view

2) If the env. name property is filled, use Environment.GetEnvironmentVariable to get the value

3) If it succeeds => set it to the variable

4) If it fails => fail the build


This is a very basic but really powerful way so everyone can start automating Continua CI without you having to write a full API. I really hope you can schedule this on the short term, for me this is one of the highest priorities to help spreading the good word about Continua CI ;-)

Hi Geert

I’m not sure I 100% understand what you are tyrying to do, but you can use Agent environment variables already in actions and Stage Agent Requirements, e.g :

$Agent.Env.VS100COMNTOOLS$

As for reading the value of an environment variable set by a process that the agent runs, that is not possible, parent processes cannot access the environment block of a child process, and once the child process has terminated, it’s environment block is gone. This is a windows limitation, not a Continua (or FinalBuilder, this comes up with FB occasionally too).

I will try to get up a repro. This will provide great benefits to all users. Give me an hour or so to see if I can get this working.

Please see https://dl.dropboxusercontent.com/u/8455721/ChildProcessVariables.zip

For now I would be able to use GitFlowVersion (see https://github.com/Particular/GitFlowVersion) this way:
1) Run executable with “continuaci.$Project.Name$.$Configuration.Name$.version” => this sets the env variable
2) Set variable GitFlowVersion to the environment variable (possible because of this new feature)
3) Set the current build version to variable GitFlowVersion

In the long run, you might want to add a simple PropertyCollection for GitFlowVersion in Continua CI and create an action for it which does just this. I think it will be a great feature for Continua CI to automatically determine the build version over multiple configurations used by the same project.