python - Azure devops 管道 ArchiveFiles 错误:无法找到可执行文件:'zip'
问题描述
我正在为 python 包构建创建 Azure DevOps 管道,但任务 ArchiveFiles@2 失败。
- stage: Build
jobs:
- job: BuildApp
pool:
vmImage: 'ubuntu-latest'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true
verbose: true
错误日志是这样的
Found 20 files
Archiving file: .env_sample
... 21 more ...
##[debug]Checking for archive destination folder:/__w/1/a
##[debug]Creating archive with zip: /__w/1/a/1009007.zip
##[debug]which 'zip'
##[debug]not found
##[debug]Unable to locate executable file: 'zip'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
解决方案
我同意@Daniel Mann 的观点,并且在执行 ArchiveFiles@2 任务时遇到了同样的问题。我将 ubuntu 18.04 版本的代理用于 DevOps 代理池。安装 ZIP 后,它工作。
推荐阅读
- javascript - AJAX URL 中的 AEM Servlet 资源类型
- javascript - 当书从一个书架移动到另一个书架时,它显示 this.props.onUpdateShelf 不是一个函数
- laravel - Laravel,该类存在,但我得到目标类 [PagesController] 不存在
- excel - Excel Web 查询与 MSXML2.XMLHTTP60
- php - 在现有的 Google Drive 文件夹中创建一个空白文件 - V3 - PHP
- ruby-on-rails - omniauth:(microsoft_graph_auth)身份验证失败!invalid_credentials: OAuth2::Error
- javascript - 如何删除 nextjs 中的 404 错误或响应 js?
- c# - 如何在我的 .NET 项目传输到内存并构建之前运行 PowerShell 脚本?
- autodesk-forge - 将 NWD 转换为 SVF 以缩小尺寸有什么建议吗?
- python-3.x - 使用函数更改 Tkinter 标签中的图像