azure - 工具退出并显示消息“退出并返回代码:-1”
问题描述
我已经运行了该工具,并且它的执行方式非常完美。在迁移结束时,我收到以下消息“退出并返回代码:0”。
通常情况下,我不会打扰。但是,我正在使用 Azure DevOps 发布管道实现迁移。使用此消息,部署阶段总是失败。
有人对此错误有任何想法吗
The last few lines of execution
Migration Processor Complete TfsTeamSettingsProcessor
2021-04-23T07:12:23.4698310Z [07:12:23 INF] TfsTeamSettingsProcessor completed in 00:00:02.9601088
2021-04-23T07:12:23.4746613Z [07:12:23 INF] Application is shutting down...
2021-04-23T07:12:23.4787008Z [07:12:23 DBG] Hosting stopping
2021-04-23T07:12:23.4792590Z [07:12:23 DBG] Exiting with return code: 0
2021-04-23T07:12:23.4797995Z [07:12:23 INF] Terminating: Application forcebly closed.
2021-04-23T07:12:23.4802683Z [07:12:23 INF] Application Ending
解决方案
看起来 robocopy 退出代码 0-7 表示成功。我从命令行执行更改为 powershell 命令,并将其添加到脚本的底部:
if ($lastexitcode -lt 8) { $lastexitcode = 0 }
这对我有用。
推荐阅读
- javascript - 高图表中是否有“区域”的替代品?
- javascript - document.queryselector 返回空值
- python - 如何有效地循环遍历熊猫中的日期列
- amazon-web-services - 我应该如何在 IaC 中的 IAM 中创建用户?
- java - 即使在android中获得了文件夹中的权限和文件后,也没有获得文件夹目录中的文件
- ios - 如何仅在一个屏幕上处理 IOS Objective C 中的方向并在按下时重置
- python - 将列表中项目的连续重复项打包到列表列表中,并根据该连续重复项的索引位置,对另一个列表执行相同操作
- javascript - 如何防止 slimselectjs 多选中的重复和空白条目?
- java - xsd 到 Spring Boot 中具有自定义类型的 java 对象
- rust - 是否可以指定异步函数结果的生命周期?