Scriptler Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID scriptler Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
Dependencies
2.7
Feb 22, 2014
1.480
git-client (version:1.6.0)
git (version:2.0.1)
credentials (version:1.9.3)
ssh-credentials (version:1.5.1)
scm-api (version:0.1)
token-macro (version:1.6)
git-server (version:1.3)
Source Code
Issue Tracking
Maintainer(s)
GitHub
Open Issues
Dominik Bartholdi (id: imod)
Usage Installations 2013-Apr 1358
2013-May 1500
2013-Jun 1580
2013-Jul 1758
2013-Aug 1791
2013-Sep 1863
2013-Oct 2075
2013-Nov 2148
2013-Dec 2188
2014-Jan 2374
2014-Feb 2609
2014-Mar 2739

Scriptler allows you to store/edit groovy scripts and execute it on any of the slaves/nodes... no need to copy/paste groovy code anymore.

Besides administering your scripts, Scriptler also provides a way to share scripts between users via hosted script catalogs on the internet.
At http://scriptlerweb.appspot.com you are not only able to find scripts and import it via scriptler in to your Jenkins instance, but can also share your own scripts. All you need is a nice script other people might like too and an OpenId login. A login is only needed if you would like to share a script - If you have a google acount, you're already fine, but any other will do too (OpenId, Yahoo, AOL, ...).

A second catalog is hosted at github: https://github.com/jenkinsci/jenkins-scripts/tree/master/scriptler, just send pull requests to to https://github.com/jenkinsci/jenkins-scripts/ and your scripts will be available for everyone else too.

Please share your scripts at https://github.com/jenkinsci/jenkins-scripts or http://scriptlerweb.appspot.com

Description

This plugin takes the idea of the script console one step further and allows you to ease your daily work with the Jenkins script console.

  • save/edit groovy scripts
  • select the node to execute the script on
  • download scripts from a shared catalog
  • scripts repo is exposed via git, push/pull scripts into scriptler

Scriptler adds a new link to the manage Jenkins page:

 

From within the Scriptlers view, you can create ("Add a new Script") or import scripts via the "Remote script catalog".

Catalogs

Import a script from a public catalog:

Edit

The editor is syntax highlighted and allows you to define parameters which have to be passed to the script...


Once you have created/imported some scripts, you run it right from the same screen, just click on the little terminal icon on the scripts list.

You'll get forwarded to a page where you can select the node the script should run on and can can even modify the script just before execution. These modifications will not touch the saved version of the script and are only active for you and only as long till you change to another script.

After execution, the output of the command will appear in the below part of the screen.

Builder

Since version 2.2, Scriptler also provides a builder, with this support one is able to integrate its admins scripts in any job. The dropdown will provide all scripts which have been marked to be allowed with 'RunScript' permission.

To be able to configure a Scriptler Builder, the user has to be administrator or have 'RunScript' permission! All changes made by a user not having these permissions will get lost. The 'Value' also supports parameter expansion and expansion by the Token Macro Plugin .

Settings

You are able to configure whether you want to allow users which have only the "RunScripts" permission to execute scripts (every script has to be allowed separately). In addition you can also configure if these users should be able to change a script (which would be a security issue).

Git

Scriptler exposes its scripts via git. Browse to JENKINS_URL/scriptler.git on your installation to get more info about how to access the repo via git.

This allows an administrator to push/pull scripts from its workstation/IDE into Scriptler. If such a script is pushed the first time into scriptler, then it will parse the optional header info like this:

optional script header
/*** BEGIN META {
  "name" : "Clear build queue",
  "comment" : "If you accidently trigger a lot of unneeded builds, it is useful to be able to <b>cancel</b> them all",
  "parameters" : [],
  "core": "1.300",
  "authors" : [
    { name : "Niels Harremoes" }
  ]
} END META**/
println("hello world")

TokenMacro Support

Scriptler supports the Token Macro Plugin in two ways

  1. as a consumer, scriptler accepts tokens in the passed arguments
  2. as a producer, scriptler exposes all scripts marked as non admin scripts via a macro:
    - the value returned by the script is the value returned by the TokenMacro, it is NOT enough to write something to the console/log
    - scriptler exposes the current 'build' to the script executed (since 1.7)
macro
${SCRIPTLER, scriptId="superscript.groovy"}
superscript.groovy
def d = new Date()
return "TODAY is: ${d.toString()} - build number is: ${build.number}"

REST

since version 1.7, one can also run a script using GET or POST to the URL /scriptler/run/<your-script-id> with the optional parameters node, script (alternative script text), contentType, and the parameters defined for your stored script.

e.g.

http://myserver/jenkins/scriptler/run/<yourScriptId>?param1=value1

Version History

2.7 (Feb 22, 2014)

  • fixed JENKINS-19988 Changes to script parameters in Run Script window affect permanent definitions
  • integrated PR #17 Pass current build to SCRIPTLER token macro (thanks to Andreas Gudian)
  • integrated PR #16 Add simple size-limited cache to avoid parsing of unchanged scripts (thanks to Andreas Gudian)
  • integrated PR #15 JENKINS-14964 Allow running scripts using the REST API (thanks to Andreas Gudian)

2.6.1 (May 19, 2013)

  • Implement JENKINS-17708 Expose scriptler scripts via token macro token

2.6 (May 5, 2013)

  • fix JENKINS-16047 Scriptler plugin does not show Error/Exceptions anymore
  • fix JENKINS-17259 don't fail if parameters can't be expanded
  • integrate pull request #13 Expose build, launcher, listener to groovy scripts when run on the master node
  • fix some image/icon references

2.5.1 (Nov 20, 2012)

  • fix dependency to git-server plugin - this is a mandatory depedendency now

2.5 (Nov 7, 2012)

2.4.1 (Okt 11, 2012)

  • fix issue when Jenkins is running with a different root context - details of scripts could not be opened

2.4 (Aug 31, 2012)

2.3 (June 24, 2012)

  • Pull #8 / JENKINS-13979 allow build step to fail build by using boolean return values
  • allow to propagate job parameters into builder execution

2.2.1 (April 27, 2012)

2.2 (Mar. 9, 2012)

  • add a builder, to enable scheduling of scripts
  • add Japanese localization (thanks to ikikko!)
  • fix JENKINS-10839 support HTML output

2.1 (Feb. 21, 2012)

  • fix JENKINS-12748 - Scriptler remote catalog breaks when script name contains certain characters
  • fix JENKINS-12750 - Scriptler 2.0 breaks cc.xml-View for Anonymous User

2.0 (Jan. 29, 2012)

  • integrate pull #2: allow users with permission "RunScripts" to run scripts in scriptler (thanks to lvotypko)
  • integrate pull #5: add 'all' and 'all slaves' to the options where to run the script (thanks to eciramella)
  • intergate pull #1: ensure links open in new windows (thanks to bap2000)
  • enable script sharing with github: https://github.com/jenkinsci/jenkins-scripts (2. catalog)
  • enable passing parameters to scripts
  • make it configurable whether users with "RunScript" permission can change a script before execution

1.5 (April 16, 2011)

  • fix JENKINS-9302 - allow to disable remote script download functionality
  • fix JENKINS-9130 - Add a dynamic parser to colorize and indent groovy textareas

1.4 (Okt 11, 2010)

1.2 (Sep 15, 2010)

1.0

  • Inital (with suport for a static catalog)

Help and Support

For Help and support please use the Jenkins Users mailing list.
Issues about scriptlerweb can be opened at http://code.google.com/p/scriptlerweb
The comment list below is not monitored.

Labels

Edit
plugin-slaves plugin-slaves Delete
token-producer token-producer Delete
plugin-misc plugin-misc Delete
plugin-groovy-related plugin-groovy-related Delete
token-consumer token-consumer Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Add Comment