【问题标题】:Pybot not seen by "which" command in Jenkins shell executionJenkins shell 执行中的“which”命令看不到 Pybot
【发布时间】:2019-02-05 05:28:27
【问题描述】:

由匿名用户发起

Building on master in workspace /var/lib/jenkins/workspace/Run script
[Run script] $ /bin/bash -xe /tmp/jenkins2969604061590363450.sh
+ which java
/usr/bin/java
+ which pybot
Build step 'Execute shell' marked build as failure
Finished: FAILURE

问题是 Jenkins 无法识别 pybot 的路径,在命令行中相同的命令可以正常工作:

user@test-vm:/home$ which pybot
/opt/test-vm/python/bin/pybot

问题出在哪里?我应该将它添加到某处的 PATH 中吗?

谢谢。

【问题讨论】:

  • user 是否与构建期间使用的用户相同?也许.profile.bashrc 中有一行将PATH 修改为user
  • 不,jenkins 似乎以匿名用户身份运行它(不管它是什么)。
  • 比为该用户修改 PATH 变量或简单地将修改 PATH 的行放入脚本中。

标签: jenkins debian robotframework


【解决方案1】:

似乎我不得不更改 Jenkins 用户 - 这个问题的答案很有帮助:

Run shell command in jenkins as root user?

【讨论】:

    猜你喜欢
    • 2017-07-06
    • 2014-01-11
    • 2014-12-20
    • 2020-05-19
    • 2023-03-06
    • 1970-01-01
    • 2019-03-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多