如何让gitlab-runner从指定的文件中读取.gitlab-ci.yml?

时间:2018-02-23 15:04:57

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

我在包含gitlab-runner的存储库的根目录中使用sudo gitlab-runner exec docker [job name]本地.gitlab-ci.yml。是否可以从.gitlab-ci.yml以外的其他文件中读取运行器配置?

我知道我可以在同一.gitlab-ci.yml的不同作业中管理不同的配置。

我知道gitlab-runner exec已被弃用,只计划替换它,但尚未实现(详见https://gitlab.com/gitlab-org/gitlab-runner/issues/2797),所以我感谢您的建议关于继任者。

我使用名为a的YAML创建https://gitlab.com/krichter/gitlab-runner-local-different-name,其中包含" Hello world" - echomain这个名为a的作业中。 d喜欢在不需要将.gitlab-ci.yml重命名为sudo gitlab-runner exec docker main --env CI_CONFIG_PATH=a的情况下作为示例运行。

由于

而使WARNING: Since GitLab Runner 10.0 this command is marked as DEPRECATED and will be removed in one of upcoming releases fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' FATAL: open .gitlab-ci.yml: no such file or directory 运行失败
https://github.com/barteksc/AndroidPdfViewerV1

1 个答案:

答案 0 :(得分:3)

确实不能,.gitlab-ci.yml是用gitlab-runner exec代码硬编码的。我已经创建了issue about this problem,如果它仍然与您相关,请对其进行投票。