如何解决Azure Pipeline Archive 失败,没有此类文件或目录
我正在使用 Azure CI/CD 管道。该项目是一个成功构建的 ASP.NET 应用程序(网站项目)。 Azure Pipeline Archive 无法找到目录 D:/a/_temp/WebAppContent。
我不知道管道中“存档文件”之前的“构建解决方案”是否导致了问题。
在哪里可以检查以确保在“存档文件”之前创建了 rootFolderOrFile?
YAML
steps:
- task: VSBuild@1
displayName: 'Build solution **\*.sln'
inputs:
solution: '$(Parameters.solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:publishUrl="$(Agent.TempDirectory)\WebAppContent\\"'
platform: '$(Buildplatform)'
configuration: '$(BuildConfiguration)'
steps:
- task: ArchiveFiles@2
displayName: 'Archive Files'
inputs:
rootFolderOrFile: '$(Agent.TempDirectory)\WebAppContent'
includeRootFolder: false
ls: no such file or directory: D:/a/_temp/WebAppContent
Found 0 files
##[error]Error: ENOENT: no such file or directory,stat 'D:\a\_temp\WebAppContent'
##[error]ENOENT: no such file or directory,stat 'D:\a\_temp\WebAppContent'
Finishing: Archive Files
这是我的流水线截图
解决方法
我终于解决了这个问题。请参阅下面我正在使用的管道。
-
创建一个新的 VS 解决方案和一个新的类库项目
-
Git Commit to Azure > 并构建(成功)
-
在新解决方案中 > 添加现有项目 > 网站(这是带有 aspx 和 aspx.cs 页面的旧版 asp.net 应用程序)
-
在本地构建并在本地运行(成功)
-
再次向 Azure 提交 Git > 缺少一些 DLL
-
使用包含文件将缺少的 DLL 添加到项目
-
Git Commit 再次到 Azure > 现在 DLL 被推送到 Git
-
在 Azure 中成功构建。
主要问题是我需要创建一个全新的解决方案 + 项目,然后添加现有网站
,Agent.TempDirectory 是代理中的临时文件夹,请检查此 doc。
我们可以打包输出文件并通过
保存在指定位置 /p:WebPublishMethod=Package /p:PackageLocation="$(Agent.TempDirectory)\WebAppContent\\"
结果:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。