/hudson-war/src/main/webapp/env-vars.html

http://github.com/hudson/hudson · HTML · 77 lines · 58 code · 19 blank · 0 comment · 0 complexity · 793475a9bda93252a34b8bb93108d285 MD5 · raw file

  1. <html>
  2. <head>
  3. <title>Available Environmental Variables</title>
  4. <style type="text/css">
  5. dt { font-weight: bold; }
  6. </style>
  7. </head>
  8. <body>
  9. The following variables are available to shell scripts
  10. <dl>
  11. <dt>BUILD_NUMBER</dt>
  12. <dd>The current build number, such as "153"</dd>
  13. <dt>BUILD_ID</dt>
  14. <dd>The current build id, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)</dd>
  15. <dt>JOB_NAME</dt>
  16. <dd>Name of the project of this build, such as "foo"</dd>
  17. <dt>BUILD_TAG</dt>
  18. <dd>String of "hudson-<i>${JOB_NAME}</i>-<i>${BUILD_NUMBER}</i>". Convenient to put into
  19. a resource file, a jar file, etc for easier identification.</dd>
  20. <dt>EXECUTOR_NUMBER</dt>
  21. <dd>The unique number that identifies the current executor
  22. (among executors of the same machine) that's
  23. carrying out this build. This is the number you see in
  24. the "build executor status", except that the number starts from 0, not 1.</dd>
  25. <dt>NODE_NAME</dt>
  26. <dd>Name of the slave if the build is on a slave, or "" if run on master</dd>
  27. <dt>NODE_LABELS</dt>
  28. <dd>Whitespace-separated list of labels that the node is assigned.</dd>
  29. <dt>JAVA_HOME</dt>
  30. <dd>If your job is configured to use a specific JDK, this variable is set to
  31. the JAVA_HOME of the specified JDK. When this variable is set, <tt>PATH</tt>
  32. is also updated to have <tt>$JAVA_HOME/bin</tt>.</dd>
  33. <dt>WORKSPACE</dt>
  34. <dd>The absolute path of the workspace.</dd>
  35. <dt>HUDSON_URL</dt>
  36. <dd>Full URL of Hudson, like <tt>http://server:port/hudson/</tt></dd>
  37. <dt>BUILD_URL</dt>
  38. <dd>Full URL of this build, like <tt>http://server:port/hudson/job/foo/15/</tt></dd>
  39. <dt>JOB_URL</dt>
  40. <dd>Full URL of this job, like <tt>http://server:port/hudson/job/foo/</tt></dd>
  41. <dt>SVN_REVISION</dt>
  42. <dd>For Subversion-based projects, this variable contains the revision number of the module.</dd>
  43. <dt>CVS_BRANCH</dt>
  44. <dd>For CVS-based projects, this variable contains the branch of the module.
  45. If CVS is configured to check out the trunk, this environment variable will not be set.</dd>
  46. <dt>HUDSON_USER</dt>
  47. <dd>Currently logged in user</dd>
  48. </dl>
  49. <p>
  50. To understand how environmental variables provided by Hudson can be utilized by
  51. Ant, study the following target:
  52. <pre><xmp
  53. ><target name="printinfo">
  54. <property environment="env" />
  55. <echo message="${env.BUILD_TAG}"/>
  56. </target></xmp></pre>
  57. </body>
  58. </html>