【问题标题】:Is it possible to add CI info in push?是否可以在推送中添加 CI 信息?
【发布时间】:2018-10-17 06:24:00
【问题描述】:

我们在 Stage Server 上使用 Gitlab CE 和 Gitlab Runner 进行 CI/CD。我们有一个分支,比如说 dev1,我们需要针对不同的更改执行不同的任务。

例如对于前端的东西,我们需要一个编译器来启动,对于后端,我们需要运行 php-unit。

我可以在推送中决定我想启动什么样的管道吗?我看到了标签,但我想它们在 git(用于版本控制)和 gitlab(用于跑步者)中是不同的。

对于该用例是否有最佳实践,还是我必须使用 2 个不同的分支?

【问题讨论】:

    标签: continuous-integration gitlab runner


    【解决方案1】:

    您可以为 dev1 分支定义两个手动任务,并自行决定调用哪个任务。

    run-php-unit:
    stage: build
    script:
      - echo "Running php unit"
    when: manual
    only: dev1
    
    start-compiler:
    stage: build
    script:
      - echo "Starting compiler"
    when: manual
    only: dev1
    

    【讨论】:

      猜你喜欢
      • 2019-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-21
      • 2010-10-22
      • 1970-01-01
      相关资源
      最近更新 更多