Jenkins 构建显示 "Operation not permitted"

Jenkins build showing "Operation not permitted"

我已经安装了 JENKINS 并创建了一个 bob,但是由于下面的问题 error.I 我已经尝试了很多事情,比如授予权限,但都无法做到 运行。

任何人都可以让我知道可能是什么原因以及如何做到这一点运行.?

13:45:49 Started by timer
13:45:49 Running as SYSTEM
13:45:49 Building in workspace /Users/it/.jenkins/workspace/CE
13:45:49 [google_crawler] $ /bin/sh -xe /var/folders/t2/sk1vw_mn7mz7ncjw75lzh7r40000gn/T/jenkins1637440588980893865.sh
13:45:49 + export PYTHONPATH=/Users/it/Documents/
13:45:49 + PYTHONPATH=/Users/it/Documents/
13:45:49 + cd /Users/it/Documents/CE
13:45:49 + python3 continious_execution.py
13:45:50 /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'continious_execution.py': [Errno 1] Operation not permitted
13:45:50 Build step 'Execute shell' marked build as failure
13:45:50 Finished: FAILURE

下面是构建代码:

export PYTHONPATH=${PYTHONPATH:-"/Users/it/Documents/"}
cd /Users/it/Documents/CE
python3 continious_execution.py

注意:如果我在 TERMINAL 中 运行ning 它 运行ning 没问题(使用 MAC 系统)。 Jenkins 的用户是 "jenkins_admin",我在安装时将其放入 JENKINS,登录的 Windows 用户是 "IT"。我不确定这些权限和设置,谁能指导我完成它?

它可能会失败,因为您的 'jenkins_admin' 用户没有权限从 'it' 用户的主目录读取 您可以执行以下操作之一

  1. 将 python 脚本移动到其他目录(我认为这是最好的方法)
  2. 在执行 shell 脚本时将用户更改为 'it'(请参阅 su
  3. 授予 'jenkins_admin' 用户读取和执行此文件的权限(参见 chmod
  chmod -R o+r /Users/it

  chmod 777 /Users/it/Documents/CE/continious_execution.py