Cake.GitLab
by ap0llo
Cake aliases for interacting with GitLab
The GitLabCI alias, which returns an IGitLabCIProvider instance can be used to interact with the GitLab CI/CD environment.
The following example prints the build number if running on GitLab CI/CD:
if (BuildSystem.GitLabCI.IsRunningOnGitLabCI)
{
Information(BuildSystem.GitLabCI.Environment.Build.Id);
}
else
{
Information("Not running on GitLab CI/CD");
}
See IGitLabCIProvider for details and available methods to interact with GitLab CI/CD.
You can run Cake on GitLab CI/CD using the dotnet cake command:
cake_build:
script:
- dotnet cake