简体   繁体   中英

Reuse jenkins pipeline or groovy script?

We have jenkins pipelines which are reused and some pipelines which use the same functions. Now is my question: what is the right approach to reuse them. I use a shared library but I don't know if I have to add groovy scripts or full pipelines? The groovy scripts seem to be executed in the root instead of my jenkins workspace which is a big issue. How are you handling this in the right way?

Using shared library is the right approach. You have to add just groovy scripts to your library and use them in your pipeline.

Have a look at an example, Pipeline and the associated library .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM