我有一个本地的gitlab节点和一个本地的drone.io节点。drone.io节点运行在ubuntu上。gitlab节点使用自签名证书。我已经以规范的ubuntu方式将证书添加到drone.io节点(cp cert.pem /usr/share/ca-证书/;update证书)。无人机以-v /etc/ssl:/etc/ssl:ro启动。我知道无人机容器知道这个证书,因为它解决了由于oauth中的证书问题而无法登录的问题。但是,在使用"SSL证书问题:自签名证书“进行git提取时,生成了一个错误。
我怀疑无人驾驶飞机会启动一些其他容器来进行建造,而另一个容器则没有证书。但是我已经不知道发生了什么,也不知道如何在那里注射我的证书。
开始播放的剧本:
#!/bin/bash
set -x
docker kill drone
docker rm drone
docker run \
--volume /var/lib/drone:/var/lib/drone \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /etc/ssl:/etc/ssl:ro \
--env-file /etc/drone/dronerc \
--restart=always \
--publish=80:8000 \
--detach=true \
--name=drone \
drone/drone:0.4 \
-debug/etc/无人驾驶飞机/dronerc:
# in gitlab, as an administrator, go to /admin/applications
# add a new application, the redirect uri being https://drone.machine/authorize
REMOTE_DRIVER=gitlab
REMOTE_CONFIG=https://ci-poc.devel.balabit?client_id=b88f2a6faefd8d9a05eddd82c8327bda6a59858fc7772753f4e2c0e6a7cd96e4&client_secret=966f752d39f211ef6b79a8c079d2ff1226f6ccd772a239efab4f4e4fb5de67a9
DATABASE_DRIVER=sqlite3
DATABASE_CONFIG=/var/lib/drone/drone.sqlite
HTTP_PROXY=http://proxy.balabit:3128/
HTTPS_PROXY=http://proxy.balabit:3128/构建日志:
[info] Pulling image plugins/drone-git:latest
Drone Git Plugin built from 8be7aa9
$ git init
Initialized empty Git repository in /drone/src/gitlab.private/mag/devsec/.git/
$ git remote add origin https://gitlab.private/mag/devsec.git
$ git fetch --no-tags --depth=50 origin +refs/heads/master:
fatal: unable to access 'https://gitlab.private/mag/devsec.git/': SSL certificate problem: self signed certificate
[info] build failed (exit code 1)发布于 2016-03-28 20:44:14
解决方法是在skip_verify中为.drone.yml中的克隆设置http://addons.drone.io/git/解决方案。
我的.drone.yml如下,前两行是相关的。
clone:
skip_verify: true
build:
image: magwas/edemotest:xslt
commands:
- ./bin/script发布于 2020-12-08 10:48:27
您可以设置以下环境变量,使主机的CA证书可供无人机运行者使用:
-e DRONE_RUNNER_VOLUMES=/etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crthttps://stackoverflow.com/questions/36199249
复制相似问题