简体   繁体   English

无法触发Azure DevOps中的拉取请求发布

[英]Unable to trigger pull request release in Azure DevOps

I have set up a pull request release trigger in the following way. 我已经通过以下方式设置了拉取请求释放触发器。

I want to deploy Artifacts from VerifyApiTestEnvironment branch whenever pull request into that branch is successfully completed. 每当将请求成功完成到该分支中时,我都希望从VerifyApiTestEnvironment分支中部署工件。

在此处输入图片说明

This is how my artifacts look. 这就是我的文物的样子。

在此处输入图片说明

This is how my CD trigger looks like. 这就是我的CD触发器的样子。

在此处输入图片说明

This is how my pre-deployment conditions look like. 这就是我的部署前条件。

在此处输入图片说明

This is how my policy screen looks. 这是我的政策屏幕的外观。

在此处输入图片说明

This is how my branch structure looks. 这就是我的分支结构的样子。 I am always getting an error in the build saying source branch missing the changes from master when I complete the pull request targeting the VerifyApiTestEnvironment branch. 我总是在构建中遇到一个错误,说当我完成针对VerifyApiTestEnvironment分支的请求请求时,源分支缺少来自master的更改。 What could be the reason behind this? 这可能是什么原因?

Every time I am committing my changes to a featureBranch and then I open a pull request for it to merge into VerifyApiTestEnvironment branch. 每次将更改提交到featureBranch ,我都会打开一个请求请求,以使其合并到VerifyApiTestEnvironment分支中。 I expect to trigger a release and then a deployment every time I do this, but the release is not getting triggered. 我希望每次执行此操作时都会触发一个版本,然后触发一个部署,但是不会触发该版本。

Am I missing something related to configuring PR triggers? 我是否缺少与配置PR触发器相关的内容?

The setting of yours has some problem. 您的设置有一些问题。 As Daniel said, it is used to set as deploy with a PR created. 正如Daniel所说,它被用来设置为已创建PR的部署。 In addition, if you want to deploy just after PR is completed, the source of this release should be Repository instead of build pipeline. 此外,如果要在PR完成后立即进行部署,则此版本的源应为存储库而不是构建管道。

So, first, you need to change your release source as Azure Repository : 因此,首先,您需要将发布源更改为Azure存储库

在此处输入图片说明

And then, enable Continuous deployment trigger . 然后,启用连续部署触发器 While the PR completed, it means that code change are merged into the target branch of Repository. PR完成后,这意味着代码更改将合并到存储库的目标分支中。 So, this need to be enabled, or the deploy will not be triggered while the PR is completed. 因此,需要启用此功能,否则在PR完成后将不会触发部署。

在此处输入图片说明

In addition, you need to set branch filter, or the deploy will be triggered no matter which branch is changed. 另外,您需要设置分支过滤器,否则无论更改哪个分支,都会触发部署。 Here I set just merge into master branch( PR target branch is master) can trigger this CD. 在这里我设置只是合并到master分支中(PR目标分支是master)就可以触发这张CD。

在此处输入图片说明

For this option, it just be use for the PR created trigger deploy. 对于此选项,它仅用于PR创建的触发器部署。 Since you just want deploy triggered by the PR completed, so you do not need enable it. 由于您只想完成由PR触发的部署,因此您无需启用它。

Now, if your master has policy that the code change applied successfully only after PR created and verified, the CD will be executed only after PR completed. 现在,如果您的主服务器具有仅在创建和验证PR后才成功应用代码更改的策略,则CD将仅在PR完成后才执行。

For some configuration of policy, build policy is used to set build trigger, and status policy used to trigger the release. 对于某些策略配置, 构建策略用于设置构建触发器, 状态策略用于触发发布。

So, according to your policy setting, it's used to trigger the build first, and then the build will trigger the release. 因此,根据您的策略设置,它首先用于触发构建,然后该构建将触发发行版。 It's not directly trigger the deploy just after the PR completed. PR完成后并不会直接触发部署。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM