【发布时间】:2020-03-05 10:02:38
【问题描述】:
我在 JENKINS 中安排作业时遇到问题。以下命令在有和没有 SUDO 的 TERMINAL(Mac) 中都可以正常工作(必须输入密码)。
如果没有 Sudo,我会收到“不允许操作”错误。
在我在 JENKINS 中得到的构建语句和错误下方,谁能帮我解决它?
export PYTHONPATH=${PYTHONPATH:-"/Users/it/Documents/google_crawler"}
cd /Users/it/Documents/google_crawler
sudo python3 PLA_Google_continious_execution.py
也代替这个“sudo python3 PLA_Google_continious_execution.py”尝试了“sudo python3 PLA_Google_continious_execution.py -S“密码”“但结果相同。
错误:
09:45:47 Started by timer
09:45:47 Running as SYSTEM
09:45:47 Building in workspace /Users/it/.jenkins/workspace/google_crawler
09:45:47 [google_crawler] $ /bin/sh -xe /var/folders/t2/sk1vw_mn7mz7ncjw75lzh7r40000gn/T/jenkins4461665640429805517.sh
09:45:48 + export PYTHONPATH=/Users/it/Documents/google_crawler
09:45:48 + PYTHONPATH=/Users/it/Documents/google_crawler
09:45:48 + cd /Users/it/Documents/google_crawler
09:45:48 + sudo python3 PLA_Google_continious_execution.py
09:45:48 sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
09:45:48 Build step 'Execute shell' marked build as failure
09:45:48 Finished: FAILURE
谁能指导一下。
【问题讨论】:
标签: python python-3.x jenkins jenkins-pipeline