Drone 无人机生成错误:无法定位包git
我的drone.yml文件如下所示。。 不断获取错误Drone 无人机生成错误:无法定位包git,drone,drone.io,Drone,Drone.io,我的drone.yml文件如下所示。。 不断获取错误无法找到包git。 有什么建议吗 pipeline: build: image: python:3.5.1-slim commands: - apt update && apt install git-core - pip install -r requirements.txt
无法找到包git。
有什么建议吗
pipeline:
build:
image: python:3.5.1-slim
commands:
- apt update && apt install git-core
- pip install -r requirements.txt
- nosetests --with-coverage --cover-erase --cover-package
您是否提供了完整的yaml?由于示例yaml失败,出现
,是否要继续?[Y/n]中止
错误消息,原因是无人机正在非交互模式下运行,无法阻止并等待用户提示继续。它不会因问题中指定的错误消息而失败
因此,您需要像这样使用-y
运行命令:
pipeline:
build:
image: python:3.5.1-slim
commands:
- apt-get update
- apt-get install -y git-core
- which git
#!/bin/sh
set -e
apt-get update
apt-get install -y git-core
which get
这将在我的日志中产生以下输出:
+ which git
/usr/bin/git
请注意,当drone运行构建时,它会将命令转换为简单的shell脚本,启动容器,并作为入口点执行shell脚本。所以你的yaml会变成这样:
pipeline:
build:
image: python:3.5.1-slim
commands:
- apt-get update
- apt-get install -y git-core
- which git
#!/bin/sh
set -e
apt-get update
apt-get install -y git-core
which get
这意味着您应该能够直接从Docker中的命令行测试您的命令,以查明图像或命令问题:
$ docker run -t -i python:3.5.1-slim
# apt-get update && apt-get -y install git-core
# which git
很抱歉,这不能完全回答问题,但我无法使用问题中提供的示例yaml重复相同的错误消息。如果你能在你的问题中提供更多的澄清,我可以回到这个答案并编辑回应