詹金斯构建错误

时间:2013-11-26 12:18:40

标签: linux jenkins

我正在尝试设置构建命令,我收到了这些错误。 我尝试过设置安全配置。

访问控制:

  • Jenkins拥有用户数据库。
  • 允许用户注册。

授权:基于矩阵。

用户组:joshis1 - 全部检查。

运行构建后。我得到以下错误。 在构建脚本中,我只是想复制一个文件。

FailedConsole输出

Started by user shreyas joshi
Building in workspace /var/lib/jenkins/workspace/Tungsten-Build
[Tungsten-Build] $ /bin/sh /tmp/hudson1841543545003586844.sh
November26
November26
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
sudo: sorry, you must have a tty to run sudo
Build step 'Execute shell' marked build as failure
Finished: FAILURE

3 个答案:

答案 0 :(得分:14)

我得到了这个答案。

visudo

添加以下内容:

<jenkins_user_id that u are using> ALL=(ALL)       NOPASSWD: ALL

评论此行:

#Defaults    requiretty

答案 1 :(得分:1)

visudo解决方案有效,但不是评论

Defaults    requiretty

您可以添加以下行:

Defaults:<jenkins user> !requiretty

我应该添加评论,但我的名声很低......

答案 2 :(得分:0)

另一种方法是通过改变例如在/ etc / passwd中分配TTY。

myuser:x:498:499::/var/www/:/sbin/nologin

myuser:x:498:499::/var/www/:/bin/bash