这是我第一次尝试在gitlab.com
上设置基本的CI工作流程。有关的项目是一个基本的静态网站,我想直接在gitlab上运行一些npm install
和gulp build
。
我创建了一个.gitlab-ci.yml
文件,该文件会被识别并启动。但是最初的实现失败了,所以我回到了最基本的CI脚本,如下所示:
image: debian:jessie
stages:
- build
build:
stage: build
script: echo "Building the app"
即使在这种情况下,我也会遇到相同的错误:
ERROR: Job failed (system failure): Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"gitlab-runner-build\": executable file not found in $PATH": unknown (executor_docker.go:833:0s)
我尝试了以下图像:debian:jessie
,node:latest
和busybox
。
我该如何解决此问题?我做错了吗?
HINT:请注意,这是一个Gitlab.com托管实例。不是当地的。我正在使用的跑步者托管在Gitlab服务器上。
完整错误消息:
Running with gitlab-runner 12.3.0 (a8a019e0)
on docker-auto-scale fa6cab46
Using Docker executor with image node:latest ...
Pulling docker image node:latest ...
Using docker image sha256:e498dabfee1c6735c9da947e0d438edd13593b7d721c989ba8ede14ab603b900 for node:latest ...
ERROR: Job failed (system failure): Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"gitlab-runner-build\": executable file not found in $PATH": unknown (executor_docker.go:833:0s)
我在Gitlab.com
上的一个新项目中对您的模型进行了严格的测试,>
gitlab-ci.yml(debian)
image: debian:jessie stages: - build build: stage: build script: echo "Building the app"
我的项目是基于默认的默认Node.js项目,我只是更改了默认的
docker
gitlab-ci.yml以与您的项目匹配。
我的结果是那些结果:
Running with gitlab-runner 12.3.0 (a8a019e0) on docker-auto-scale ed2dce3a Using Docker executor with image debian:jessie ... Pulling docker image debian:jessie ... Using docker image sha256:c9d6adb06e4d1092f4dae842e41ba34566481ac002ad52102389122ea6969fd4 for debian:jessie ... Running on runner-ed2dce3a-project-14701224-concurrent-0 via runner-ed2dce3a-srm-1570489833-8fc7b7db... Fetching changes with git depth set to 50... Initialized empty Git repository in /builds/alejandroteixeiraconsultoria/my-awesome-response/.git/ Created fresh repository. From https://gitlab.com/alejandroteixeiraconsultoria/my-awesome-response * [new branch] master -> origin/master Checking out 39d7cf97 as master... Skipping Git submodules setup $ echo "Building the app" Building the app Job succeeded
您将看到,它非常完美。
我看到的区别是:
我的:
在docker-auto-scale上使用gitlab-runner 12.3.0(a8a019e0)运行ed2dce3a
您的用户:
在docker-auto-scale上使用gitlab-runner 12.3.0(a8a019e0)运行fa6cab46
如果进入共享跑步者部分,只需检查
ed2dce3a
和fa6cab46
是我们跑步者的参考。
如果现在仔细看一下标签,您会发现它们是不同的:min仅为docker
和gce
,但您的标签更多。
shared-runners-manager-6.gitlab.com shared-runners-manager-3.gitlab.com
作为第二次尝试,我尝试使用此gitlab-yml创建
node:latest
图像
gitlab-ci.yml(节点)
image: node:latest stages: - build build: stage: build script: - echo "Building the app" - echo "Calling npm " - npm update
结果再次成功:
Running with gitlab-runner 12.3.0 (a8a019e0) on docker-auto-scale fa6cab46 Using Docker executor with image node:latest ... Pulling docker image node:latest ... Using docker image sha256:e498dabfee1c6735c9da947e0d438edd13593b7d721c989ba8ede14ab603b900 for node:latest ... Running on runner-fa6cab46-project-14701224-concurrent-0 via runner-fa6cab46-srm-1570491263-da01e8a0... Fetching changes with git depth set to 50... Initialized empty Git repository in /builds/alejandroteixeiraconsultoria/my-awesome-response/.git/ Created fresh repository. From https://gitlab.com/alejandroteixeiraconsultoria/my-awesome-response * [new branch] NodeApp -> origin/NodeApp Checking out e1235047 as NodeApp... Skipping Git submodules setup $ echo "Building the app" Building the app $ echo "Calling npm " Calling npm **$ npm update** > [email protected] postinstall /builds/alejandroteixeiraconsultoria/my-awesome-response/node_modules/core-js > node scripts/postinstall || echo "ignore" + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] added 165 packages from 606 contributors and audited 305 packages in 7.972s found 1 low severity vulnerability run `npm audit fix` to fix them, or `npm audit` for details Job succeeded
如您所见,我的项目与默认项目完美配合。
[Here is my example project,在gitlab.com上创建了两个不同的分支。
[如果我是你,我将尝试重新生成跑步者钥匙并禁用共享跑步者并再次启用它们,以检查是否您的项目出了点问题。如果这不起作用,请从头开始重新创建一个新项目。这似乎是某种一些版本中的错误。也许它发生了一段时间再次回来。
我希望至少这对您有帮助