Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (29.3k points)

I want to use the same job in a different machine. But I don't want to change the configuration of the job each time. Can I pass the machine name label as a parameter and run the job in a different machine? (Not simultaneously).

I want to pass parameters while running a job to the script which I have written in the configuration (batch script). Can we do that?

Can I get a return value from a job and use it in the next job?

1 Answer

0 votes
by (19.4k points)

Yes, you can pass a node label parameter with NodeLabel Parameter Plugin.

Yes, you can define parameters, as described, in Parameterized Builds and then use it in your script as an environment variable:

The parameter is available as environment parameters. So e.g. a shell ($FOO, %FOO%) or Ant ( ${env.FOO} ) can access these values.

It is not exactly a return value, but you can pass any parameter to the downstream job with Parameterized Trigger Plugin.

Browse Categories

...