Thank you!

My notes say I tried that already, but I tried it again and it works! I've 
spent hours trying to find out the correct syntax.

On Thursday, October 17, 2024 at 10:47:01 PM UTC-4 Chad Wilson wrote:

> Specifically for windows tasks, "*<arg>%GO_PIPELINE_COUNTER%</arg>*" 
> should work, since Windows commands are executed via exec
>
>
> https://docs.gocd.org/current/faq/dev_use_current_revision_in_build.html#2-using-an-environment-variable-in-a-custom-command-on-windows
>
> If that's not working, I'll take a look - might need to update the 
> documentation at the very least. If it's not working, I have a suspicion I 
> know what "broke" it - there were MANY issues earlier with spaces and 
> quoting and arg splitting on Windows and a side effect of fixes for those 
> *might* have been to affect this. :-)
>
> There will be workarounds involving using cmd /c /s or powershell directly 
> so ensure you get a variable for the "shell" to interpolate, but maybe we 
> start with trying to see whether it works "as documented".
>
> -Chad
>
> On Fri, Oct 18, 2024 at 8:50 AM Michael Foster <msf...@gmail.com> wrote:
>
>> I'm using GoCD in Windows environments, and trying to use the standard 
>> environment variable GO_PIPELINE_COUNTER to enumerate things distinctly. 
>> But I can't get any standard environment variable to work, such as with 
>> this kind of command:
>> ```
>>         <jobs>
>>           <job name="PullAndUpdate">
>>             <tasks>
>>               <exec command="echo">
>>                 <arg>${env.GO_PIPELINE_COUNTER}</arg>
>>                 <runif status="passed" />
>>               </exec>
>> ```
>> I've tried with and without braces and parentheses, and with $ and % (# 
>> is apparently only for parameters), and with and without "env.". Anything I 
>> try just gives me the literal text as output.
>>
>> Is there any way to actually USE the standard environment variables 
>> within a pipeline?
>>
>>
>> Thank you!!!   Michael F.
>>
>> -- 
>> 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 go-cd+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/go-cd/2271247d-94f9-4800-b10d-3c00e0c3029en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/go-cd/2271247d-94f9-4800-b10d-3c00e0c3029en%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 go-cd+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/dc9fe47e-fcf7-4d18-a7c4-51201db06bf7n%40googlegroups.com.

Reply via email to