From 409beb6cb9abc1cf4a679661fd12889dbaad5335 Mon Sep 17 00:00:00 2001
From: Jesse Glick
Date: Fri, 27 Mar 2015 17:36:34 -0400
Subject: [PATCH] Starting to document withEnv.
---
TUTORIAL.md | 1 +
.../plugins/workflow/steps/EnvStep/help.html | 37 +++++++++++++++++++
.../cps/CpsFlowDefinition/help-script.html | 36 ------------------
3 files changed, 38 insertions(+), 36 deletions(-)
create mode 100644 basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/EnvStep/help.html
diff --git a/TUTORIAL.md b/TUTORIAL.md
index 151bb1202..6be3da4b8 100644
--- a/TUTORIAL.md
+++ b/TUTORIAL.md
@@ -563,6 +563,7 @@ env.PATH = "${mvnHome}/bin:${env.PATH}"
```
since environment variable overrides are currently limited to being global to a workflow run, not local to the current thread (and thus slave).
+You could however use the `withEnv` step (TODO details).
You may also have noticed that we are running `JUnitResultArchiver` several times, something that is not possible in a freestyle project.
The test results recorded in the build are cumulative.
diff --git a/basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/EnvStep/help.html b/basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/EnvStep/help.html
new file mode 100644
index 000000000..9ea969b81
--- /dev/null
+++ b/basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/EnvStep/help.html
@@ -0,0 +1,37 @@
+
+Sets one or more environment variables within a block.
+This is a more robust way of setting variables than setting values of
env.NAME
.
+
A set of environment variables are made available to all Jenkins Job types, including Workflow Jobs.
+The following is a general list of variables (by name) that are available to all Job types. See the notes
+below the list for Workflow specific details.
+
+
+
+
+
+The following variables are currently unavailable inside a workflow script:
+
+ - EXECUTOR_NUMBER
+ - NODE_NAME
+ - NODE_LABELS
+ - WORKSPACE
+
+
+
Using Environment Variables
+
+Environment variables are injected into scripts through a variable named "
env". This variable,
+like any other variable, can be used in the general flow of the script, or in variable substitutions e.g. when
+constructing email content when using the
mail
step:
+
+
+
+ mail (to: 'devops@acme.com',
+ subject: "Job '${env.JOB_NAME}' (${env.BUILD_NUMBER}) is waiting for input",
+ body: "Please go to ${env.BUILD_URL} and verify the build");
+
+
+
+For more on environment variables,
+
see
+here.
+
diff --git a/cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html b/cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html
index b86157e97..fac1e4c20 100644
--- a/cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html
+++ b/cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html
@@ -24,42 +24,6 @@
stage name: 'Build', concurrency: 1
-Environment Variables
-
-A set of environment variables are made available to all Jenkins Job types, including Workflow Jobs.
-The following is a general list of variables (by name) that are available to all Job types. See the notes
-below the list for Workflow specific details.
-
-
-
-
-
-The following variables are currently unavailable inside a workflow script:
-
- - EXECUTOR_NUMBER
- - NODE_NAME
- - NODE_LABELS
- - WORKSPACE
-
-
-Using Environment Variables
-
-Environment variables are injected into scripts through a variable named "env". This variable,
-like any other variable, can be used in the general flow of the script, or in variable substitutions e.g. when
-constructing email content when using the mail
step:
-
-
-
- mail (to: 'devops@acme.com',
- subject: "Job '${env.JOB_NAME}' (${env.BUILD_NUMBER}) is waiting for input",
- body: "Please go to ${env.BUILD_URL} and verify the build");
-
-
-
-For more on environment variables,
-see
-here.
-
Current build
The currentBuild
variable may be used to refer to the currently running build.