gpt4 book ai didi

azure - 是否可以将 Azure DevOps YAML 管道集成到发布管道中?

转载 作者:行者123 更新时间:2023-12-03 02:33:52 24 4
gpt4 key购买 nike

我已经定义了一个管道来运行我的 Cypress 测试,这对于通过 CRON 任务运行自动化测试,或者当我们想通过手动执行来运行它时效果很好:

schedules:
- cron: "0 6 * * *"
displayName: Daily 6AM test run
branches:
include:
- master
always: true

strategy:
parallel: 2

pool:
vmImage: "ubuntu-latest"

steps:
- task: NodeTool@0
inputs:
versionSpec: "12.x"
displayName: "Install Node.js"

- task: CacheBeta@1
inputs:
key: npm | $(Agent.OS) | package-lock.json
path: /home/vsts/.npm
restoreKeys: npm | $(Agent.OS) | package-lock.json
displayName: Cache NPM packages
- task: CacheBeta@1
inputs:
key: cypress | $(Agent.OS) | package-lock.json
path: /home/vsts/.cache/Cypress
restoreKeys: cypress | $(Agent.OS) | package-lock.json
displayName: Cache Cypress binary

- script: npm ci
displayName: "Install NPM dependencies"

- script: npm run cy:verify
displayName: "Cypress verify"

- script: npm run cy:run:staging
displayName: "run Cypress"

- task: PublishPipelineArtifact@0
inputs:
artifactName: "screenshots"
targetPath: "cypress/screenshots"
condition: failed()
displayName: "Publish Screenshots (Cypress)"

- task: PublishPipelineArtifact@0
inputs:
artifactName: "videos"
targetPath: "cypress/videos"
condition: succeededOrFailed()
displayName: "Publish Videos (Cypress)"

- task: PublishTestResults@2
inputs:
testResultsFormat: "JUnit"
testResultsFiles: "**/test-output-*.xml"
testRunTitle: "Cypress Test Results"
publishRunAttachments: true
condition: succeededOrFailed()
continueOnError: true

但是,我们有一个用例,我们希望在生成新版本时针对新版本管道运行 Cypress 测试。

enter image description here

但是,我看不到如何使用我在管道中定义的 YAML 文件作为发布管道的“任务”。

我想做的事情可能吗?

最佳答案

您可以安装 Trigger Build Task扩展并对发布中的 YAML 管道进行排队:

enter image description here

关于azure - 是否可以将 Azure DevOps YAML 管道集成到发布管道中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63989760/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com