mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-12 19:42:20 +00:00
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1723 71c3de6d-444a-0410-be80-ed276b4c234a
49 lines
1.5 KiB
HTML
49 lines
1.5 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>
|
|
</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> |