如何取消正在等待手动触发器的管道?

发布于 2025-02-05 06:36:46 字数 2068 浏览 2 评论 0 原文

我在开始创建管道时使用了入门模板:

# This is an example Starter pipeline configuration
# Use a skeleton to build, test and deploy using manual and parallel steps
# -----
# You can specify a custom docker image from Docker Hub as your build environment.

image: atlassian/default-image:3

pipelines:
  default:
    - parallel:
      - step:
          name: 'Build and Test'
          script:
            - echo "Your build and test goes here..."
      - step:
          name: 'Lint'
          script:
            - echo "Your linting goes here..."
      - step:
          name: 'Security scan'
          script:
            - echo "Your security scan goes here..."

    # The following deployment steps will be executed for each pipeline run. To configure your steps and conditionally deploy see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/
    - step:
        name: 'Deployment to Staging'
        deployment: staging
        script:
          - echo "Your deployment to staging script goes here..."
    - step:
        name: 'Deployment to Production'
        deployment: production
        trigger: 'manual'
        script:
          - echo "Your deployment to production script goes here..."

运行此管道时,它会等待手动触发阶段:

我不想运行该阶段并只想取消管道,但是我找不到UI中的任何按钮。目前,它悬挂在我不想要的“ in_progress”状态下,因为我计划出于其他目的按状态过滤管道。我如何取消此?

一定时间后,可以将管道设置为自动取消吗?

编辑

我尝试重新延迟,然后立即停止它,但是运行仍在暂停时。因此,它不是在进行中的,但仍然只是在那里闲逛。另外,虽然UI未显示其正在进行的状态/pipelines/获取端点是这样的:

  "state": {
    "name": "IN_PROGRESS",
    "type": "pipeline_state_in_progress",
    "stage": {
      "name": "PAUSED",
      "type": "pipeline_state_in_progress_paused"
    }
  },

是否没有办法只需删除并清理这个运行?

I used the starter template when starting to create a pipeline:

# This is an example Starter pipeline configuration
# Use a skeleton to build, test and deploy using manual and parallel steps
# -----
# You can specify a custom docker image from Docker Hub as your build environment.

image: atlassian/default-image:3

pipelines:
  default:
    - parallel:
      - step:
          name: 'Build and Test'
          script:
            - echo "Your build and test goes here..."
      - step:
          name: 'Lint'
          script:
            - echo "Your linting goes here..."
      - step:
          name: 'Security scan'
          script:
            - echo "Your security scan goes here..."

    # The following deployment steps will be executed for each pipeline run. To configure your steps and conditionally deploy see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/
    - step:
        name: 'Deployment to Staging'
        deployment: staging
        script:
          - echo "Your deployment to staging script goes here..."
    - step:
        name: 'Deployment to Production'
        deployment: production
        trigger: 'manual'
        script:
          - echo "Your deployment to production script goes here..."

When running this pipeline it waits for the manual trigger stage:

enter image description here

I don't want to run that stage and want to just cancel the pipeline, but I cannot find any button in the UI to do that. It's currently hanging in the "IN_PROGRESS" state which I don't want because I plan on filtering pipelines by state for other purposes. How do I just cancel this?

Can pipelines be set to cancel automatically after a certain time?

Edit

I tried to rerun and then immediately stop it, but the run is still there as Paused. So it's not In progress, but it's still just hanging out there. Also, while the UI does not show it's in progress the state as returned by the /pipelines/ GET endpoint looks like this:

  "state": {
    "name": "IN_PROGRESS",
    "type": "pipeline_state_in_progress",
    "stage": {
      "name": "PAUSED",
      "type": "pipeline_state_in_progress_paused"
    }
  },

Is there no way to just remove and clean up this run?

enter image description here

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

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

发布评论

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

评论(1

杀手六號 2025-02-12 06:36:46

解决方法是启动它,然后立即将其停止。管道将显示为停止。

工人等待时间加上设置阶段通常足够慢,以使您的管道步骤脚本甚至无法启动。

但是,请记住,可以单独重新部署部署步骤,并且可以重新运行完整的管道。因此,您不能以在将来无法将其部署到生产的方式上有效地取消该管道。

A workaround is to start it and then immediately stop it. The pipeline would show as stopped.

The worker waiting time plus the setup phase are usually slow enough so that your pipeline step script would not even start.

Yet, keep in mind that the deploy steps can be individually redeployed and the full pipeline can be re-run. So you can't effectively irreversibly cancel that pipeline in a way that it can't be deployed to production in any future.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文