Call a declarative pipeline from within a declarative pipeline?

16 views
Skip to first unread message

Michael Carter

unread,
Nov 19, 2020, 3:20:11 PM11/19/20
to Jenkins Developers
Before I start looking at some hacky way to do this.

Can I define a declarative pipeline script in my jenkins job.  Then after the git download... call one from the git clone and run it?

Is there something to do this out there?  A plugin or command?

Brian Thompson

unread,
Nov 19, 2020, 3:59:24 PM11/19/20
to Jenkins Developers
You could create a shared library: https://www.jenkins.io/doc/book/pipeline/shared-libraries/

Unless you have a very specific reason for doing what you're describing, shared libraries are the way to go.

Reply all
Reply to author
Forward
0 new messages