提交 72fbaba2 编写于 作者: K Kohsuke Kawaguchi

Refactored existing static list into CoreEnvironmentContributor.

上级 08d870ba
......@@ -24,6 +24,7 @@
package hudson.model;
import hudson.EnvVars;
import hudson.Extension;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.scm.SCM;
......@@ -88,4 +89,24 @@ public abstract class EnvironmentContributor implements ExtensionPoint {
public static ExtensionList<EnvironmentContributor> all() {
return Jenkins.getInstance().getExtensionList(EnvironmentContributor.class);
}
/**
* Serves the combined list of environment variables available from this plugin.
*
* Served from "/env-vars.html"
*/
@Extension
public static class EnvVarsHtml implements RootAction {
public String getIconFileName() {
return null;
}
public String getDisplayName() {
return null;
}
public String getUrlName() {
return "env-vars.html";
}
}
}
import hudson.model.EnvironmentContributor
def st = namespace("jelly:stapler")
html {
head {
title(_("Available Environmental Variables"))
style(type:"text/css", "dt { font-weight: bold; }")
}
body {
p "The following variables are available to shell scripts"
dl {
EnvironmentContributor.all().each { e -> st.include(it:e, page:"buildEnv", optional:true) }
}
}
}
Available\ Environmental\ Variables=Verf\u00FCgbare Umgebungsvariablen
The\ following\ variables\ are\ available\ to\ shell\ scripts=Die folgenden Variablen sind innerhalb von Shell-Skripten sichtbar:
\ No newline at end of file
Available\ Environmental\ Variables=Variables d'environnement disponibles
The\ following\ variables\ are\ available\ to\ shell\ scripts=Les variables suivantes sont mises \u00E0 disposition des scripts shell
\ No newline at end of file
Available\ Environmental\ Variables=\u5229\u7528\u53EF\u80FD\u306A\u74B0\u5883\u5909\u6570
The\ following\ variables\ are\ available\ to\ shell\ scripts=\u30B7\u30A7\u30EB\u30B9\u30AF\u30EA\u30D7\u30C8\u3067\u306F\u3001\u6B21\u306E\u5909\u6570\u3092\u5229\u7528\u3067\u304D\u307E\u3059\u3002
\ No newline at end of file
Available\ Environmental\ Variables=Beschikbare omgevingsparameters
The\ following\ variables\ are\ available\ to\ shell\ scripts=Volgende parameters zijn beschikbaar voor gebruik in uw scripts:
\ No newline at end of file
package jenkins.model.CoreEnvironmentContributor;
def l = namespace(lib.JenkinsTagLib)
// also advertises those contributed by Run.getCharacteristicEnvVars()
["BUILD_NUMBER","BUILD_ID","JOB_NAME","BUILD_TAG","EXECUTOR_NUMBER","NODE_NAME","NODE_LABELS","WORKSPACE","JENKINS_HOME","JENKINS_URL","BUILD_URL","JOB_URL"].each { name ->
l.buildEnvVar(name:name) {
raw(_("${name}.blurb"))
}
}
BUILD_NUMBER.blurb=The current build number, such as "153"
BUILD_ID.blurb=The current build id, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)
JOB_NAME.blurb=Name of the project of this build, such as "foo" or "foo/bar"
BUILD_TAG.blurb=String of "jenkins-<i>$'{'JOB_NAME}</i>-<i>$'{'BUILD_NUMBER}</i>". Convenient to put into a resource file, a jar file, etc for easier identification.
EXECUTOR_NUMBER.blurb=\
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.
NODE_NAME.blurb=Name of the slave if the build is on a slave, or "master" if run on master
NODE_LABELS.blurb=Whitespace-separated list of labels that the node is assigned.
WORKSPACE.blurb=The absolute path of the directory assigned to the build as a workspace.
JENKINS_HOME.blurb=The absolute path of the directory assigned on the master node for Jenkins to store data.
JENKINS_URL.blurb=Full URL of Jenkins, like <tt>http://server:port/jenkins/</tt>
BUILD_URL.blurb=Full URL of this build, like <tt>http://server:port/jenkins/job/foo/15/</tt>
JOB_URL.blurb=Full URL of this job, like <tt>http://server:port/jenkins/job/foo/</tt>
BUILD_NUMBER.blurb=Die aktuelle Build-Nummer, z.B. "153".
BUILD_ID.blurb=Die aktuelle Build-ID, z.B. "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss).
JOB_NAME.blurb=Projektname des Builds, z.B. "foo".
BUILD_TAG.blurb=Eine Zeichenkette in der Form "jenkins-<i>$'{'JOB_NAME}</i>-<i>$'{'BUILD_NUMBER}</i>". \
Diese Variable l\u00E4\u00DFt sich sehr bequem zur sp\u00E4teren Identifikation in eine \
Resource-Datei, JAR-Datei usw. ablegen.
EXECUTOR_NUMBER.blurb=Die laufende Nummer des Build-Prozessors, der den aktuellen Build ausf\u00FChrt \
(aus den Build-Prozessoren desselben Rechners). \
Dies ist die Nummer, die Sie auch im Build-Prozessor Status sehen - \
mit der Ausnahme, da\u00DF bei der Umgebungsvariable die Z\u00E4hlung bei 0 und nicht \
bei 1 beginnt.
NODE_NAME.blurb=Name des Build-Slaves, wenn auf einem Build-Slave gebaut wird, oder "master" wenn auf dem Master-Server gebaut wird.
NODE_LABELS.blurb=Durch Leerzeichen getrennte Liste von Labels, die dem Knoten zugeordnet sind.
WORKSPACE.blurb=Der absolute Pfad zum Arbeitsbereich.
JENKINS_HOME.blurb=
JENKINS_URL.blurb=Die absolute URL der Jenkins-Instanz, z.B. <tt>http://server:port/jenkins/</tt>.
BUILD_URL.blurb=Die absolute URL dieses Builds, z.B. <tt>http://server:port/jenkins/job/foo/15/</tt>.
JOB_URL.blurb=Die absolute URL dieses Jobs, z.B. <tt>http://server:port/jenkins/job/foo/</tt>.
BUILD_NUMBER.blurb=Le num\u00E9ro du build courant, par exemple "153"
BUILD_ID.blurb=L'identifiant du build courant, par exemple "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)
JOB_NAME.blurb=Nom du projet de ce build, par exemple "foo"
BUILD_TAG.blurb=Le texte "jenkins-<i>$'{'JOB_NAME}</i>-<i>$'{'BUILD_NUMBER}</i>", facile \u00E0 placer dans \
un fichier de ressource, ou un jar, pour identification future.
EXECUTOR_NUMBER.blurb=Le num\u00E9ro unique qui identifie l'ex\u00E9cuteur courant \
(parmi les ex\u00E9cuteurs d'une m\u00EAme machine) qui a contruit ce build. \
Il s'agit du num\u00E9ro que vous voyez dans le "statut de l'ex\u00E9cuteur du build", \
sauf que la num\u00E9rotation commence \u00E0 0 et non \u00E0 1.
NODE_NAME.blurb=
NODE_LABELS.blurb=
WORKSPACE.blurb=Le chemin absolu vers le r\u00E9pertoire de travail.
JENKINS_HOME.blurb=
JENKINS_URL.blurb=L'URL compl\u00E8te de Jenkins, au format <tt>http://server:port/jenkins/</tt>
BUILD_URL.blurb=
JOB_URL.blurb=
BUILD_NUMBER.blurb=\u5F53\u8A72\u30D3\u30EB\u30C9\u306E\u756A\u53F7\u3002\u4F8B "153"
BUILD_ID.blurb=\u5F53\u8A72\u30D3\u30EB\u30C9ID\u3002\u4F8B "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)
JOB_NAME.blurb=\u30D3\u30EB\u30C9\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D\u3002\u4F8B "foo"
BUILD_TAG.blurb=\u6587\u5B57\u5217 "jenkins-<i>$'{'JOB_NAME}</i>-<i>$'{'BUILD_NUMBER}</i>"\u3002\
\u7C21\u6613\u306A\u8B58\u5225\u5B50\u3068\u3057\u3066\u3001\u30EA\u30BD\u30FC\u30B9\u30D5\u30A1\u30A4\u30EB\u3084jar\u30D5\u30A1\u30A4\u30EB\u306A\u3069\u306B\u4ED8\u4E0E\u3059\u308B\u306E\u306B\u4FBF\u5229\u3067\u3059\u3002
EXECUTOR_NUMBER.blurb=\u3053\u306E\u30D3\u30EB\u30C9\u3092\u5B9F\u884C\u3057\u3066\u3044\u308B\u73FE\u5728\u306E\u30A8\u30B0\u30BC\u30AD\u30E5\u30FC\u30BF\u30FC\u3092\u8B58\u5225\u3059\u308B(\u540C\u4E00\u30DE\u30B7\u30F3\u306E\u4E2D\u3067)\u30E6\u30CB\u30FC\u30AF\u306A\u756A\u53F7\u3002\
"\u30D3\u30EB\u30C9\u5B9F\u884C\u72B6\u614B"\u306B\u8868\u793A\u3055\u308C\u3066\u3044\u308B\u6570\u5B57\u3067\u3059\u304C\u30011\u3067\u306F\u306A\u304F0\u304B\u3089\u59CB\u307E\u308B\u6570\u5B57\u3067\u3059\u3002
NODE_NAME.blurb=\u30D3\u30EB\u30C9\u304C\u5B9F\u884C\u3055\u308C\u308B\u30B9\u30EC\u30FC\u30D6\u306E\u540D\u79F0\u3002\u30DE\u30B9\u30BF\u30FC\u3067\u5B9F\u884C\u3055\u308C\u308B\u5834\u5408\u306F"master"\u3002
NODE_LABELS.blurb=\u30CE\u30FC\u30C9\u306B\u8A2D\u5B9A\u3055\u308C\u305F\u30E9\u30D9\u30EB\u306E\u30EA\u30B9\u30C8\uFF08\u30B9\u30DA\u30FC\u30B9\u533A\u5207\u308A)\u3002
WORKSPACE.blurb=\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306E\u7D76\u5BFE\u30D1\u30B9\u3002
JENKINS_HOME.blurb=
JENKINS_URL.blurb=Jenkins\u306EURL\u3002\u4F8B <tt>http://server:port/jenkins/</tt>
BUILD_URL.blurb=\u3053\u306E\u30D3\u30EB\u30C9\u306EURL\u3002 \u4F8B <tt>http://server:port/jenkins/job/foo/15/</tt>
JOB_URL.blurb=\u3053\u306E\u30B8\u30E7\u30D6\u306EURL\u3002 \u4F8B <tt>http://server:port/jenkins/job/foo/</tt>
BUILD_NUMBER.blurb=Het nummer van de huidige bouwpoging, v.b. "153"
BUILD_ID.blurb=Het identificatienummer van de huidige bouwpoging, v.b. "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)
JOB_NAME.blurb=Naam van het project dat gebouwd wordt door deze bouwpoging, v.b. "foo"
BUILD_TAG.blurb=Het label :"jenkins-<i>$'{'JOB_NAME}</i>-<i>$'{'BUILD_NUMBER}</i>". Dit label is typisch handig om \
ter identificatie op te nemen in een "resource"-bestand, archieven (zoals jar,war,ear,...), ... .
EXECUTOR_NUMBER.blurb=Het unieke nummer, waarmee uw huidige uitvoerder ge\u00EFdentifieerd kan worden op de server. \
Dit is het nummer dat u terugvindt in de "Status uitvoerders"-tabel op de hoofdpagina. \
Merk wel dat in die tabel geteld wordt vanaf 1. Uitvoerder 1 in de "Status uitvoerders"-tabel \
komt dus overeen met een "EXECUTOR_NUMBER" gelijk aan 0.
NODE_NAME.blurb=
NODE_LABELS.blurb=
WORKSPACE.blurb=Het absolute pad naar de werkplaats.
JENKINS_HOME.blurb=
JENKINS_URL.blurb=Volledige URL voor Jenkins, v.b. <tt>http://server:port/jenkins/</tt>
BUILD_URL.blurb=
JOB_URL.blurb=
BUILD_NUMBER.blurb=
BUILD_ID.blurb=
JOB_NAME.blurb=
BUILD_TAG.blurb=
EXECUTOR_NUMBER.blurb=
NODE_NAME.blurb=
NODE_LABELS.blurb=
WORKSPACE.blurb=
JENKINS_HOME.blurb=
JENKINS_URL.blurb=
BUILD_URL.blurb=
JOB_URL.blurb=
<html>
<head>
<title>Available Environmental Variables</title>
<style type="text/css">
dt { font-weight: bold; }
</style>
</head>
<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 "jenkins-<i>${JOB_NAME}</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>NODE_NAME</dt>
<dd>Name of the slave if the build is on a slave, or "master" if run on master</dd>
<dt>NODE_LABELS</dt>
<dd>Whitespace-separated list of labels that the node is assigned.</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>JENKINS_URL</dt>
<dd>Full URL of Jenkins, like <tt>http://server:port/jenkins/</tt></dd>
<dt>BUILD_URL</dt>
<dd>Full URL of this build, like <tt>http://server:port/jenkins/job/foo/15/</tt></dd>
<dt>JOB_URL</dt>
<dd>Full URL of this job, like <tt>http://server:port/jenkins/job/foo/</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 Jenkins 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>
\ No newline at end of file
<html>
<head>
<title>Verfügbare Umgebungsvariablen</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
dt { font-weight: bold; }
</style>
</head>
<body>
Die folgenden Variablen sind innerhalb von Shell-Skripten sichtbar:
<dl>
<dt>BUILD_NUMBER</dt>
<dd>Die aktuelle Build-Nummer, z.B. "153".</dd>
<dt>BUILD_ID</dt>
<dd>Die aktuelle Build-ID, z.B. "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss).</dd>
<dt>JOB_NAME</dt>
<dd>Projektname des Builds, z.B. "foo".</dd>
<dt>BUILD_TAG</dt>
<dd>Eine Zeichenkette in der Form "jenkins-<i>${JOB_NAME}</i>-<i>${BUILD_NUMBER}</i>".
Diese Variable läßt sich sehr bequem zur späteren Identifikation in eine
Resource-Datei, JAR-Datei usw. ablegen.
<dt>EXECUTOR_NUMBER</dt>
<dd>Die laufende Nummer des Build-Prozessors, der den aktuellen Build ausführt
(aus den Build-Prozessoren desselben Rechners).
Dies ist die Nummer, die Sie auch im Build-Prozessor Status sehen -
mit der Ausnahme, daß bei der Umgebungsvariable die Zählung bei 0 und nicht
bei 1 beginnt.</dd>
<dt>NODE_NAME</dt>
<dd>Name des Build-Slaves, wenn auf einem Build-Slave gebaut wird, oder "master" wenn auf dem Master-Server gebaut wird.</dd>
<dt>NODE_LABELS</dt>
<dd>Durch Leerzeichen getrennte Liste von Labels, die dem Knoten zugeordnet sind.</dd>
<dt>JAVA_HOME</dt>
<dd>Falls Ihr Job so konfiguriert ist, daß ein spezielles JDK verwendet werden soll,
wird diese Variable auf den Wert von JAVA_HOME für dieses spezielle JDK
gesetzt. Falls diese Variable gesetzt ist, wird <tt>PATH</tt> ebenfalls so aktualisiert,
daß <tt>$JAVA_HOME/bin</tt> enthalten ist.</dd>
<dt>WORKSPACE</dt>
<dd>Der absolute Pfad zum Arbeitsbereich.</dd>
<dt>HUDSON_URL</dt>
<dd>Die absolute URL der Hudson-Instanz, z.B. <tt>http://server:port/hudson/</tt>.</dd>
<dt>JENKINS_URL</dt>
<dd>Die absolute URL der Jenkins-Instanz, z.B. <tt>http://server:port/jenkins/</tt>.</dd>
<dt>BUILD_URL</dt>
<dd>Die absolute URL dieses Builds, z.B. <tt>http://server:port/jenkins/job/foo/15/</tt>.</dd>
<dt>JOB_URL</dt>
<dd>Die absolute URL dieses Jobs, z.B. <tt>http://server:port/jenkins/job/foo/</tt>.</dd>
<dt>SVN_REVISION</dt>
<dd>Bei Subversion-basierten Projekten enthält diese Variable die Revisionsnummer
des Modules.</dd>
<dt>CVS_BRANCH</dt>
<dd>Bei CVS-basierten Projekten enthält diese Variable den Zweig des Moduls.
Falls CVS so konfiguriert ist, daß der Trunk ausgecheckt wird, wird diese
Variable nicht gesetzt.</dd>
</dl>
<p>
Das folgende Beispiel zeigt, wie von Jenkins bereitgestellte Umgebungsvariablen
in Ant-Skripten verwendet werden können:
<pre><xmp
><target name="printinfo">
<property environment="env" />
<echo message="${env.BUILD_TAG}"/>
</target></xmp></pre>
</body>
</html>
\ No newline at end of file
<html>
<head>
<title>Variables d'environnement disponibles</title>
<style type="text/css">
dt { font-weight: bold; }
</style>
</head>
<body>
Les variables suivantes sont mises à disposition des scripts shell
<dl>
<dt>BUILD_NUMBER</dt>
<dd>Le numéro du build courant, par exemple "153"</dd>
<dt>BUILD_ID</dt>
<dd>L'identifiant du build courant, par exemple "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)</dd>
<dt>JOB_NAME</dt>
<dd>Nom du projet de ce build, par exemple "foo"</dd>
<dt>BUILD_TAG</dt>
<dd>Le texte "jenkins-<i>${JOB_NAME}</i>-<i>${BUILD_NUMBER}</i>", facile à placer dans
un fichier de ressource, ou un jar, pour identification future.</dd>
<dt>EXECUTOR_NUMBER</dt>
<dd>Le numéro unique qui identifie l'exécuteur courant
(parmi les exécuteurs d'une même machine) qui a contruit ce build.
Il s'agit du numéro que vous voyez dans le "statut de l'exécuteur du build",
sauf que la numérotation commence à 0 et non à 1.</dd>
<dt>JAVA_HOME</dt>
<dd>Si votre job est configuré de façon à utiliser un JDK particulier,
cette variable contient la valeur JAVA_HOME du JDK en question.
Quand cette variable est positionnée, la variable <tt>PATH</tt>
est également mise à jour pour inclure <tt>$JAVA_HOME/bin</tt>.</dd>
<dt>WORKSPACE</dt>
<dd>Le chemin absolu vers le répertoire de travail.</dd>
<dt>HUDSON_URL</dt>
<dd>L'URL complète de Hudson, au format <tt>http://server:port/hudson/</tt></dd>
<dt>JENKINS_URL</dt>
<dd>L'URL complète de Jenkins, au format <tt>http://server:port/jenkins/</tt></dd>
<dt>SVN_REVISION</dt>
<dd>Pour les projets utilisant Subversion, cette variable contient le numéro de révision du module.</dd>
<dt>CVS_BRANCH</dt>
<dd>Pour les projets utilisant CVS, cette variable contient la branche du module.
Si CVS est configuré de façon à récupérer la branche principale de développement (trunk),
cette variable d'environnement ne sera pas positionnée.</dd>
</dl>
<p>
Pour comprendre comment les variables d'environnement fournies par Jenkins peuvent être utilisées
par Ant, consultez le résultat de la target Ant suivante:
<pre><xmp
><target name="printinfo">
<property environment="env" />
<echo message="${env.BUILD_TAG}"/>
</target></xmp></pre>
</body>
</html>
\ No newline at end of file
<html>
<head>
<title>利用可能な環境変数</title>
<style type="text/css">
dt { font-weight: bold; }
</style>
</head>
<body>
シェルスクリプトでは、次の変数を利用できます。
<dl>
<dt>BUILD_NUMBER</dt>
<dd>当該ビルドの番号。例 "153"</dd>
<dt>BUILD_ID</dt>
<dd>当該ビルドID。例 "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)</dd>
<dt>JOB_NAME</dt>
<dd>ビルドのプロジェクト名。例 "foo"</dd>
<dt>BUILD_TAG</dt>
<dd>文字列 "jenkins-<i>${JOB_NAME}</i>-<i>${BUILD_NUMBER}</i>"。
簡易な識別子として、リソースファイルやjarファイルなどに付与するのに便利です。</dd>
<dt>EXECUTOR_NUMBER</dt>
<dd>このビルドを実行している現在のエグゼキューターを識別する(同一マシンの中で)ユニークな番号。
"ビルド実行状態"に表示されている数字ですが、1ではなく0から始まる数字です。
<dt>NODE_NAME</dt>
<dd>ビルドが実行されるスレーブの名称。マスターで実行される場合は"master"。</dd>
<dt>NODE_LABELS</dt>
<dd>ノードに設定されたラベルのリスト(スペース区切り)。<dd>
<dt>JAVA_HOME</dt>
<dd>特定のJDKを使用するようにジョブを設定する場合、そのJDKのJAVA_HOMEをこの変数に設定します。
この変数を設定すると、<tt>PATH</tt><tt>$JAVA_HOME/bin</tt>が追加されます。</dd>
<dt>WORKSPACE</dt>
<dd>ワークスペースの絶対パス。</dd>
<dt>HUDSON_URL</dt>
<dd>HudsonのURL。例 <tt>http://server:port/hudson/</tt></dd>
<dt>JENKINS_URL</dt>
<dd>JenkinsのURL。例 <tt>http://server:port/jenkins/</tt></dd>
<dt>BUILD_URL</dt>
<dd>このビルドのURL。 例 <tt>http://server:port/jenkins/job/foo/15/</tt></dd>
<dt>JOB_URL</dt>
<dd>このジョブのURL。 例 <tt>http://server:port/jenkins/job/foo/</tt></dd>
<dt>SVN_REVISION</dt>
<dd>Subversionを使用するプロジェクトにおける、モジュールのリビジョン番号。</dd>
<dt>CVS_BRANCH</dt>
<dd>CVSを使用するプロジェクトにおける、モジュールのブランチ。
CVSがトランクをチェックアウトする場合は設定されません。</dd>
</dl>
<p>
Jenkinsが提供する環境変数のAntでの利用方法については、
次のtargetを参考にしてください。
<pre><xmp
><target name="printinfo">
<property environment="env" />
<echo message="${env.BUILD_TAG}"/>
</target></xmp></pre>
</body>
</html>
<html>
<head>
<title>Beschikbare omgevingsparameters</title>
<style type="text/css">
dt { font-weight: bold; }
</style>
</head>
<body>
Volgende parameters zijn beschikbaar voor gebruik in uw scripts:
<dl>
<dt>BUILD_NUMBER</dt>
<dd>Het nummer van de huidige bouwpoging, v.b. "153"</dd>
<dt>BUILD_ID</dt>
<dd>Het identificatienummer van de huidige bouwpoging, v.b. "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)</dd>
<dt>JOB_NAME</dt>
<dd>Naam van het project dat gebouwd wordt door deze bouwpoging, v.b. "foo"</dd>
<dt>BUILD_TAG</dt>
<dd>Het label :"jenkins-<i>${JOB_NAME}</i>-<i>${BUILD_NUMBER}</i>". Dit label is typisch handig om
ter identificatie op te nemen in een "resource"-bestand, archieven (zoals jar,war,ear,...), ... .
</dd>
<dt>EXECUTOR_NUMBER</dt>
<dd>Het unieke nummer, waarmee uw huidige uitvoerder geïdentifieerd kan worden op de server.
Dit is het nummer dat u terugvindt in de "Status uitvoerders"-tabel op de hoofdpagina.
Merk wel dat in die tabel geteld wordt vanaf 1. Uitvoerder 1 in de "Status uitvoerders"-tabel
komt dus overeen met een "EXECUTOR_NUMBER" gelijk aan 0.
</dd>
<dt>JAVA_HOME</dt>
<dd>Indien uw job geconfigureerd werd om een specifieke JDK te gebruiken, bevat deze
parameter de JAVA_HOME informatie van de specifieke JDK. Indien deze parameter
ingesteld wordt, wordt uw <tt>PATH</tt> eveneens aangepast om <tt>$JAVA_HOME/bin</tt>
te bevatten.</dd>
<dt>WORKSPACE</dt>
<dd>Het absolute pad naar de werkplaats.</dd>
<dt>HUDSON_URL</dt>
<dd>Volledige URL voor Hudson, v.b. <tt>http://server:port/hudson/</tt></dd>
<dt>JENKINS_URL</dt>
<dd>Volledige URL voor Jenkins, v.b. <tt>http://server:port/jenkins/</tt></dd>
<dt>SVN_REVISION</dt>
<dd>Voor Suversion gebaseerde projecten, bevat deze parameter het versienummer van de module.</dd>
<dt>CVS_BRANCH</dt>
<dd>Voor CVS gebaseerde projecten, bevat deze parameter de tak van de module.
Indien CVS geconfigureerd werd om de code op te halen vanaf de stam van uw versiecontroleboom,
zal deze parameter niet ingesteld worden.</dd>
</dl>
<p>
Om beter te begrijpen hoe de beschikbare omgevingsparameters gebruikt kunnen worden
door Ant, kunt u volgend voorbeeld bekijken:
<pre><xmp
><target name="printinfo">
<property environment="env" />
<echo message="${env.BUILD_TAG}"/>
</target></xmp></pre>
</body>
</html>
\ No newline at end of file
<html>
<head>
<title>Available Environmental Variables</title>
<style type="text/css">
dt { font-weight: bold; }
</style>
</head>
<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 "jenkins-<i>${JOB_NAME}</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>JENKINS_URL</dt>
<dd>Full URL of Jenkins, like <tt>http://server:port/jenkins/</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 Jenkins 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>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册