qileilove

blog已经转移至github,大家请访问 http://qaseven.github.io/

使用命令行方式管理你的Jenkins

Jenkins保留了一套内嵌命令行,允许你通过Shell脚本方式访问Jenkins并进行管理,这就极大的方便了一些日常自动化任务,包括故障诊断等等。

详细信息请参看官方WikiJenkins-CLI

当然,如果你手头已经搭建了一台Jenkins服务器,那么你也可以访问你的Jenkins,然后通过Jenkins - Manage Jenkins - Jenkins CLI页面查看相关帮助,如下图:


Jenkins的命令行方式:

  1. java -jar jenkins-cli.jar [-s JENKINS_URL] command [options...] [arguments...]

所有参数:

  1. <Available Commands>
  2.   
  3.   
  4. build:   
  5.         Builds a job, and optionally waits until its completion.   
  6.   
  7. cancel-quiet-down:   
  8.         Cancel the effect of the "quiet-down" command.   
  9.   
  10. clear-queue:   
  11.         Clears the build queue   
  12.   
  13. connect-node:   
  14.         Reconnect to a node   
  15.   
  16. copy-job:   
  17.         Copies a job.   
  18.   
  19. create-job:   
  20.         Creates a new job by reading stdin as a configuration XML file.   
  21.   
  22. delete-builds:   
  23.         Deletes build record(s).   
  24.   
  25. delete-job:   
  26.         Deletes a job   
  27.   
  28. delete-node:   
  29.         Deletes a node   
  30.   
  31. disable-job:   
  32.         Disables a job   
  33.   
  34. disconnect-node:   
  35.         Disconnects from a node   
  36.   
  37. dist-fork:   
  38.         forks a process on a remote machine and connects to its stdin/stdout   
  39.   
  40. enable-job:   
  41.         Enables a job   
  42.   
  43. get-job:   
  44.         Dumps the job definition XML to stdout   
  45.   
  46. groovy:   
  47.         Executes the specified Groovy script.    
  48.   
  49. groovysh:   
  50.         Runs an interactive groovy shell.   
  51.   
  52. help:   
  53.         Lists all the available commands.   
  54.   
  55. install-plugin:   
  56.         Installs a plugin either from a file, an URL, or from update center.    
  57.   
  58. install-tool:   
  59.         Performs automatic tool installation, and print its location to stdout. Can be only called from inside a build.   
  60.   
  61. keep-build:   
  62.         Mark the build to keep the build forever.   
  63.   
  64. list-changes:   
  65.         Dumps the changelog for the specified build(s).   
  66.   
  67. login:   
  68.         Saves the current credential to allow future commands to run without explicit credential information.   
  69.   
  70. logout:   
  71.         Deletes the credential stored with the login command.    
  72.   
  73. mail:   
  74.         Reads stdin and sends that out as an e-mail.   
  75.   
  76. offline-node:   
  77.         Stop using a node for performing builds temporarily, until the next "online-node" command.   
  78.   
  79. online-node:   
  80.         Resume using a node for performing builds, to cancel out the earlier "offline-node" command.   
  81.   
  82. quiet-down:   
  83.         Quiet down Jenkins, in preparation for a restart. Don't start any builds.   
  84.   
  85. reload-configuration:   
  86.         Discard all the loaded data in memory and reload everything from file system. Useful when you modified config files directly on disk.   
  87.   
  88. restart:   
  89.         Restart Jenkins   
  90.   
  91. safe-restart:   
  92.         Safely restart Jenkins   
  93.   
  94. safe-shutdown:   
  95.         Puts Jenkins into the quiet mode, wait for existing builds to be completed, and then shut down Jenkins.   
  96.   
  97. set-build-description:   
  98.         Sets the description of a build.   
  99.   
  100. set-build-display-name:   
  101.         Sets the displayName of a build   
  102.   
  103. set-build-result:   
  104.         Sets the result of the current build. Works only if invoked from within a build.   
  105.   
  106. shutdown:   
  107.         Immediately shuts down Jenkins server   
  108.   
  109. update-job:   
  110.         Updates the job definition XML from stdin. The opposite of the get-job command   
  111.   
  112. version:   
  113.         Outputs the current version.   
  114.   
  115. wait-node-offline:   
  116.         Wait for a node to become offline   
  117.   
  118. wait-node-online:   
  119.         Wait for a node to become online   
  120.   
  121. who-am-i:   
  122.         Reports your credential and permissions  

posted on 2014-02-17 16:08 顺其自然EVO 阅读(6200) 评论(0)  编辑  收藏 所属分类: 持续集成


只有注册用户登录后才能发表评论。


网站导航:
 
<2024年3月>
252627282912
3456789
10111213141516
17181920212223
24252627282930
31123456

导航

统计

常用链接

留言簿(55)

随笔分类

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜