How can I create parameterized Jenkins job?

前端 未结 3 1433
眼角桃花
眼角桃花 2020-12-16 23:01

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

3条回答
  •  忘掉有多难
    2020-12-16 23:16

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

    2. 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.

    1. This is not exactly a return value, but you can pass any parameter (with its value) to the downstream job with Parameterized Trigger Plugin.

提交回复
热议问题