【问题标题】:How to disable fetching git repository by gitlab runner?如何禁用 gitlab runner 获取 git 存储库?
【发布时间】:2018-02-02 06:41:18
【问题描述】:

我的 .gitlab-ci.yml 中有这样的任务

deploy_all:
  stage: deploy
  script:
    - cp project/target/jnlp/* html/jnlp/
  tags:
    - client:deploy-all

除了不必要的 git 存储库获取之外,一切正常。以下是跑步者日志的摘录

Running with gitlab-ci-multi-runner 9.1.0 (0118d89)
...
Fetching changes...
HEAD is now at 8dfc104 Update .gitlab-ci.yml
...
Job succeeded

这里不需要存储库,因为我只需要来自其他任务的工件。是否可以禁用此行为?

【问题讨论】:

    标签: gitlab gitlab-ci gitlab-ci-runner


    【解决方案1】:

    我找到了解决办法:

    • gitlab 升级到 10.x 版本,手册在这里https://docs.gitlab.com/runner/install/linux-repository.html
    • 在构建脚本中禁用 git checkout(通过添加变量)

      deploy_all:
        variables:
          GIT_STRATEGY: none
          GIT_CHECKOUT: "false"
        stage: deploy
        script:
          - cp project/target/jnlp/* html/jnlp/
        tags:
          - client:deploy-all
      

    【讨论】:

      猜你喜欢
      • 2015-10-06
      • 2019-12-02
      • 1970-01-01
      • 2017-03-04
      • 2010-10-11
      • 2019-09-30
      • 2016-08-02
      • 2016-03-04
      • 2022-07-04
      相关资源
      最近更新 更多