Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

command not found from Jenkins Execute Shell

Hi Jenkins and AWS Guru's

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.

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

like image 432
Seth Sam Avatar asked Sep 13 '17 13:09

Seth Sam


People also ask

How do I run a shell script from a Jenkins controller?

Your Jenkins controller is running on Windows. Windows uses batch and powershell for its command line scripting. If you want to run a shell script, add an agent on an operating system that supports bash.

How to run Jenkins in terminal with user user?

Make sure sudo works for the user that runs the Jenkins process. Show activity on this post. Jenkins runs with 'jenkins` user. Just cause it works in terminal with your logged in user, doesn't mean that it's configured to work with 'jenkins' user.

Can I run Jenkins on a Windows computer?

Your Jenkins controller is running on Windows. Windows uses batch and powershell for its command line scripting. If you want to run a shell script, add an agent on an operating system that supports bash. That could be a Linux Docker based agent running in Docker on your Windows computer.

How do I change the path of a Jenkins executable?

Your Jenkins setup has a different path than the user you logged in with. 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.


1 Answers

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

There are two solutions:

  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.

  2. Call the eb command with its fully qualified path.

EDIT: Added steps to update path in Jenkins.

like image 90
Rodrigo Murillo Avatar answered Oct 02 '22 22:10

Rodrigo Murillo