I would have to call env script each time with each task command as the environment variables will not be persistent between tasks. For instance, I need the environment variables to be based on the pipeline directory. eg ..\pipelines\pipeline1\ baseDir\ ..\pipelines\pipeline2\baseDir\
I could use setx /m to make the environment variables persistent but then this would affect other pipelines that use the same environment variable. Cheers, Sebastian On Thursday, 9 November 2017 17:13:46 UTC+11, Sebastian Stepien wrote: > > Thanks. Aravind. > So I will have to call the script that sets the Environment variables in > each task I need to run. > For instance I would have to call something like: > Task 1 SetEnv.cmd && gradle assemble > Task 2 SetEnv.cmd && <some other command> > etc... > > On Thursday, 9 November 2017 09:39:30 UTC+11, Aravind SV wrote: >> >> Hey Sebastian, >> >> Though GoCD doesn't expand it - by itself, you should be able to use >> %ROOT_VAR% in an exec task. The command executor or shell will be the one >> that does the expansion. >> >> Cheers, >> Aravind >> >> >> On Wed, Nov 8, 2017 at 1:23 AM, Sebastian Stepien <[email protected]> >> wrote: >> >>> Coming from Jenkins. >>> Is it possible to expand the environment variables before running a >>> job/task? >>> eg. >>> ROOT_VAR = c:\baseDir\ >>> ANOTHER_VAR = %ROOT_VAR%\temp >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "go-cd" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- You received this message because you are subscribed to the Google Groups "go-cd" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
