Jenkins Script ConsoleJenkins features a nice Groovy script console which allows to run arbitrary scripts on the Jenkins server or on slave nodes. This feature can be accessed from the "manage Jenkins" link, typically at your http://server/jenkins/script. Shortcut key on script console to submitYou can submit a script without mouse. Jenkins has a shortcut key which enables to submit with keyboard.
Remote accessUser can execute groovy scripts remotely sending post request to /script/ url or /scriptText/ to have response returned without the html wrapping. $ curl -d "script=<your_script_here>" http://jenkins/script $ # or $ curl -d "script=<your_script_here>" http://jenkins/scriptText Also, Jenkins CLI offers the possibility to execute groovy scripts remotely using groovy command or execute groovy interactivelly via groovysh. Sample Groovy scriptsBrowse all Scriptler Plugin Groovy Scripts: https://github.com/jenkinsci/jenkins-scripts/tree/master/scriptler please share your scripts with the Scriptler Plugin
More Scripts available at Scriptler Web Write Groovy scripts for Jenkins with Code completion - The gist of this is to create a Maven project within your IDE and to depend on org.jenkins-ci.main:jenkins-core (and any other plugins that you expect present). You can then write a Groovy script with code completion of Jenkins API objects and methods. Plugins enabling Groovy usage
|
Jenkins Script Console
Skip to end of metadata
Go to start of metadata
Comments (5)
May 31, 2011
Mark Howard says:
Does anyone have any advice for writing these scripts? Is it just a case of blin...Does anyone have any advice for writing these scripts? Is it just a case of blindly trying to find relevant source code/javadocs and then hand coding and running, or is there a sensible way of testing them in advance?
Nov 21, 2011
Alex Gray says:
I would take a look at this web page: http://javadoc.jenkins-ci.org/hudson/model...I would take a look at this web page: http://javadoc.jenkins-ci.org/hudson/model/package-tree.html
It's a reference with all the things you can do. It's a little daunting at first, but once you check out the examples on this page and learn Groovy (which is similar like Java), you can figure out which methods you need to call.
Also, I found downloading the source code for various plugins very useful. I hope this helps, and good luck!
Jul 09, 2013
Timor Raiman says:
The built-in groovy engine (for running system scripts / script console) seems t...The built-in groovy engine (for running system scripts / script console) seems to be a bit outdated:
groovy.lang.GroovySystem.getVersion() returns 1.8.5 for me,
while an external script can be run with an installation of 2.1.5 or whatever external groovy is available.
I have a fairly recent version of Jenkins itself - 1.518
Is it possible to update Jenkins's internal groovy engine? Is it planned to be udpated in a future release of Jenkins?
Apr 02, 2014
Olivier MARION says:
Seems that Write Groovy scripts for Jenkins with Code completion( http://blog.do...Seems that Write Groovy scripts for Jenkins with Code completion( http://blog.doninger.net/2011/11/write-groovy-scripts-for-jenkins-with.html) has moved to http://www.mdoninger.de/2011/11/07/write-groovy-scripts-for-jenkins-with-code-completion.html
Aug 28, 2014
karim har. says:
Hello Id like to know how i can parse the console output of a build from anothe...Hello
Id like to know how i can parse the console output of a build from another job through groovy script please?
Not a postbuild one but build groovy script.
trying something like that
-------
Add Comment