jenkins内置命令

Jenkins命令调用方式:

调用Jenkins命令设置job的描述信息。

$JAVA_BIN-jar "$JENKINS_CLI_JAR" -s "$JENKINS_URL"  set-build-description "${JOB_NAME}""${BUILD_NUMBER}" "$tag_name" --username "$SVN_USERNAME" --password"$SVN_PASSWORD"


以下为参考其他:

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

<a href="http://i.minus.com/jk81S4rpmGc2n.jpg" target="_blank" class="cboxElement" rel="example4" 2881"="" style="text-decoration: none; color: rgb(1, 150, 227);">

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  
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值