Search code examples
jenkinsdslcloudbeesjenkins-workflowspring-dsl

pipeline Source for DSL


I'm starting to work on pipelines for jenkins (formerly workflow)

I'm using IntelliJ for an IDE

Is there a source of Documentation for GDSL or some way I can know what groovy is acceptable in the pipeline and what is not?

Also is there a way that I can test run the GDSL before having to check in my Jenkinsfile?


Solution

  • Is there a source of Documentation for GDSL

    Yes, as of 1.13 you can download a GDSL schema from Snippet Generator and install it in IDEA. There are some aspects missing—for example step return types are not defined in this schema. Last I checked it also did not offer completion on, for example, known $class implementations for step; this information is available in the Snippet Generator UI and downloadable HTML reference documentation.

    is there a way that I can test run the [script?] before having to check in my Jenkinsfile?

    There is not currently an offline test feature; it would be tricky since everything in a Pipeline script is intended to be interacting with a live Jenkins service. (If you have other logic in there, it would be better factored out into external scripts in the language of your choice.)

    As of 1.14 there is a Replay link you can use to iteratively test proposed changes before committing to Jenkinsfile, and you can use this from the CLI too.