虽然存在.Gitlab-CI.yml,但未激活Gitlab CI
我最近创建了一个新的gitlab项目,它承载一个dockerfile。我想使用Gitlab CI/CD构建dockerfile。虽然存在.Gitlab-CI.yml,但未激活Gitlab CI,gitlab,gitlab-ci,gitlab-ci-runner,Gitlab,Gitlab Ci,Gitlab Ci Runner,我最近创建了一个新的gitlab项目,它承载一个dockerfile。我想使用Gitlab CI/CD构建dockerfile。 虽然我已经在另一个项目中使用了CI/CD,但这一个不起作用。 尽管存在.yml文件,但gitlab在概览中显示“设置CI”链接,管道窗口只显示“使用管道入门”链接,作业窗口显示“无需显示作业” My.gitlab-ci.yml文件: image: docker:stable variables: # When using dind service we nee
虽然我已经在另一个项目中使用了CI/CD,但这一个不起作用。
尽管存在.yml文件,但gitlab在概览中显示“设置CI”链接,管道窗口只显示“使用管道入门”链接,作业窗口显示“无需显示作业” My.gitlab-ci.yml文件:
image: docker:stable
variables:
# When using dind service we need to instruct docker, to talk with the
# daemon started idnside of the service. The daemon is available with
# a network connection instead of the default /var/run/docker.sock socket.
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
#
# Note that if you're using Kubernetes executor, the variable should be set to
# tcp://localhost:2375 becausde of how Kubernetes executor connects services
# to the job container
DOCKER_HOST: tcp://docker:2375/
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
DOCKER_DRIVER: overlay2
services:
- docker:dind
before_script:
- docker info
build_job:
stage: build
script:
- docker build -t Laravel-Ci-Docker-Image .
tags:
- dockerbuilder
此项目的我的跑步者:
- 主动:是的
- 受保护:没有
- 可以运行未标记的作业:是
- 锁定此项目:是
- 标签:dockerbuilder
- 名称:gitlab runner
- 版本:11.0.0
- 修订:5396d320
- 平台:linux
- 架构:amd64
- 描述:Docker Builder
- 最后联系:24分钟前
我错过什么了吗?gitlab无法识别.gitlab-ci.yml文件的可能原因是什么 更新/更多详细信息
打开.yml文件会显示“此GitLab CI配置有效。”
这是一个自托管的Gitlab实例。我认为问题出在runner上 关于你的问题,你说的是24分钟前最后一次接触的跑步者。 检查运行程序是否已离开或comp已关闭,因为运行程序工作正常经常检查服务器以查找要运行的作业
如果流道组件正在工作,请检查流道服务状态。您可以使用“gitlab runner status”和“gitlab runner list”来完成。如果一切正常,您正在谈论的运行程序应该在列表中。如果是gitlab运行程序问题,则CI将处于“挂起”状态,但会为此创建一个管道。我在您的
.gitlab ci.yml
中看到的是缺少
stages:
- build
因为您在作业中定义了它,但没有在gitlab界面上创建此阶段的定义,所以他们会告诉您是否存在gitlab ci文件,并且输入它会告诉您语法是否正确。你确认了吗?这是云托管的Gitlab吗?有时候,我不得不等到第二天才能看到我的.gitlab-ci.yml被选中。@SakuraKinomoto我又添加了一些上下文。文件应该是有效的。谢谢你的回答!请解释一下,你说的“runner comp”是什么意思。你指的是计算机或物理服务器。如果电脑正常工作…哦,好的。服务器正在运行,gitlab runner状态为ok,并且该runner在列表中可见。好吧,一切都会好起来的。但情况依然如此。