GitLabCIEnvironmentInfo.

Build Property

Summary

Gets the GitLab CI build information.

Syntax

public GitLabCIBuildInfo Build { get; }

Examples

if (BuildSystem.GitLabCI.IsRunningOnGitLabCI)
{
    Information(
        @"Build:
        Id: {0}
        Reference: {1}
        Tag: {2}
        Name: {3}
        Stage: {4}",
        BuildSystem.GitLabCI.Environment.Build.Id,
        BuildSystem.GitLabCI.Environment.Build.Reference,
        BuildSystem.GitLabCI.Environment.Build.Tag,
        BuildSystem.GitLabCI.Environment.Build.Tag,
        BuildSystem.GitLabCI.Environment.Build.Stage
        );
}
else
{
    Information("Not running on GitLabCI");
}
Information(
    @"Build:
    Id: {0}
    Reference: {1}
    Tag: {2}
    Name: {3}
    Stage: {4}",
    GitLabCI.Environment.Build.Id,
    GitLabCI.Environment.Build.Reference,
    GitLabCI.Environment.Build.Tag,
    GitLabCI.Environment.Build.Tag,
    GitLabCI.Environment.Build.Stage
    );

Value

Type Description
GitLabCIBuildInfo The GitLab CI build information.