无法将 dotnet 3.0.100 应用程序从 Azure DevOps 推送到 Octopus
Cannot push dotnet 3.0.100 app to Octopus from Azure DevOps
我正在使用 DevOps 管道将我的 dotnet 构建推送到 Octopus 云实例。
在我将 dotnet SDK 3 安装程序添加到 devops 管道之前它工作正常
- task: UseDotNet@2
displayName: 'Install .net core 3.0.100'
inputs:
packageType: sdk
version: '3.0.100'
installationPath: $(Agent.ToolsDirectory)/dotnet
我的 azure-pipelines.yml 的章鱼部分是这样的:
- task: OctoInstaller@4
inputs:
version: 'latest'
- task: OctopusPush@4
inputs:
OctoConnectedServiceName: 'XXX.octopus.app'
Space: 'Spaces-1'
Package: '$(Build.ArtifactStagingDirectory)/$(Build.DefinitionName).$(Build.BuildNumber).zip'
Replace: 'false'
我已经尝试了所有我能想到的 OctoInstaller 组合,包括嵌入式和显式版本号。我不断收到 @4 的错误消息。
Failed to push package. The Octo command line tool is too old to run this task. Please use version 6.10.0 or newer, or downgrade the task to version 3.*.
使用 OctoInstall@3 我得到另一个错误:
Failed to push package. The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 150
Has anyone been able to use dotnet 3 with Octopus deploy? One option
might be to install the octo extension for dotnet but I’m not sure how
you would do that from the azure pipeline. Or to use a Windows build
instead of Ubuntu.
我还注意到构建步骤中的一个错误。
The specified framework 'Microsoft.NETCore.App', version '2.0.0' was not found.
- The following frameworks were found:
3.0.0 at [/opt/hostedtoolcache/dotnet/shared/Microsoft.NETCore.App]
这意味着章鱼一定是在尝试使用 dotnet 2 框架。
使用dotnet octo
https://octopus.com/blog/octopus-and-netcore
博客文章详细解释了如何进行这项工作。
对于 Azure Pipelines,请遵循这篇文章:https://octopus.com/docs/packaging-applications/build-servers/tfs-azure-devops/using-octopus-extension
谨记
The Azure DevOps extension tasks require Octo to be available on the
path when executing on a build agent and must have the .net core 2.0.0
runtime or newer installed. This may not always be possible such as
with the Azure DevOps hosted agents. In order to make this work, all
Octopus tasks will automatically attempt to download and use the
latest version of Octo tools unless they're available on the build
agent as specified above. If you would like to avoid any additional
downloads or to use a specific Octo version then you can by adding the
Octo Installer task to the start of your build definition. No attempt
will be made to download Octo if the capability is detected on your
build agent.
仔细查看日志后,我发现OctopusPush失败了,因为它依赖于dotnet 2.0.0。我添加了一个 yml
任务来安装该框架,现在它推送到章鱼。
使用 dotnet octo
工具可能更简洁,如 TrevorBrooks 所述,但我不知道如何在 DevOps 管道中安装 dotnet 扩展。
我正在使用 DevOps 管道将我的 dotnet 构建推送到 Octopus 云实例。
在我将 dotnet SDK 3 安装程序添加到 devops 管道之前它工作正常
- task: UseDotNet@2
displayName: 'Install .net core 3.0.100'
inputs:
packageType: sdk
version: '3.0.100'
installationPath: $(Agent.ToolsDirectory)/dotnet
我的 azure-pipelines.yml 的章鱼部分是这样的:
- task: OctoInstaller@4
inputs:
version: 'latest'
- task: OctopusPush@4
inputs:
OctoConnectedServiceName: 'XXX.octopus.app'
Space: 'Spaces-1'
Package: '$(Build.ArtifactStagingDirectory)/$(Build.DefinitionName).$(Build.BuildNumber).zip'
Replace: 'false'
我已经尝试了所有我能想到的 OctoInstaller 组合,包括嵌入式和显式版本号。我不断收到 @4 的错误消息。
Failed to push package. The Octo command line tool is too old to run this task. Please use version 6.10.0 or newer, or downgrade the task to version 3.*.
使用 OctoInstall@3 我得到另一个错误:
Failed to push package. The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 150
Has anyone been able to use dotnet 3 with Octopus deploy? One option might be to install the octo extension for dotnet but I’m not sure how you would do that from the azure pipeline. Or to use a Windows build instead of Ubuntu.
我还注意到构建步骤中的一个错误。
The specified framework 'Microsoft.NETCore.App', version '2.0.0' was not found.
- The following frameworks were found:
3.0.0 at [/opt/hostedtoolcache/dotnet/shared/Microsoft.NETCore.App]
这意味着章鱼一定是在尝试使用 dotnet 2 框架。
使用dotnet octo
https://octopus.com/blog/octopus-and-netcore
博客文章详细解释了如何进行这项工作。
对于 Azure Pipelines,请遵循这篇文章:https://octopus.com/docs/packaging-applications/build-servers/tfs-azure-devops/using-octopus-extension
谨记
The Azure DevOps extension tasks require Octo to be available on the path when executing on a build agent and must have the .net core 2.0.0 runtime or newer installed. This may not always be possible such as with the Azure DevOps hosted agents. In order to make this work, all Octopus tasks will automatically attempt to download and use the latest version of Octo tools unless they're available on the build agent as specified above. If you would like to avoid any additional downloads or to use a specific Octo version then you can by adding the Octo Installer task to the start of your build definition. No attempt will be made to download Octo if the capability is detected on your build agent.
仔细查看日志后,我发现OctopusPush失败了,因为它依赖于dotnet 2.0.0。我添加了一个 yml
任务来安装该框架,现在它推送到章鱼。
使用 dotnet octo
工具可能更简洁,如 TrevorBrooks 所述,但我不知道如何在 DevOps 管道中安装 dotnet 扩展。