【发布时间】:2015-12-07 19:58:19
【问题描述】:
我的 GitRepo 中有一个 Project.sln。而且我需要构建 4 个具有不同配置的 NuGet 包(local、qa、sandbox 和 production)。我正在使用 TeamCity 和 Octopus Deploy。
在 TeamCity 中,我的构建配置具有以下构建步骤:
1) NuGet Installer
2) Build Project.sln with *Local* Configuration
3) NuGet Pack with using .csproj file
4) NuGet Installer
5) Build Project.sln with *QA* Configuration
6) NuGet Pack with using .csproj file
7) NuGet Installer
8) Build Project.sln with *Sandbox* Configuration
9) NuGet Pack with using .csproj file
10) NuGet Installer
11) Build Project.sln with *Production* Configuration
12) NuGet Pack with using .csproj file
我有以下问题:
1) 当我使用 AssemblyInfo 修补程序 时,它只会生成一个 NuGet 包文件。在第 3 步,TeamCity 创建了一个名为 2.2.1.%build.counter% 的包。在第 6 步,它会创建一个同名的包并覆盖它。第 9 步和第 12 步也是如此。最后,我只有一个具有最后一个配置的 NuGet 包(在我的例子中是 Production)。
我想要 4 个包,例如:
2.2.1.%build.counter%_local
2.2.1.%build.counter%_qa
2.2.1.%build.counter%_sandbox
2.2.1.%build.counter%_production
2) 下一个问题是八达通。当 TeamCity 制作包时(它制作了 4 个包,但没有 AssemblyInfo 修补程序),它使它们具有相同的 id(项目)并且当我尝试部署“一些”时(让它成为 QA)包到 QA 环境,Octopus 要求我选择 NuGet 包的 id。它只看到一个 id - “Project”。我认为这是 TeamCity 创建的最后一个包。
【问题讨论】:
-
对于您的 Octopous 部署问题,您只需要确保您使用的包名称能够区分环境,因此您应该使用
2.2.1.%build.counter%-qa等而不是2.2.1.%build.counter%.。跨度>
标签: .net nuget teamcity octopus-deploy assemblyinfo