看了一下源码,大致过程是:
hudson.cli.CLI._main(String[] _args)
hudson.cli.CliManagerImpl.main(List<String> args, Locale locale, InputStream stdin, OutputStream stdout, OutputStream stderr)
hudson.cli.CLICommand.main(List<String> args, Locale locale, InputStream stdin, PrintStream stdout, PrintStream stderr)
等等等....
感觉我的插件没有用处,因为我只要使用就可以了。只需要模仿,如下行为模式就可以了:
java -jar jenkins-cli.jar -s http://<jenkinshost>/ create-job <jobname> --username <admin name> --password <admin passwd> < config.xml
将要使用CLI命令有:
- create-job: Creates a new job by reading stdin as a configuration XML file.
- delete-job: Deletes a job
- update-job: Updates the job definition XML from stdin. The opposite of the get-job command
- rename-job: 悲剧了,没有rename命令。难道得我自己扩展?