Skip to main content

drone runner

caution
  • exec runner 目前用不了 - 无法注入 git cred
    • 新的插件基于 container
    • exec 不再维护了

exec runner

curl -L https://github.com/drone-runners/drone-runner-exec/releases/latest/download/drone_runner_exec_linux_amd64.tar.gz | tar zx
sudo install -t /usr/local/bin drone-runner-exec
DRONE_RPC_PROTO=https
DRONE_RPC_HOST=drone.company.com
DRONE_RPC_SECRET=super-duper-secret
DRONE_LOG_FILE=/var/log/drone-runner-exec/log.txt

配置 UI 后可访问 runner 的界面, :3000

  • DRONE_UI_USERNAME=root
  • DRONE_UI_PASSWORD=root
# daemon 前台运行
drone-runner-exec daemon /etc/drone-runner-exec/config

DRONE_DEBUG=true drone-runner-exec service run --config /etc/drone-runner-exec/config

# 服务模式 - 后台
drone-runner-exec service install # 不是 OpenRC /etc/init.d/drone-runner-exec
drone-runner-exec service start # service run
vare.g.
DRONE_RUNNER_ROOT/tmp

docker runner

docker run --detach \
--volume=/var/run/docker.sock:/var/run/docker.sock \
--env=DRONE_RPC_PROTO=https \
--env=DRONE_RPC_HOST=drone.company.com \
--env=DRONE_RPC_SECRET=super-duper-secret \
--env=DRONE_RUNNER_CAPACITY=2 \
--env=DRONE_RUNNER_NAME=first-runner \
--publish=3000:3000 \
--restart=always \
--name=runner \
drone/drone-runner-docker:1

docker run --rm -it \
--volume=/var/run/docker.sock:/var/run/docker.sock \
--env-file=config \
--publish=3000:3000 \
--name=drone-runner drone/drone-runner-docker:1
if [ ! -z "${DRONE_NETRC_FILE}" ]; then
echo $DRONE_NETRC_FILE > $HOME/.netrc
chmod 600 $HOME/.netrc
fi
unset DRONE_SCRIPT
unset DRONE_NETRC_MACHINE
unset DRONE_NETRC_USERNAME
unset DRONE_NETRC_PASSWORD
unset DRONE_NETRC_FILE
set -e

kubernates runner

docker run --rm -it \
--name=drone-runner-kube drone/drone-runner-kube