【发布时间】:2018-02-23 15:04:57
【问题描述】:
我在本地使用gitlab-runner,在包含.gitlab-ci.yml 的存储库的根目录中使用sudo gitlab-runner exec docker [job name]。是否可以从.gitlab-ci.yml以外的其他文件中读取运行器配置?
我知道我可以在同一个.gitlab-ci.yml 中管理不同作业中的不同配置。
我知道 gitlab-runner exec 已被弃用,并计划仅替换它,但尚未实现(有关详细信息,请参阅 https://gitlab.com/gitlab-org/gitlab-runner/issues/2797),因此我也感谢有关继任者的建议。
我在名为main 的作业中使用名为a 的YAML 创建了https://gitlab.com/krichter/gitlab-runner-local-different-name,其中包含“Hello world”-echo,我想将其作为示例运行,而无需重命名a到.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
【问题讨论】:
标签: docker gitlab gitlab-ci gitlab-ci-runner