简体   繁体   English

Jenkins配置作业以抛出参数

[英]Jenkins configure jobs to throw parameter

I have got three jobs. 我有三份工作。

  1. (on Master) will prepare environment and start VM, (在Master上)将准备环境并启动VM,
  2. (on VM) have to catch the name of started VM and run tests, (在VM上)必须捕获已启动的VM的名称并运行测试,
  3. (on Master) will revert to snapshot and shut down the VM. (在主服务器上)将还原为快照并关闭VM。

How can i throw the variable wit VM name. 我如何抛出变量和虚拟机名称。 My scripts is on bash 我的剧本很流行

You can use Parameterized Trigger Plugin . 您可以使用参数化触发器插件

On master, I assume the job that starts the VM knows the VM name. 在主服务器上,我假设启动VM的作业知道VM名称。 On the same master job, setup a build step, post-build step, or automatic promotion (my preferred way) to Call/Trigger Parameterized Build (will be available after you install that plugin). 在同一主作业上,设置构建步骤,构建后步骤或自动升级(我的首选方式)以调用/触发参数化构建 (在安装该插件后可用)。 In configuration for that step, you have an option to pass any number of parameters to the called job. 在该步骤的配置中,您可以选择将任意数量的参数传递给被调用的作业。

As for #3, since your job on the VM now has the VM name parameter, it can then further pass it to your third job (to revert snapshot and shut down) using the same plugin. 至于#3,由于您在VM上的作业现在具有VM name参数,因此它可以使用相同的插件将其进一步传递给您的第三个作业(还原快照并关闭)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM