Bitbucket管道 - 触发标签,基于分支的步骤

发布于 2025-02-01 17:08:42 字数 203 浏览 1 评论 0原文

目前,我有一个项目,该项目是由分支控制的,不同的分支提供了可以部署到的不同位置(一旦分支提交开始管道,手动触发步骤)。

我们最近添加了发行版号的标签,这意味着尽管该管道是由分支的提交启动的,但它没有标签,因此我已经手动运行了本质上同一构建后的标签。

我正在寻找的是更改为自动标签构建,我知道该怎么做,但根据分支机构触发后提供手动步骤。

有什么想法吗?

Currently I have a project where the pipeline is branch controlled, different branches offering different places that it can deploy to (manual trigger steps once the branch commit started the pipeline).

We have recently added tagging with release version number, which means although the pipeline was kicked off by the commit to a branch, it doesn't have the tag, so I have had manually run what is essentially the same build again post tagging.

What I'm looking for is to change to automated tag build, which I know how to do, but offer manual steps after the trigger based upon the branch.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

盗梦空间 2025-02-08 17:08:42

一种方法是指定按下标签时运行的管道中的步骤。您可以自动制作构建,但包括手动触发实际部署的要求。基于标签的管道可以简单地复制您为分支部署的步骤。以下将复制主分支的部署步骤,但基于将提交标记为发行版(例如任何分支)。标记时将自动构建管道,但需要手动触发部署:

pipelines:
  branches:          
    master:
    - step: *Build
    - step: 
        <<: *Deploy
        name: Deploy to Prod
        deployment: prod
        trigger: manual

  tags:
    '*.*.*': # Tagged Release Version - automatically build, ready for manual deployment to Prod
      - step: *Build
      - step: 
          <<: *Deploy
          name: Deploy to Prod
          deployment: prod
          trigger: manual

One way to do it is to specify steps in the pipeline that runs when you push a tag. You can make the build automatic, but include a requirement to manually trigger the actual deployment. Your tag-based pipeline can simply duplicate the steps that you have for your branch deployment. The following will duplicate the deployment steps of a master branch, but based on tagging a commit as a release (e.g. 1.0.0) on any branch. The pipeline will automatically build when you tag, but requires a manual triggering of the deployment:

pipelines:
  branches:          
    master:
    - step: *Build
    - step: 
        <<: *Deploy
        name: Deploy to Prod
        deployment: prod
        trigger: manual

  tags:
    '*.*.*': # Tagged Release Version - automatically build, ready for manual deployment to Prod
      - step: *Build
      - step: 
          <<: *Deploy
          name: Deploy to Prod
          deployment: prod
          trigger: manual
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文