Hi , 

You should use this environment variable to get counter. 

Example : ${GO_PIPELINE_COUNTER}

On Tuesday, April 5, 2022 at 6:40:41 PM UTC+5:30 [email protected] wrote:

> I'm also facing the same problem. The variable is set in the same task 
> instance.
>
> On Thursday, 31 December 2020 at 09:15:16 UTC+8 [email protected] 
> wrote:
>
>> GoCD's Agent architecture doesn't run the entire job (within a stage) in 
>> a single shell. So if you export / set an environment variable in one task 
>> and try to access it in the next. It wouldn't work. I would suggest using a 
>> BAT/PS script (if you're on Windows) or shell script (if you're on Linux / 
>> Mac) to automate your workflows. Also it is a good practice to keep the job 
>> specific sequence of tasks outside GoCD so your CI/CD workflow is not 
>> tightly coupled to your CI/CD system.
>>
>> Thanks,
>>
>>
>> On Sun, Dec 27, 2020 at 10:24 PM gdlai cn <[email protected]> wrote:
>>
>>> i want set environment variable *GO_PIPELINE_COUNTER* in task command, 
>>> but it dont't work.
>>>
>>> at task command,i try like this: *${GO_PIPELINE_COUNTER},*or 
>>> *%GO_PIPELINE_COUNTER%*, but all not work.
>>>
>>> how to do?
>>>
>>> -- 
>>> 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].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/go-cd/cafc5439-b49f-4202-b578-d486baefa388n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/go-cd/cafc5439-b49f-4202-b578-d486baefa388n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> -- 
>>
>> Ashwanth Kumar / ashwanthkumar.in
>>
>>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/b344a1d4-1e40-4eb3-a1fd-649e68aa1546n%40googlegroups.com.

Reply via email to