这是我在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
。
请问如何解决此问题?我在做错什么吗?
提示:请注意,这是一个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)
答案 0 :(得分:1)
我在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**
> core-js@2.6.9 postinstall /builds/alejandroteixeiraconsultoria/my-awesome-response/node_modules/core-js
> node scripts/postinstall || echo "ignore"
+ http-errors@1.6.3
+ cookie-parser@1.4.4
+ express@4.16.4
+ morgan@1.9.1
+ debug@2.6.9
+ pug@2.0.0-beta11
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上创建了两个不同的分支。
如果我是你,我将尝试重新生成跑步者密钥并 禁用共享跑步者并再次启用它们,以检查是否 您的项目出了点问题。如果这不起作用,请 从头开始重新创建一个新项目。这似乎是某种 在某些版本中的错误。也许它发生了一段时间 再次回来。
我希望至少这对您有帮助