gpt4 book ai didi

jenkins - 为从节点配置 Jenkins SSH 选项

转载 作者:行者123 更新时间:2023-12-02 14:02:12 24 4
gpt4 key购买 nike

我在 Ubuntu 14.04 (Trusty Tahr) 上运行 Jenkins,并通过 SSH 使用从属节点。我们能够与节点通信以运行大多数命令,但是当命令需要 tty 输入时,我们会得到经典的

the input device is not a TTY

错误。在我们的例子中,它是一个 docker exec -it 命令。

所以我正在搜索关于 Jenkins 的大量信息,试图弄清楚如何配置到从节点的连接以启用 -t 选项来强制 tty 实例,我是空空如也。我们如何实现这一目标?

最佳答案

据我所知,您不能将 -t 提供给 Jenkins 启动的 ssh(这是有道理的,因为 Jenkins 本质上是分离的)。来自 the documentation :

When the SSH slaves plugin connects to a slave, it does not run an interactive shell. Instead it does the equivalent of your running "ssh slavehost command..." a few times...

但是,您可以通过...在您的构建脚本中解决这个问题

  • 回到你自己:ssh -t localhost command
  • 使用本地 PTY生成器:script --return -c "command"/dev/null

关于jenkins - 为从节点配置 Jenkins SSH 选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40982447/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com