Last active
April 28, 2018 00:53
-
-
Save macg33zr/5810981 to your computer and use it in GitHub Desktop.
Jenkins CLI Gradle Skeleton - what is needed to get started to use the Jenkins CLI from Gradle scripts
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
import hudson.cli.CLI | |
buildscript { | |
repositories { | |
maven { | |
url 'http://repo.jenkins-ci.org/repo/' | |
} | |
} | |
dependencies { | |
classpath 'org.jenkins-ci.main:cli:1.519' | |
} | |
} | |
def rootUrl = "http://localhost:8080" | |
def runCliCommandArgs = { args -> | |
def CLI cli = new CLI(rootUrl.toURI().toURL()) | |
cli.execute(args, System.in, System.out, System.err) | |
cli.close() | |
} | |
task help << { | |
runCliCommandArgs(["help"]) | |
} | |
task list_plugins << { | |
runCliCommandArgs(["list-plugins"]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment