javaposse.jobdsl.dsl.DslScriptLoader is the main class to execute the DSL script. You'll see the lines where binding.setVariable()
is called.
Last active
December 29, 2021 17:03
-
-
Save unakatsuo/a79a5f103584112f5c114e38365a851c to your computer and use it in GitHub Desktop.
Jenkins Job DSL embedded variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.binding.variables.each { | |
out.println "${it.key} = ${it.value} (${it.value.class})" | |
} | |
out.println SEED_JOB.name | |
out.println SEED_JOB.lastBuild.class | |
def seed_scm = SEED_JOB.getSCMs()[0] | |
out.println seed_scm.userRemoteConfigs[0].url | |
//@groovy.transform.Field | |
// Guessing workspace path from current groovy script file. | |
out.println new File(this.binding.getVariable('__FILE__') + "../../../../").getCanonicalPath() | |
SEED_WORKSPACE=new File(this.binding.getVariable('__FILE__') + "../../../../").getCanonicalPath() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment