Search code examples
linuxbashjenkinsjenkins-pipeline

"ifconfig" or "ip a" not found when running jenkins script


I have a task created in Jenkins where a Linux bash script should be runned. There is an ipconfig inside the script to capture the ip address. The problem is when running manually in a linux terminal the commands works fine but inside Jenkins I am getting command not found. During my research about the problem, I changed to ip a command but had the same issue. Do you have an idea why this happens with jenkins?

Thanks


Solution

  • It could be that it wasnt in the $PATH. You could try replacing each instance with the absolute path.