我有一个运行build.cake文件的yaml任务。
- task: cake-build.cake.cake-build-task.Cake@2
displayName: 'Build Sources'
inputs:
script: devops/build.cake
target: Default
verbosity: Normal
arguments: '--Configuration="$(build.configuration)" --Platform="$(build.platform)" --artifactsPath="$(Build.ArtifactStagingDirectory)"'执行此任务时,它始终安装最新版本的Cake.Tool。这是管道日志的一部分:
2021-10-25T20:52:28.6148998Z ==============================================================================
2021-10-25T20:52:28.6149081Z Task : Cake
2021-10-25T20:52:28.6149119Z Description : Build with Cake
2021-10-25T20:52:28.6149153Z Version : 2.1.0
2021-10-25T20:52:28.6149199Z Author : Patrik Svensson
2021-10-25T20:52:28.6149233Z Help : [More Information about Cake](https://cakebuild.net)
2021-10-25T20:52:28.6149267Z ==============================================================================
2021-10-25T20:52:29.0331876Z =====================================================
2021-10-25T20:52:29.0332236Z Root = D:\Agents\00\_work\265\s\devops
2021-10-25T20:52:29.0332411Z Tools = D:\Agents\00\_work\265\s\devops\tools
2021-10-25T20:52:29.0332915Z Cake Tool Path = D:\Agents\00\_work\265\s\devops\tools\dotnet-cake.exe
2021-10-25T20:52:29.0334592Z Package Feed =
2021-10-25T20:52:29.0335733Z Running with system diagnostics
2021-10-25T20:52:29.0336048Z =====================================================
2021-10-25T20:52:29.0339302Z Installing Cake Tool (Latest)...
2021-10-25T20:52:29.0577395Z [command]"C:\Program Files\dotnet\dotnet.exe" tool install --tool-path D:\Agents\00\_work\265\s\devops\tools/ Cake.Tool
2021-10-25T20:52:37.3622249Z You can invoke the tool using the following command: dotnet-cake
2021-10-25T20:52:37.3622761Z Tool 'cake.tool' (version '1.3.0') was successfully installed.
2021-10-25T20:52:37.3766624Z 在这种情况下,它安装了1.3.0版。如何修复此版本号?例如,我如何告诉它始终使用1.0.0版本。我还没有找到任何关于这方面的文档。
发布于 2021-10-26 10:50:18
您应该能够使用版本属性指定版本
- task: cake-build.cake.cake-build-task.Cake@2
displayName: 'Build Sources'
inputs:
version: 1.0.0
script: devops/build.cake
target: Default
verbosity: Normal
arguments: '--Configuration="$(build.configuration)" --Platform="$(build.platform)" --artifactsPath="$(Build.ArtifactStagingDirectory)"'https://stackoverflow.com/questions/69717318
复制相似问题