Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use from Pipeline? #101

Open
g1ps opened this issue Jul 2, 2018 · 0 comments
Open

How to use from Pipeline? #101

g1ps opened this issue Jul 2, 2018 · 0 comments

Comments

@g1ps
Copy link

g1ps commented Jul 2, 2018

Hi,

I have your classes working nicely from a JobDSL script via import. I'd also like to be able to call them from a Pipeline script along these lines:

@Library('JobBuilder') _

node('master'){
    new org.jobBuilder.BaseJobBuilder(
        directory: directory,
        name: "_libTest",
        repository: repository,
        branch: 'master',
        gitTag: 'IMPORTANT_GIT_TAG',
        script: 'test.sh',
        gradleTasks: 'sayHello'
    ).build(<WHAT GOES HERE?>)
}

I have the global library working and the classes load correctly but I can't work out what to pass the JobBuilder class. I understand that it needs the right JobDSL closure which will provide the delegate needed by the classes but I can't determine how to construct it. I have tried importing and using a large number of classes from the plugin and associated code without success. I have also experimented with using the Pipeline JobDsl step, equally unseuccesfully. Can you point me in the right direction?

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant