JenkinsEnvironmentInfo.

Repository Property

Summary

Gets Jenkins repository information.

Syntax

public JenkinsRepositoryInfo Repository { get; }

Examples

if (BuildSystem.Jenkins.IsRunningOnJenkins)
{
    Information(
        @"Repository:
        BranchName: {0}
        GitCommitSha: {1}
        GitBranch: {2}",
        BuildSystem.Jenkins.Environment.Repository.BranchName,
        BuildSystem.Jenkins.Environment.Repository.GitCommitSha,
        BuildSystem.Jenkins.Environment.Repository.GitBranch
        );
}
else
{
    Information("Not running on Jenkins");
}
if (Jenkins.IsRunningOnJenkins)
{
    Information(
        @"Repository:
        BranchName: {0}
        GitCommitSha: {1}
        GitBranch: {2}",
        Jenkins.Environment.Repository.BranchName,
        Jenkins.Environment.Repository.GitCommitSha,
        Jenkins.Environment.Repository.GitBranch
        );
}
else
{
    Information("Not running on Jenkins");
}

Value

Type Description
JenkinsRepositoryInfo The repository.