Joe
Joe

Reputation: 795

Jenkins Job DSL configure block

I am new to Jenkins Job DSL and trying to figure out how to use configure block in the scm section of my DSL. I have a section that is generated by default in my Jenkins config.xml

<scm class='hudson.plugins.git.GitSCM'>
    <browser class='hudson.plugins.git.browser.GithubWeb'>
        <url>https://github.com/repository/</url>
    </browser>
</scm>

I know there is a browser method in the Jenkins Job DSL Plugin API and you can set it to gitblit, gitiles, gitLab, gitWeb, gogs, and stash.

I would like to set it (Auto). I've tried using the configure block method but it returns an error:

javaposse.jobdsl.dsl.DslScriptException: (script, line 12) Ambiguous method overloading for method groovy.util.Node#div.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:

line 12 is the it statement.

Code:

scm {
        git {
            remote {
                github
                credentials
            }
            branch("refs/heads/master")
            configure {
                it / 'scm' / 'browser' {}
            }
        }
    }

So I am not sure how to fix this with code.

Any help would be appreciated.

thank you.

Upvotes: 1

Views: 783

Answers (1)

Colin Moreno Burgess
Colin Moreno Burgess

Reputation: 1602

In the documentation it said that process xml might be a bit tricky, I think It should go something like this(format, content don't know if it's like this):

it / scm / browser(class: 'hudson.plugins.git.browser.GithubWeb') / url('https://github.com/repository/')

Upvotes: 0

Related Questions