Azure Devops依次运行两个生成 [英] Azure Devops Running Two Builds Sequentially

查看:141
本文介绍了Azure Devops依次运行两个生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有Azure Devops设置.现在,我们的项目将构建两次.

We have Azure Devops setup. Right now our Project will Build Twice.

一次是在YAML文件中进行拉取请求检入时,另一次是由于构建设置(下图).

Once during Pull Request Checkin in the YAML file, and another due to Build Settings (picture below).

这会触发两次构建,并使我们的构建时间加倍.我们的Devops团队提到这是常规做法.为什么Azure Devops不会只触发一个版本,或者两个版本更安全呢?

This triggers two builds, and causes our build time to double. Our Devops team mentioned this is regular practice. Why doesn't Azure Devops just trigger one build, and or is it safer practice with two builds?

推荐答案

Azure Devops为什么不只触发一个版本,还是两个版本更安全呢?

Why doesn't Azure Devops just trigger one build, and or is it safer practice with two builds?

据我所知,这是Azure Devops的预期工作流程.

As far as I know, this is the expected workflow of Azure Devops.

由于构建设置

这是此触发器在请求请求过程中发生,PR触发器应在创建PR时运行.

This trigger occurs in the process of Pull Request, the PR trigger is meant to run whenever a PR is created.

此触发器等效于验证步骤,文件未真正提交到目标分支(已预合并到Targer分支).

This trigger is equivalent to a verification step, the file is not really committed to the target branch(Pre-merged to Targer Branch).

您可以检查构建结果以确定源分支代码是否有效.

You can check the results of the build to determine whether the source branch code is valid.

例如:

如果拉取请求"触发器失败,则可以拒绝拉取请求.它不影响目标分支,目标分支保持原始状态

If the Pull Request trigger fails, you can reject the pull request. It does not affect the target branch, the target branch remains in the original state

在YAML文件中拉出请求签入

这可能是当拉取请求完成时,将触发此触发器.

This trigger will happen when the pull request is completed.

在这种情况下,目标分支已更改.目标分支的更改将触发CI触发器.这样可以再次检查代码是否有效.

In this case, the target branch has changed. The change of the target branch triggers the CI trigger. This can double check whether the code is valid.

工作流程摘要:

创建请求请求->拉取请求触发器(预合并和最前检查)->完成拉取请求-> CI触发器(完成分支合并和第二次检查).

Create Pull Request -> Pull Request Trigger(Pre-merged and firest check)->Complete Pull Request -> CI trigger (Complete the branch merge and second check).

顺便说一句,如果要排除某些文件以免它们触发拉取请求触发器",则可以添加路径过滤器.

By the way, if you want to exclude some files so that they do not trigger the Pull Request Trigger, you can add a path filter.

例如:

这篇关于Azure Devops依次运行两个生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆