Out of the box support
The Jenkins alias, which returns an IJenkinsProvider instance can be used to interact with the Jenkins environment.
The following example prints the build number if running on Jenkins:
if (BuildSystem.Jenkins.IsRunningOnJenkins)
{
Information(BuildSystem.Jenkins.Environment.Build.BuildNumber);
}
else
{
Information("Not running on Jenkins");
}
See IJenkinsProvider for details and available methods to interact with Jenkins.
Running Cake
The recommended way to run Cake on Jenkins is by using a tool manifest. In your Jenkinsfile or as a build step, use:
dotnet tool restore
dotnet cake
Available 3rd party extensions
No extensions found
