How can I reference the Jenkinsfile directory, with Pipeline?

前端 未结 6 1204
你的背包
你的背包 2021-02-03 18:50

I have a groovy file, I want to run from the Jenkinsfile.

ie. load script.groovy

However, I am not sure how I can reference this file if it is store

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-03 19:25

    If deploy_esb.groovy file is stored in the same SCM as the Jenkinsfile you can do:

    node {       
       def workspace = pwd() 
       load "${workspace}@script/esb_deploybar_pipeline/deploy_esb.groovy"
    }
    

提交回复
热议问题