Reputation: 286
Has anyone got any experience of building .net core apps with TeamCity and Octopus? I know there are various guides on implementing this but they rely on having a project.json file which has been removed by Microsoft. Has anyone come up with any solution?
I'm currently using the dotnet-core-plugin suggested by TeamCity - but it appears to rely on the project.json file
Upvotes: 0
Views: 705
Reputation: 252
You could use FlubuCore. Flubu is A C# library that we wrote for building projects and executing deployment scripts using C# code.
Simple Example of how flubu is used in .net core
protected override void ConfigureTargets(ITaskContext context)
{
var compile = context
.CreateTarget("compile")
.SetDescription("Compiles the VS solution")
.AddCoreTask(x => x.ExecuteDotnetTask(StandardDotnetCommands.Restore).WithArguments("FlubuExample.sln"))
.AddCoreTask(x => x.Build("FlubuExample.sln"));
context
.CreateTarget("Package")
.CoreTaskExtensions()
.DotnetPublish("FlubuExample.sln");
var test = context.CreateTarget("test")
.AddCoreTaskAsync(x => x.Test().WorkingFolder("FlubuExample.Tests"))
.AddCoreTaskAsync(x => x.Test().WorkingFolder("FlubuExample.Tests2"));
context.CreateTarget("Rebuild")
.SetAsDefault()
.DependsOn(compile, test);
}
You can find more information about flubu and how to get started here: choice-for-build-tool-msbuild-nant-or-something-else
Upvotes: 1
Reputation: 1764
Why don't you call the .NET CLI directly? I don't really know TeamCity or Octopus, but in Jenkins or AppVeyor I'm able to execute batch or PowerShell scripts. And I use this to run the .NET CLI commands directly. With this you are not dependent on any prebuilt, but out-dated add-ins.
Upvotes: 0