I am able to execute a shell script from build section in Jenkins, by performing cd to the directory and executing the script residing on my Linux Machine.
However when I am trying to populate Active Choices parameter, by executing the shell script from a groovy script it is not working no matter how many ways I try.
The output is always java.lang.UNIXProcess
Please help. I have been trying from past few days with no success
* Below are few from what I have tried:*
def command =['/bin/sh', '-c', 'ssh user@host '/path/to/script.sh ' ']
def command = 'bash /path/to/script.sh'
I am expecting it to return output of the script.
When I execute only "ls" command, as in def command = 'ls' then it is listing Jenkins files under home directory but not scripts'
to add more on the above. When I am trying to switch to the current workspace it says directory not found.
And I am trying to write script for Active Choice Parameters, I am not sure how to make scope of script to point to Work space.
My assumption is If I am able to switch to the Workspace directory, I may able to execute the shell script residing on my Linux machine