DenCowboy
DenCowboy

Reputation: 15076

Jenkins: plugin to set environment variable on parameter choice

I'm using the Active Choice plugin. I can choose between param1 or param2.

This is fine. I can use param1 inside my job and it will do the stuff for param1 and vice versa. But now my job is expanding and I have to use multiple environment variables. Is there a plugin which is giving me the following choice:

IF choosing param1 THEN SET env variables env1=hello else env1=hi.

So I have to set environment variables which are dependent on the choice of my parameter in the beginning. I now I'm able to script it in shell or write a shell script for the run condition plugin but I'd like to avoid this.

Is there a good plugin for this scenario in jenkins?

Upvotes: 3

Views: 1003

Answers (1)

Andrew Gray
Andrew Gray

Reputation: 3661

The Env Inject plugin will allow you to do this.

Upvotes: 0

Related Questions