Can we git clone a project using a TAG ?

29 views
Skip to first unread message

Charles Moulliard

unread,
Dec 10, 2020, 11:03:45 AM12/10/20
to job-dsl-plugin
Hi

This mavenJob DSL syntax

mavenJob('mvn-dummy') {
    description 'A dummy Maven Job'
    label('maven3')
    parameters {
        gitParam('SELECTED_TAG') {
            description 'The Git tag to checkout'
            type 'TAG'
            defaultValue '2.3.4-2'
        }
    }
    scm {
        git {
            remote {
            }
            branch(${SELECTED_TAG})
        }
    }
    rootPOM 'pom.xml'
    goals 'clean install'
}
generates the following error when imported in a FreeStyleJob

Processing DSL script jobs/mavenDummyJob.groovy
ERROR: (mavenDummyJob.groovy, line 19) No signature of method: javaposse.jobdsl.dsl.helpers.scm.GitContext.$() is applicable for argument types: (mavenDummyJob$_run_closure1$_closure3$_closure5$_closure7) values: [mavenDummyJob$_run_closure1$_closure3$_closure5$_closure7@b65b78]
Possible solutions: is(java.lang.Object), any(), use([Ljava.lang.Object;), any(groovy.lang.Closure), wait(), grep()
Finished: FAILURE

where line 19 = branch(${SELECTED_TAG})

So is it supported ? If yes, how ?

Cheers

Charles

Matt Sheehan

unread,
Dec 10, 2020, 11:30:29 AM12/10/20
to job-dsl-plugin
You probably need single-quotes around '${SELECTED_TAG}', so it will be evaluated when the job runs.

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/2f7f6ad5-c1f1-4f5f-b961-fe77710fde3en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages