.NET集成TeamCity的方法

在TeamCity,我们一直特别关注.NET,其许多工具和测试框架。在这篇文章中,我们想谈谈对.NET支持的最新更新,并共享一个示例演示项目来说明它们。



现在,在TeamCity的.NET支持一个巨大的一套专门的“实施运动员”和“打造特色”。运行程序提供了构建与第三方软件的集成,功能充当了构建的功能附加组件。



在版本2020.1之前,TeamCity提供了以下.NET组件:





TeamCity .NET, . , , , :



  • .NET-


..



, .NET Core , Microsoft , .NET SDK. .NET 5 – .NET Core, .NET Framework, Xamarin Mono. 2020.1 TeamCity , , , .NET. . , .NET . :



  • .NET CLI
  • Windows MSBuild
  • «» Visual Studio IDE (devenv)
  • Windows , NUnit XUnit
  • Windows, .NET
  • Docker


, .NET, . .NET 5 Visual Studio Rider.



-



, .NET – .NET CLI. , .NET-. TeamCity . TeamCity -.



- .NET .NET :









TeamCity





Clock



.NET Standard 1.2







NuGet



NuGet



Clock.IoC



.NET Standard 1.2



IoC





NuGet



NuGet



Clock.Tests



.NET 5.0





Windows



Linux



 



Clock.Console



.NET 5.0





Windows x64



Linux x64



Docker Nanoserver



Docker Ubuntu



Docker multi-arch



Docker



Clock.Web



.NET 5.0



Web



Windows x64



Linux x64



Docker Nanoserver



Docker Ubuntu



Docker multi-arch



Docker



Clock.Desktop



.NET 4.8 WPF







Windows



Clock.Desktop.Uwp



UAP



UWP-



UWP



UWP



Clock.Xamarin



.NET Standard 1.2



Xamarin



C Android-



Android



Clock.Xamarin.Android



Xamarin Android



Android



C Android-



Android





CI/CD-, -. TeamCity , TeamCity Kotlin DSL. , . , . , , DSL, ( ).



2 :



  • Windows 10 x64 Pro 10.0.19041

    • Visual Studio 2019 Pro 16.8.1
    • Docker (Windows container) 19.03.13
    • .NET SDK 5.0
  • Ubuntu 16.04

    • Docker 18.06.3


GitHub Maven, IntelliJ IDEA 2020.2.2 : , .. , DSL- Kotlin.





DSL- .NET TeamCity. , TeamCity VCS root’, DSL-. , Versioned Settings, “Kotlin”:





, TeamCity DSL- .



.NET : «Building» «Deployment». -.





, .NET - – Build Deploy. :





– , Docker NuGet:





, , .NET- - /p:key=value. , - system.configuration=Release, /p:configuration=Release. system. , TeamCity , . , , TeamCity .NET:



TeamCity
configuration Release MSBuild-.
VersionPrefix 1.0.0 .
VersionSuffix beta%build.number% .
Build console and web InvariantGlobalization true , .
Build Windows desktop PublishDir ../bin/Clock.Desktop/win/ .
AppxPackageDir ../bin/Clock.Desktop.Uwp/win/ UWP .
Pack Copyright Copyright 2020 JetBrains NuGet-.
Title TeamCity .NET sample
RepositoryType git
RepositoryUrl https://github.com/JetBrains/teamcity-dotnet-samples.git
RepositoryBranch refs/heads/master


. TeamCity, – TeamCity . .



«Test on Windows Test on Linux»



Windows #1 Linux Docker- mcr.microsoft.com/dotnet/core/sdk:5.0, .NET. Linux Docker, UI :





Linux Docker- .NET SDK 5.0. Windows , Docker.



Clock.Tests .NET 5.0, .NET Core CLI test. JetBrains dotCover JetBrains.dotCover.DotNetCliTool, TeamCity. DSL, TestBase Linux Windows.



«Build console and web for win-x64» «Build console and web for linux-x64»



TeamCity Linux Windows Clock.Console Clock.Web , . BuildConsoleAndWebBase, – BuildBase. , Projects , , outputDir. .NET 5.0, , .NET Core CLI publish.



UI Linux, Clock.Console , Output directory:





Windows, Runtime, win-x64, Output directory bin/Clock.Console/win-x64.



Clock.Web Linux , , Output directory bin/Clock.Web/linux-x64. , TeamCity .



win-x64:



  • bin/Clock.Console/win-x64/Clock.Console
  • bin/Clock.Console/win-x64/Clock.Web


linux-x64:



  • bin/Clock.Console/linux-x64/Clock.Console
  • bin/Clock.Console/linux-x64/Clock.Web


«Build Windows desktop»



:





Windows MSBuild Visual Studio 2019 #1 «» Restore, Rebuild Publish :



  • Clock.Desktop/Clock.Desktop.csproj
  • Clock.Desktop.Uwp/Clock.Desktop.csproj


, PublishDir ( Clock.Desktop) AppxPackageDir ( Clock.Desktop.Uwp). .



«Build Android app»



Android, Windows MSBuild Visual Studio 2019, #1:





, MSBuild «» Publish «» SignAndroidPackage, Android-.



«Pack»



NuGet- .NET CLI pack, – Clock Clock.IoC:





NuGet- , .., TeamCity – . , NuGet-, .



«Build»



TeamCity . , TeamCity- - :





«Deploy»



, , :





NuGet- , NuGet-. Clock.Console Docker :



docker pull nikolayp/clock-console
docker run -it --rm nikolayp/clock-console


Clock.Web:



docker pull nikolayp/clock-web
docker run -it --rm -p 5000:5000 nikolayp/clock-web


- , http://localhost:5000/.



.





Microsoft .NET 5, . TeamCity , .NET .NET 5 .



, . .




All Articles