Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Environment variable to Hudson

Tags:

hudson

I am looking into a way of defining an environment variable for Hudson (NCover path on build server), so that build scripts can use it, but no need to re-define it in Hudson jobs (similar to %SVN_REVISION% or %BUILD_NUMBER%). What would be the way of doing it? Thank you.

like image 369
Sean Feldman Avatar asked Jan 28 '10 06:01

Sean Feldman


People also ask

How do I add a global variable in Jenkins?

We can set global properties by navigating to “Manage Jenkins -> Configure System -> Global properties option”.

How do you assign a value to a variable in Jenkins pipeline?

Jenkins pipeline assign a value to a variable In the Jenkins pipeline, we can assign the value to a variable by passing the variable name and its corresponding value in theenvironment declaration block.

How do I set environment variable in Jenkins pipeline stage?

Setting Stage Level Environment Variable It is by using the env variable directly in the script block. We can define, let us say, USER_GROUP and display it. You will see that the underlying shell also has access to this environment variable. You can also set an environment variable using withEnv block.


1 Answers

You can set node variables, that will be available to every job that runs on that node. Go to the node configuration page, and you'll see it. For the master node, the environment variables are configured on Hudson's main configuration screen.

like image 131
Michael Donohue Avatar answered Sep 28 '22 09:09

Michael Donohue