如何编辑和重新运行只有失败的构建阶段?(How to edit and re

编程入门 行业动态 更新时间:2024-10-22 11:44:10
如何编辑和重新运行只有失败的构建阶段?(How to edit and re-run only the build stage that failed?)

我试图让EF Migrations在VSTS上工作,这涉及到很多反复试验和错误的目录路径和命令行参数。 我的构建阶段运行迁移是:

使用NuGet 4.3.0 NuGet恢复 构建解决方案 测试组件 发布符号路径 运行EF迁移(命令行任务)

大约需要6分钟才能到达第6阶段,仅仅因为它会失败。 有什么办法可以冻结第1-5阶段的结果,只需编辑并重新运行我正在编辑的阶段?

(我试过禁用阶段1-5,但是当然没有任何DLL用于迁移运行)

I'm trying to get EF Migrations working on VSTS which is involving a lot of trial and error changing directory paths and command line arguments. My build stages up to running the migrations are:

Use NuGet 4.3.0 NuGet Restore Build solution Test Assemblies Publish symbols path Run EF Migrations (a command line task)

It takes about 6 minutes to get to stage 6, only for it then to fail. Is there any way to freeze the results of stages 1-5 and just edit and rerun the stage I'm editing?

(I've tried disabling Stages 1-5, but there are then of course no DLLs present for the migrations to run)

最满意答案

如果您使用私人代理 ,则可以冻结步骤1-5的结果,并直接运行步骤6(运行EF迁移)。

在获取源代码步骤中,您只需将clean设置为false即可实现以下功能:

在这里输入图像描述

如果您使用托管代理 ,则生成结果无法冻结,只能用于当前生成。

但是您可以添加多个命令行任务以重新运行第6步。详细设置如下(假设失败时重新运行EF Migrations 3次):

在步骤6(运行EF迁移)之后,克隆命令行任务(运行EF迁移)两次:

运行EF Migrations clone1(命令行任务)

运行EF Migrations clone2(命令行任务)

然后设置步骤7和步骤8 将此任务选项设置为仅当之前的任务失败时

在这里输入图像描述

所以EF Migrations命令最多运行3次。

If you are using private agent, you can freeze the result of step1-5, and run step 6 (Run EF Migrations) directly.

In Get sources step, you just need to set clean as false to achieve that:

enter image description here

If you are using Hosted agent, the build result can not freezed, it can only be used for current build.

But you can add multiple Command Line tasks to re-run step 6. Detail settings as below (assume re-run EF Migrations 3 times if it’s failed):

After the step 6 (Run EF Migrations), clone the Command Line task (Run EF Migrations) for twice:

Run EF Migrations clone1 (Command Line task)

Run EF Migrations clone2 (Command Line task)

And then set step 7 and step 8 Run this task option as Only when a previous tasks has failed.

enter image description here

So EF Migrations command will run 3 times at most.

更多推荐

本文发布于:2023-08-07 10:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1463724.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:阶段   编辑   edit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!