GoCDEnvironmentInfo.

EnvironmentName Property

Summary

Gets the environment name. This is only set if the environment is specified. Otherwise the variable is not set.

Syntax

public string EnvironmentName { get; }

Examples

if (BuildSystem.GoCD.IsRunningOnGoCD)
{
    Information(
        @"EnvironmentName: {0}",
        BuildSystem.GoCD.Environment.EnvironmentName
        );
}
else
{
    Information("Not running on GoCD");
}
if (GoCD.IsRunningOnGoCD)
{
    Information(
        @"EnvironmentName: {0}",
        GoCD.Environment.EnvironmentName
        );
}
else
{
    Information("Not running on GoCD");
}

Value

Type Description
string The environment name.