-
Notifications
You must be signed in to change notification settings - Fork 828
Frequently Asked Questions
Andrew Harmel-Law edited this page Sep 26, 2013
·
11 revisions
Not all of these have been asked a lot, but they're good things to know.
- Q: Is there a Java Binding for Job-DSL? - A: No, not at the moment. The DSL relies heavily of both closures for contexts and methodMissing/propertyMissing for XML generation. There's not currently a good Java equivalent of either of those. It's not to say that it couldn't be done, it'd just be ugly.
- Q: Why won't my DSL script run? - using an element name already defined in an outer scope - A: a common problem that many folks see using is "name()" in a configure block because this clashes with the name method of the job element. In general, you cannot use any element name (in this case "name") which is already an identifier in an outer scope. In these cases, you need to fallback to low-level API. See more on the forum.
-
Q: Why isn't my generated config.xml like I was expecting, there was no error when the seed job ran? - A: Have you got the plugins installed in your Jenkins that the generated config.xml will refer to? If not, your the seed job may run, but you won't see any errors. Take a look in the Jenkins log for things like
com.thoughworks.xstream.mapper.CannotResolveClassException: org.jenkinsci.plugins.multiplescms.MultiSCM ...
-
Q: When using
shell("php symfony test:unit --xml=log/build_$BUILD_NUMBER.xml")
I'm getting the errorFATAL: No such property: xml for class: java.lang.String
? - A: You should use ${BUILD_NUMBER}. Or if you need the variable to be set like that in the job, you need to escape the $ (e.g $BUILD_NUMBER). - Q: What's a canonical example of a good Pull request? - A: https://github.com/jenkinsci/job-dsl-plugin/pull/91
- Q: How do I add a Step in a particular Order using the configure block? - A:
steps {
shell(bumpVersionStep)
}
// Configure the XCode builder plugin - outside of the job DSL
configure { project ->
project/builders << 'au.com.rayh.XCodeBuilder'{
// Blah blah
}
}
steps {
shell(buildLoggerStep)
shell(saveEnvironmentStep)
}
Stack Overflow | Mailing List | API Reference | Issue Tracker | Playground | Plugin | Wiki | GitHub
Home
Release Notes
Migration
Talks and Blog Posts
Documentation
Tutorial
Dynamic DSL
Configure Blocks
Job DSL Commands
Script Security
Handling Credentials
Configuration as Code
FAQ
Real World Examples
User Power Moves
IDE Support
Testing DSL Scripts
For Developers
Extending the DSL
Job DSL Architecture