GitLabCICommands.

SetEnvironmentVariable(FilePath, string, string) Method

Summary

Creates or updates an environment variable for any steps running next in a job.
Namespace
Cake.Common.Build.GitLabCI
Containing Type
GitLabCICommands

Syntax

public void SetEnvironmentVariable(FilePath envPath, string key, string value)

Examples

if (BuildSystem.GitLabCI.IsRunningOnGitLabCI)
{
    BuildSystem.GitLabCI.Commands.SetEnvironmentVariable("./gitlab.env", "MY_VAR", "value");
}
if (GitLabCI.IsRunningOnGitLabCI)
{
    GitLabCI.Commands.SetEnvironmentVariable("./gitlab.env", "MY_VAR", "value");
}

Parameters

Name Type Description
envPath FilePath Path to env file.
key string The key.
value string The Value.

Return Value

Type Description
void