Le mer. 3 mars 2021 à 06:44, Tim Black <[email protected]> a écrit :

> Think I found it: NameMangler.apply()
> <https://github.com/jenkinsci/branch-api-plugin/blob/f2bd7ec715057feb047754f5427f209bbf1b3248/src/main/java/jenkins/branch/NameMangler.java#L55>.
> Would it be possible/advised to import the NameMangler class in my Shared
> Library vars/scpArtifacts.groovy (assuming my Jenkins instance has
> branch-api plugin installed, which it does.) Something like this:
>
> ```
> import jenkins.branch.NameMangler
> def mangled_branch_name = NameMangler.apply(branch_name)
> ```
>
> I'll try this out in the morning, just curious if anyone can confirm
> whether this looks feasible or I'm way off track. Thanks.
>

Using core java classes from Jenkins pipeline shared library is generally
strongly discouraged.
This could break from one day to another without notice.
What you're working on looks like it should rather be done in a full-blown
Jenkins plugin.
(If not, this discussion should be on the users mailing list)


>
> On Tuesday, March 2, 2021 at 8:03:57 PM UTC-8 Jesse Glick wrote:
>
>> The principal class to look at is `MultiBranchProject`.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/40b68498-b2ba-4e02-9c23-1eb76c04709an%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/40b68498-b2ba-4e02-9c23-1eb76c04709an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANWgJS61vkmc_O9mgS1YYOy_CF_Vh92LvkQ0%3D0rQW7Vi5_DKUw%40mail.gmail.com.

Reply via email to