mirror of https://github.com/jenkinsci/jenkins.git
62 lines
2.0 KiB
HTML
62 lines
2.0 KiB
HTML
<html>
|
|
<head>
|
|
<title>Available Environmental Variables</title>
|
|
</head>
|
|
<style type="text/css">
|
|
dt { font-weight: bold; }
|
|
</style>
|
|
<body>
|
|
The following variables are available to shell scripts
|
|
|
|
<dl>
|
|
<dt>BUILD_NUMBER</dt>
|
|
<dd>The current build number, such as "153"</dd>
|
|
|
|
<dt>BUILD_ID</dt>
|
|
<dd>The current build id, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)</dd>
|
|
|
|
<dt>JOB_NAME</dt>
|
|
<dd>Name of the project of this build, such as "foo"</dd>
|
|
|
|
<dt>BUILD_TAG</dt>
|
|
<dd>String of "hudson-<i>${JOBNAME}</i>-<i>${BUILD_NUMBER}</i>". Convenient to put into
|
|
a resource file, a jar file, etc for easier identification.</dd>
|
|
|
|
<dt>EXECUTOR_NUMBER</dt>
|
|
<dd>The unique number that identifies the current executor
|
|
(among executors of the same machine) that's
|
|
carrying out this build. This is the number you see in
|
|
the "build executor status", except that the number starts from 0, not 1.</dd>
|
|
|
|
<dt>JAVA_HOME</dt>
|
|
<dd>If your job is configured to use a specific JDK, this variable is set to
|
|
the JAVA_HOME of the specified JDK. When this variable is set, <tt>PATH</tt>
|
|
is also updated to have <tt>$JAVA_HOME/bin</tt>.</dd>
|
|
|
|
<dt>WORKSPACE</dt>
|
|
<dd>The absolute path of the workspace.</dd>
|
|
|
|
<dt>HUDSON_URL</dt>
|
|
<dd>Full URL of Hudson, like <tt>http://server:port/hudson/</tt></dd>
|
|
|
|
<dt>SVN_REVISION</dt>
|
|
<dd>For Subversion-based projects, this variable contains the revision number of the module.</dd>
|
|
|
|
<dt>CVS_BRANCH</dt>
|
|
<dd>For CVS-based projects, this variable contains the branch of the module.
|
|
If CVS is configured to check out the trunk, this environment variable will not be set.</dd>
|
|
</dl>
|
|
|
|
|
|
<p>
|
|
To understand how environmental variables provided by Hudson can be utilized by
|
|
Ant, study the following target:
|
|
|
|
<pre><xmp
|
|
><target name="printinfo">
|
|
<property environment="env" />
|
|
<echo message="${env.BUILD_TAG}"/>
|
|
</target></xmp></pre>
|
|
|
|
</body>
|
|
</html> |