nuget - 如何使 Nuget 恢复工作更快?

标签 nuget azure-devops nuget-package nuget-package-restore azure-artifacts

我们正在使用 构建 CD 管道VSTS 托管构建服务器。恢复Nuget需要3分钟以上。这时间太长了。

我怎样才能让它运行得更快?有没有缓存 我们可以使用系统吗?

最佳答案

更新:缓存现在普遍可用( docs )
Caching is currently on the feature pipeline日期待定。同时,您可以使用上传管道工件/下载管道工件任务将结果存储在您的 Azure DevOps 帐户中以加快/下载。
Work-in-progress can be tracked here .
同时,Microsoft 1ES (one engineering system, internal organization) has released their internal solution that uses Universal Packages to store arbitrary packages in your Azure DevOps account .它非常快,因为它可以同步以前包之间的增量。 There is a sample on how to configure your Azure Pipeline to store the NuGet package cache in your Sources Directory in order for the task to cache them .

variables:
  NUGET_PACKAGES: $(Build.SourcesDirectory)/packages
  keyfile: '**/*.csproj, **/packages.config, salt.txt'
  vstsFeed: 'feed name'

steps:
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCache@1
  displayName: 'Restore artifact'
  inputs:
    keyfile: $(keyfile)
    targetfolder: $(NUGET_PACKAGES)
    vstsFeed: $(vstsFeed)

关于nuget - 如何使 Nuget 恢复工作更快?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45983325/

相关文章:

c# - 如何确保 c# 解决方案中的所有项目都使用相同版本的第三方库?

sql-server - 在 Azure DevOps 管道上生成 SQL Server 架构更改脚本

asp.net-core - Microsoft.AspNetCore.All元程序包的优缺点

tfs - "Nuget pack"似乎忽略了 BasePath 参数

visual-studio-2017 - 在 PackageReference 中使用通配符时,依赖项上的黄色三角形符号没有错误

templates - 模板需要比项目包含的脚本版本更新的脚本版本

Azure Builds NuGetToolInstaller 缓存版本已过时,如何更新?

svn - 有没有办法使用 SVN post commit hook 对 VSTS 构建进行排队?

azure - 具有当前用户 ID 的角色分配

Azure Pipelines .net core 3.1 库以及对其他库的引用如何创建一个 nuget 包