How to inject environment variables from Groovy script in Jenkins piplenine

Viewed 398

I need to migrate the freestyle project to the Jenkins pipeline. Any idea how to implement environment variable injection with groovy script to declarative pipeline?

I need pipeline code for this:

enter image description here

1 Answers

you can try add your groovy script into environment

environment {

 if() {
   env.xxx=yyy  // xxx is the name of environment variable
 }

}
Related