为 git 标签构建时间表
Build schedule for git tag
是否可以使用标签安排 yaml 管道。我想要实现的是一种指定要构建的提交的简单方法。对于这个系统,它需要在每次部署时重建。我不想为此使用分支,因为我想在需要部署新版本时避免合并。
最后,我会将标签名称放在一个变量中,以便于更新。标签似乎也适用于触发器,但我无法让它适用于时间表。
我试过类似的方法,但没有任何反应。如果我用 master 更改 refs/tags/release-20200907-4,它会起作用
schedules:
- cron: "*/5 * * * *"
always: true
branches:
include:
- refs/tags/release-20200907-4
看来这不可能。正在关注 documentation:
Scheduled triggers evaluation
Scheduled triggers are evaluated for a branch when the following events occur.
- A pipeline is created.
- A pipeline's YAML file is updated, either from a push, or by editing it in the pipeline editor.
- A pipeline's YAML file path is updated to reference a different YAML file. This change only updates the default branch, and therefore will only pick up schedules in the updated YAML file for the default branch. If any other branches subsequently merge the default branch, for example git pull origin master, the scheduled triggers from the newly referenced YAML file are evaluated for that branch.
- A new branch is created.
After one of these events occurs in a branch, any scheduled runs for that branch are added, if that branch matches the branch filters for the scheduled triggers contained in the YAML file in that branch.
而且由于文档清楚地只涉及分支而不涉及标签并且测试证明这对标签不起作用,因此无法实现您想要的。甚至触发器评估也是由新分支触发的,而不是新标签。
您可以考虑在 developer community 上添加此功能请求。
是否可以使用标签安排 yaml 管道。我想要实现的是一种指定要构建的提交的简单方法。对于这个系统,它需要在每次部署时重建。我不想为此使用分支,因为我想在需要部署新版本时避免合并。
最后,我会将标签名称放在一个变量中,以便于更新。标签似乎也适用于触发器,但我无法让它适用于时间表。
我试过类似的方法,但没有任何反应。如果我用 master 更改 refs/tags/release-20200907-4,它会起作用
schedules:
- cron: "*/5 * * * *"
always: true
branches:
include:
- refs/tags/release-20200907-4
看来这不可能。正在关注 documentation:
Scheduled triggers evaluation Scheduled triggers are evaluated for a branch when the following events occur.
- A pipeline is created.
- A pipeline's YAML file is updated, either from a push, or by editing it in the pipeline editor.
- A pipeline's YAML file path is updated to reference a different YAML file. This change only updates the default branch, and therefore will only pick up schedules in the updated YAML file for the default branch. If any other branches subsequently merge the default branch, for example git pull origin master, the scheduled triggers from the newly referenced YAML file are evaluated for that branch.
- A new branch is created.
After one of these events occurs in a branch, any scheduled runs for that branch are added, if that branch matches the branch filters for the scheduled triggers contained in the YAML file in that branch.
而且由于文档清楚地只涉及分支而不涉及标签并且测试证明这对标签不起作用,因此无法实现您想要的。甚至触发器评估也是由新分支触发的,而不是新标签。
您可以考虑在 developer community 上添加此功能请求。