如何在创建或合并MR时选择GitLab CI作业

问题描述 投票:0回答:1

我希望有可能在合并请求上运行不同的任务(选定的任务)。如何配置.gitlab-ci.yml / GitLab CI设置才有可能?

deploy_test:
  only:
    - master
  script:
    - echo "Deploying ..."

deploy_test_v2:
  only:
    - master
  script:
    - echo "Deploying ..."
  when: manual

deploy_test_v3:
  only:
    - master
  script:
    - echo "Deploying ..."
  when: manual

我想选择在合并时自动调用三者中的哪一个。现在deploy_test会在合并时自动调用; deploy_test_v2deploy_test_v3可以在之后手动调用。这不是我想要的。


换句话说:

我有3个工作test服务器:

  1. 获得staging数据库的完整部署。
  2. 没有获得staging DB的部署。
  3. 只有CSS编译。

我想让开发人员选择将要执行的作业。

gitlab gitlab-ci
1个回答
0
投票

你可以使用merge request pipelines

build:
  stage: build
  script: ./build
  only:
  - merge_requests
© www.soinside.com 2019 - 2024. All rights reserved.