I am using nodejs build step to create enviornment variables (on linux agent) using process.env["something"] = "somethingelse". After creation if I echo the variables, i can see the values but as soon as I go in next build step all the env variables created go away. How can I fix this issue? I am using team city 10. I can not use the env variables functioanlity provided as part of parameters so that is why need to go via this route. Any help will be really appreciated. Here is the code written in nodejs teamcity step.
fs = require('fs');
var envFile = process.argv[2];
fs.readFile(envFile , 'utf8', function(err, data) {
if (err) {
return console.log(err);
}
var json = JSON.parse(data);
for (var key in json) {
process.env[key] = json[key];
console.log(process.env[key]);
}
});