I want to automate the process of bringing up a Jenkins server so I have used multiple groovy init scripts. The one thing that I need now is that I want to be able to access two public methods of this gitlab plugin package [to be specific, I need to access these two methods: setTokenSecret, and setTriggerOnPush]. However I don’t know how to get the class instance in groovy. I tried to run this code but it apparently gets an instance of some other class related to the main class.
def gitlabPushTriggerClass = Jenkins.instance.getDescriptor("com.dabsquared.gitlabjenkins.GitLabPushTrigger")
Any help is much appreciated.