4

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?

Jesse Glick
  • 24,539
  • 10
  • 90
  • 112
jvanryn
  • 294
  • 1
  • 3
  • 11

1 Answers1

5

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.

Jesse Glick
  • 24,539
  • 10
  • 90
  • 112
  • "Yes, as of 1.13 you can download a GDSL" <- every time I click mine I get a stack dump.. So I guess if it does work I should submit a bug.. though I don't know why it needs to be tied to one's Jenkins. Would be great if it was just available with instructions for how to install it.. "Replay" I LOVE that feature and use it regularly.. but it does not autocomplete.. :-) – jvanryn Mar 17 '16 at 22:10