Don't worry I sorted it....
The context  is passed as a Map into the executor, so in there I do:

Map environmentVariables = (Map) context.getEnvironmentVariables();

String environment = (String) environmentVariables.get("GO_ENVIRONMENT_NAME"
);

and the environment string has the right value.


thanks!


On Mon, Jul 24, 2017 at 3:47 PM, Paul Pogonoski <[email protected]>
wrote:

> OK,
> so if I was to to do:
>
> String goEnvironment = context.environmentVariables.GO_ENVIRONMENT_NAME;
>
> goEnvironment would contain the value of the default GO_ENVIRONMENT_NAME
> environment variable?
>
> On Mon, Jul 24, 2017 at 3:42 PM, Ketan Padegaonkar <
> [email protected]> wrote:
>
>> The execute message should have all the variables available for your task
>> to consume as you see fit. https://developer.gocd.org/cur
>> rent/writing_go_plugins/task/version_1_0/execute.html if you are not
>> receiving those, perhaps logging a bug may be your best option....
>>
>> On Mon, Jul 24, 2017, 7:52 PM <[email protected]> wrote:
>>
>>> Hi,
>>> I'd like to be able to extend the capability of Go's Authorisation by
>>> invoking some XACML requests.
>>> To make this as automated as possible, I don't want the use to enter
>>> values into the task that has been defined as an environment variable for
>>> the Pipeline.
>>>
>>> How do I use the GoApplicationAccessor to request the list of pipeline
>>> environment variables, both defined by the user and the default ones
>>> like GO_ENVIRONMENT_NAME?
>>>
>>> PP
>>>
>>> --
>>> 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 a topic in the
>> Google Groups "go-cd" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/go-cd/9ndY28K879s/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Paul Pogonoski
> Principal
> Email [email protected] <[email protected]>
> Telephone +44 7488 747577 <+44+7488+747577>
> [image: ThoughtWorks]
> <http://www.thoughtworks.com/?utm_campaign=paul-pogonoski-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>
>



-- 
Paul Pogonoski
Principal
Email [email protected] <[email protected]>
Telephone +44 7488 747577 <+44+7488+747577>
[image: ThoughtWorks]
<http://www.thoughtworks.com/?utm_campaign=paul-pogonoski-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>

-- 
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.

Reply via email to