【发布时间】:2021-02-18 15:10:45
【问题描述】:
我的赛普拉斯测试在每次提交后运行,但我希望它们每 30 分钟运行一次。这是我的 YAML 文件 - https://pastebin.pl/view/0d56bd33。如何管理它们每 30 分钟运行一次(或根据给定的 CRON 时间)?
【问题讨论】:
标签: azure-devops continuous-integration yaml cypress schedule
我的赛普拉斯测试在每次提交后运行,但我希望它们每 30 分钟运行一次。这是我的 YAML 文件 - https://pastebin.pl/view/0d56bd33。如何管理它们每 30 分钟运行一次(或根据给定的 CRON 时间)?
【问题讨论】:
标签: azure-devops continuous-integration yaml cypress schedule
提交后运行脚本 A,但每 30 分钟运行一次脚本 B
您可以在脚本中添加条件。例如:
schedules:
- cron: "*/30 * * * *"
displayName: Every 30 minutes
branches:
include:
- main
always: true
trigger:
- '*'
pool:
vmImage: ubuntu-latest
steps:
- script: echo script A
displayName: 'script A'
condition: eq(variables['Build.Reason'], 'IndividualCI')
- script: echo script B
displayName: 'script B'
condition: eq(variables['Build.Reason'], 'Schedule')
在此示例中:
【讨论】:
npm run cy:test 脚本运行我的测试。但我也想每 30 分钟运行另一个脚本。