【问题标题】:Problems with Gitlab CI/CD on local machine本地机器上的 Gitlab CI/CD 问题
【发布时间】:2022-01-03 08:43:43
【问题描述】:

我正在使用gitlab-runner 在本地运行 CI/CD。

当我在.gitlab-ci.yml 中指定所有作业时,它可以正常工作

stages:
  - test

test1:
  stage: test
  script:
    - echo "ok"

然后运行gitlab-runner exec shell test1

一般来说,我想将不同的作业存储在不同的文件中。例如,我使用与名为 .gitlab 的文件夹中的 test 阶段相关的作业创建 test-pipeline.yml

.gitlab-ci.yml 仅包含行

include:
  local: .gitlab/test-pipeline.yml

我提交并推送更改到远程仓库,它在那里工作,但命令 gitlab-runner exec shell job_name 失败,因为它找不到这样的工作。

也许,我必须编辑一些 gitlab-runner 的配置,但不是很明显。

有人遇到过同样的问题吗?

提前致谢!

【问题讨论】:

    标签: gitlab cicd gitlab-runner


    【解决方案1】:

    gitlab-runner execmany limitations。它没有常规 gitlab-runner 的所有相同功能。其中一个限制是does not support the include: statement

    因此,您将无法对使用include: 的这种配置文件使用gitlab-runner exec

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-06
      • 1970-01-01
      • 2021-10-14
      • 2019-07-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多