问题描述
这是我的 gitlab-ci.yml 文件:
image: python:3.6
before_script:
- python --version
- pip install -r requirements.txt
stages:
- test
test:
stage: test
script:
- chmod +x ./scripts/lint.sh
- ./scripts/lint.sh
- chmod +x ./scripts/tests.sh
- ./scripts/tests.sh
请注意,在我的本地机器上,作业运行没有任何问题,并且使用的是 python 3.6.13
在线运行作业测试,我得到这个错误:它没有任何意义!
解决方法
您显示的屏幕截图,作业是使用 shell-executor
运行的,因此在您安装了 gitlab-runner
的任何机器上使用 Python 版本。
看起来您想使用 docker-executor
来使用 image: python:3.6
,因此我将重新安装运行程序以使用 docker executor。
或者,您可以更新使用 shell 执行程序的机器,以使用 Python 3。
另一个问题可能是您没有标记跑步者,并且使用了错误的 gitlab-runner
。确保您已标记您的 shell / docker runners,即使用 shell-runner
或 docker-runner
,然后在 test
作业中,添加:
tags:
- docker-runner