Created
February 26, 2012 01:09
-
-
Save kellyrob99/1912014 to your computer and use it in GitHub Desktop.
Launch an interactive Groovy shell to a Jenkins server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @GrabResolver(name = 'glassfish', root = 'http://maven.glassfish.org/content/groups/public/') | |
| @GrabResolver(name = "github", root = "http://kellyrob99.github.com/Jenkins-api-tour/repository") | |
| @Grab('org.kar:hudson-api:0.2-SNAPSHOT') | |
| @GrabExclude('org.codehaus.groovy:groovy') | |
| import org.kar.hudson.api.cli.HudsonCliApi | |
| /** | |
| * Open an interactive Groovy shell that imports the hudson.model.* classes and exposes | |
| * a 'hudson' and/or 'jenkins' object in the Binding which is an instance of hudson.model.Hudson | |
| */ | |
| HudsonCliApi cliApi = new HudsonCliApi() | |
| String rootUrl = args ? args[0] :'http://localhost:8080' | |
| cliApi.runCliCommand(rootUrl, 'groovysh') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment