在Jenkins Execute Shell中找不到命令 [英] command not found from Jenkins Execute Shell

查看:1606
本文介绍了在Jenkins Execute Shell中找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好Jenkins和AWS Guru的

Hi Jenkins and AWS Guru's

我已经在网上寻找任何可能的解决方案,但没有解决我的问题.我只是在一个测试项目下在Jenkins执行外壳上发布了一个"eb --version",但是在执行过程中却出现了"eb:command not found".

I already look online for any possible solutions but not getting a solution for my problem. I just issued an "eb --version" on Jenkins execute shell under a test project but getting "eb: command not found" during the execution.

比较奇怪的是,如果我通过CLI在Jenkins框上发出相同的命令,那么我会得到很好的响应.对修复有什么建议吗?预先感谢

Wierd thing is if I issue the same command on the Jenkins box via CLI I'm getting a good response from it. Any suggestions for the fix please? thanks in advance

推荐答案

您的Jenkins设置所使用的路径与您登录时所使用的用户不同.

Your Jenkins setup has a different path than the user you logged in with.

有两种解决方案:

  1. 在PATH环境变量中将路径添加到可执行文件.使用where eb查找正确的路径.然后在詹金斯(Jenkins)中,单击 管理詹金斯->配置系统,全局属性.检查环境变量.将名称设置为PATH.将设置为$PATH:/path/to/eb.然后重新启动Jenkins.

  1. Add the path to the executable in the PATH environment variable. Use where eb to find the correct path. Then in Jenkins, click on Manage Jenkins -> Configure System, Global Properties. Check Environment Variables. Set Name to PATH. Set Value to $PATH:/path/to/eb. Then restart Jenkins.

使用完全限定的路径调用eb命令.

Call the eb command with its fully qualified path.

编辑:添加了更新Jenkins中路径的步骤.

Added steps to update path in Jenkins.

这篇关于在Jenkins Execute Shell中找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆