I recently rewrite bash execution command into Jenkins pipeline. The old code is like
...
source environment.sh
//Build
//Test
...
Now I use pi
If someone want to execute the script with source only solution is to change "Shell executable" to bash in ->Manage Jenkins->Configure System
Replace source environment.sh with
. ./environment.sh
Please note there is a space after first dot.
source is a bash/ksh/etc extension, provided as a more "substantial" synonym for ..
In sh, you need to use . in case the underlying shell is one (such as dash) that does not support the command source.
sh '''
...
. environment.sh
//Build
//Test
...
'''