How to use source command within Jenkins pipeline script

前端 未结 3 2077
我在风中等你
我在风中等你 2021-02-12 13:42

I recently rewrite bash execution command into Jenkins pipeline. The old code is like

...
source environment.sh
//Build
//Test
...

Now I use pi

3条回答
  •  忘了有多久
    2021-02-12 14:19

    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
        ...
    '''
    

提交回复
热议问题