为自托管的 gitlab 实例使用 public 个运行器

Using public runners for self-hosted gitlab instance

我的 gitlab-ci.yml 中有以下图像配置:

default:
  image: registry.gitlab.com/gitlab-org/terraform-images/stable:latest
  #image: curlimages/curl:latest
...

当我在 https://gitlab.com/ 上部署时,这工作正常,但是当您尝试将我的代码与上述 ci 配置一起部署时,我的 CICD 中出现以下错误:

This job is stuck because the project doesn't have any runners online assigned to it.
Go to project CI settings

我的问题是,在使用 https://gitlab.com/ 时,我没有通过设置专门ci为我的项目指定任何运行程序。但现在看来我应该这样做了。

当使用 gitlab.com 时 -- gitlab 实例共享 运行 配置的 ners 可用于 运行 所有未标记的 CI 作业。

在您自己的自托管 gitlab 上,您必须为您的实例配置自己的共享 运行ners 或将 运行ners 注册到您的 projects/groups.

您不能在自托管的 gitlab 实例上使用 gitlab.com 共享 运行ners。

来自scope of runners

Shared Runners

Shared runners are available to every project in a GitLab instance.

Use shared runners when you have multiple jobs with similar requirements. Rather than having multiple runners idling for many projects, you can have a few runners that handle multiple projects.

If you are using a self-managed instance of GitLab:

Your administrator can install and register shared runners by going to your project’s Settings > CI/CD, expanding the Runners section, and clicking Show runner installation instructions. These instructions are also available in the documentation. The administrator can also configure a maximum number of shared runner pipeline minutes for each group.

If you are using GitLab.com:

You can select from a list of shared runners that GitLab maintains. The shared runners consume the pipelines minutes included with your account.

我想你技术上如果你在gitlab.com 和 setup CICD for external repos 指向您的自托管实例 -- 但您的分钟将是与您的自托管许可证分开的权利,以及其他严重限制。