1. 程式人生 > >jenkins內建命令

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