Loading Pipeline Library from either Git branch or tag

37 views
Skip to first unread message

Łukasz Zachulski

unread,
Jun 28, 2017, 3:42:30 PM6/28/17
to Jenkins Users
Is it possible to specify branch for Pipeline Library in such a way that it would allow override default @Library version with either Git tag or branch?


So far I have tried different wildcard combinations, refs/*/${library.Global.version}, but none of them works.

Instead if I stop using wildcards and specify expression with only environment variable, refs/${library.Global.version},  it works. However it then forces me to specify library version with either tags or heads prefix, ex. @Library('Global@heads/version/1.0,') or @Library('Global@tags/1.0.0').


Is a way to end up with shorter notation like @Library('Global@version/1.0') or @Library('Glo...@1.0.0')?

Regards,
Lukasz.

Łukasz Zachulski

unread,
Jun 29, 2017, 6:44:22 AM6/29/17
to Jenkins Users
Apparently it's possible :)

If I set Refspec "+refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/remotes/origin/tags/*" and Branch Specifier "${library.Global.version}" I can load my library the way I wanted, @Library('Global@version/1.0') or @Library('Glo...@1.0.0')
Reply all
Reply to author
Forward
0 new messages