- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Azure Git Repos 中使用托管 Azure DevOps 和我们的代码。我们曾经使用“经典”基于 UI 的管道编辑器,但现在正在为我们的构建/发布阶段转向 YAML 模板。
过去我配置了 CI/CD,这样当代码通过拉取请求提交到主分支时,它会触发构建,然后是开发部署。其他发布阶段将在代码移动到该阶段之前等待批准。新版本将取消尚未部署到各自环境的任何先前版本。
在 YAML 部署阶段,我发现当 master 分支触发构建时,它会部署到开发环境,但管道停留在等待状态,因为其他阶段尚未获得批准。因此,运行不会被标记为“完成”,最终其他阶段将超时并被标记为失败。此外,管道的先前运行不会被取消,因此多次运行会堆积在等待状态。
理想情况下,我希望看到的是新构建将取消管道的所有先前运行。我希望在部署到 Development 后将运行标记为“完成”,并且能够在事后手动部署到其他阶段。
有没有其他人想做同样的事情?我只是想这一切都是错误的,应该以不同的方式做吗?
最佳答案
目前 yaml 管道不支持手动部署到阶段。请检查此 open issue .
您可以尝试添加 dependsOn和 condition对于每个阶段。对于下面的示例 yaml 管道。舞台构建 只有在阶段 之后才会开始运行开始 成功完成,然后 Stage Build 将等待批准,直到 Stage Build 被批准并成功完成才会触发 Stage Release。
您可以定义 pr trigger并设置 autocancel=true
(默认为 true)如果新的更改被推送到同一个 pr,则取消之前的运行。
batch trigger
的属性(property)可以达到类似的效果。如果当前 pr 仍在构建中,它将不会开始新的运行。
trigger:
batch: boolean # batch changes if true (the default); start a new build for every push if false
branches:
include:
pr:
autoCancel: true
branches:
include:
- master
stages:
- stage: Start
jobs:
- job: A
pool:
vmImage: windows-latest
steps:
- powershell: |
echo "i am job a"
- stage: Build
dependsOn: Start
condition: succeeded()
jobs:
- deployment: Dev
displayName: deploy Web App
pool:
vmImage: 'Ubuntu-16.04'
# creates an environment if it doesn't exist
environment: 'Dev'
strategy:
# default deployment strategy, more coming...
runOnce:
deploy:
steps:
- script: echo "i am dev environment"
- stage: Release
dependsOn: Build
condition: succeeded()
jobs:
- deployment: Environ
displayName: deploy Web App
pool:
vmImage: 'Ubuntu-16.04'
# creates an environment if it doesn't exist
environment: 'Environment'
strategy:
# default deployment strategy, more coming...
runOnce:
deploy:
steps:
- script: echo "i am Environment environment"
- task: PowerShell@2
inputs:
targetType: inline
script: |
$header = @{ Authorization = "Bearer $(system.accesstoken)" }
$buildsUrl = "$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds?api-version=5.1"
echo $buildsUrl
$builds = Invoke-RestMethod -Uri $buildsUrl -Method Get -Header $header
$buildsToStop = $builds.value.Where({ ($_.status -eq 'inProgress') -and ($_.definition.name -eq "$(Build.DefinitionName)") -and ($_.id -ne $(Build.BuildId))})
ForEach($build in $buildsToStop)
{
echo $build.id
$build.status = "cancelling"
$body = $build | ConvertTo-Json -Depth 10
$urlToCancel = "$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds/$($build.id)?api-version=5.1"
echo $urlToCancel
Invoke-RestMethod -Uri $urlToCancel -Method Patch -ContentType application/json -Body $body -Header $header
}
In order your pipeline to have the permission to cancel the current running build. You need go to your pipeline, click on the 3dots and choose Manage security
Then set the Stop builds permission to Allow for user Project Collection Build Service(projectName),
关于azure-devops - Azure DevOps 多阶段管道等待批准,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59977600/
构建用于批准或拒绝用户的 RESTful 资源的正确方法是什么? 此资源旨在由管理员审查用户。管理员可以批准或拒绝用户请求。请求需要有 user_id和 updated_status那可能是 appr
关闭。这个问题是opinion-based .它目前不接受答案。 想改进这个问题?更新问题,以便 editing this post 可以用事实和引用来回答它. 2年前关闭。 Improve this
我计划创建状态通知。例如,每当信息是 "Pending", it turns to color orange. When "Approved" it turns to color green and
假设我设置了一个存储库。我希望有的用户可以推送,有的用户我想先过一遍推送的内容再批准。有条件推送之类的概念吗?待批准推送队列? 最佳答案 您本质上需要一个代码审查工具。 git 有一些,但最好的可能是
我目前正在将我的一个网站从旧系统升级到 HTML5,但我在使用 Google Maps JavaScript API v3 时遇到了一些问题。要从他们的 API 获取数据,您必须有一个 key - 当
我们想将 JIRA 与 GITLAB 集成以获得批准。当 CICD Pipeline 运行时,它会部署到 DEV/QA,当它部署到 PROD 时,我们要检查两件事 经理/代码所有者批准了一项合并请求
我在我的网站中使用 Authy 进行 2 因素身份验证。我的代码发送了一个推送通知,我在手机上的 Authy 应用程序中收到了它。但问题是有时当我尝试接受/拒绝请求时,我收到一条错误消息 There
我正在修改网站以允许用户输入内容。但是,一旦他们创建了该内容,就需要在发布之前获得批准。这很容易通过在该内容的记录中设置一个“中等”位来实现,并且只需要一个表。 现在我还希望允许用户像在 StackO
我正在使用 ubuntu 12.04,我有一个应用程序,当我运行时,退出: ./ardrone_navigation Setting locale to en_GB.UTF-8 Errore di s
我在 gitlab 有两个分支 master 和 release。 在发布分支,我希望它只有提交消息,如:v0.1.0,v0.1.1。 说在我完成 v0.1.0 开发后,我在 master 中有几个功
我们为一家想要在自己的帐户下发布该应用程序的公司开发了一个应用程序。它是在我们的帐户上开发的,并且已从我们自己的帐户附加了配置文件。做这个的最好方式是什么?我是否必须向他们发送 xCode 项目并告诉
我正在构建一个网站,用户可以在其中更改其公开显示的个人资料。但是,我需要所有更改在上线之前都得到管理员的批准。在更改获得批准之前,他们的旧个人资料将显示。在管理员中应该有一个等待批准的配置文件列表。最
我正在构建一个网站,用户可以在其中更改其公开显示的个人资料。但是,我需要所有更改在上线之前都得到管理员的批准。在更改获得批准之前,他们的旧个人资料将显示。在管理员中应该有一个等待批准的配置文件列表。最
在我们的团队中,一名开发人员将应用送交审核。 它通过了,但在某些时候开发者证书不再有效。 我们现在无法在外部或内部测试人员中下载应用。 如果我们发布那个版本会怎样? 我将感谢您的经验和意见。 最佳答案
更新: $(document).ready(function () { $('#C1All').click(functio
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 8 年前。 Improve
我在 Gitlab 中找不到在我看来常见情况的选项,即仅批准 merge 请求,但不触发构建。我需要将流程分为两个操作:审批者审查并批准 merge 请求,但 merge 请求的作者将进行 merge
这个问题在这里已经有了答案: How to access the correct `this` inside a callback (15 个答案) 关闭 3 年前。
我正在尝试使用新的 Azure AD Privileged Identity Management REST API 批准/拒绝角色激活请求。 我已经能够使用以下请求读取所有待处理的角色激活请求: G
我的网站是一个用 AngularJs 编写的单页应用程序。 我正在尝试为某些页面添加 AdSense。提交后,我的网站被拒绝,原因如下:“内容不足”。 我的问题是:考虑到我们使用 escaped_fr
我是一名优秀的程序员,十分优秀!