I recently rewrote the bash run command in the Jenkins pipeline. Old code is like
... source environment.sh //Build //Test ...
Now I use a script pipeline to wrap a command like this
sh ''' ... source environment.sh //Build //Test ... '''
However, I got an error like .../.jenkins/script.sh: line 9: source: environment.sh: file not found . When I try less environment.sh , it displays correctly. Therefore, I suspect something is wrong with the source command inside sh wrap .
Before using the pipeline, the source environment.sh command works fine when executing a shell. So the source is installed on the Jenkins server, it seems that the script pipeline does not know what the original command is.
How can I do to run the source command in sh shackped block?
linux bash shell jenkins jenkins-pipeline
Neil
source share