Is there a way to write Jenkins Pipeline script interactively, like you can run other Groovy in the Jenkins Script Console? Ideally I effectively want "pipeline groovysh
in Jenkins".
AFAICS the script console doesn't set up any of the environment needed to make Pipeline work so you can't just run ad-hoc chunks of pipeline jobs there.
I'm aware of the "Replay" option, but it's painfully slow for a remote Jenkins and doesn't integrate well into VCS.
Background: As I'm doing a lot of work on Jenkins pipelines lately I'm finding that the test cycle is becoming painful. Ironic really. Commit, push to working branch, "build with parameters" (or rebuild) a job pointing to the the working branch for the pipleine script, wait for results, examine console log, repeat.
Tedious.
I've improved it a little by having my test job auto-trigger on pushes to my pipeline repo but that's still pretty clumsy.
Firing up a local Jenkins for testing is not very practical - the pipelines need to interact with a private Docker registry, need a specific plugin config, need some specific worker types, etc. It also doesn't help a great deal with the turnaround.
So how do others do it better? jenkins-cli
remote control? Other?
jenkins-cli
doesn't seem to be able to interact with the ssh-agent to avoid prompting for the private key password each and every time... – Craig Ringer