简体   繁体   English

Jenkins-在多配置参数化作业中将主站传输到从站参数

[英]Jenkins - transfer master to slave parameter in multi-configuration parameterized job

I want to configure Jenkins as follows 我想按以下方式配置Jenkins

  • a master (Linux) 大师(Linux)
  • a slave (Windows) 奴隶(Windows)
  • a multi-configuration job that runs on both platforms 在两个平台上运行的多配置作业
    • the job has a parameter VERSION, that is used to create the final archive, if compilation and testing are successful 作业具有参数VERSION,如果编译和测试成功,则该参数用于创建最终存档

I face the following problem. 我面临以下问题。 On the master, the compilation script finds the VERSION variable and everything runs fine. 在主服务器上,编译脚本找到VERSION变量,一切运行正常。 On the slave, the VERSION variable does not exist and the script fails. 在从属服务器上,VERSION变量不存在,脚本失败。 I run a python script and I get variables through the os.environ(), but the problem is that the VERSION variable does not seem to be transferred from the master environment to the slave. 我运行python脚本,并通过os.environ()获取变量,但是问题是VERSION变量似乎没有从主环境转移到从环境。 In fact, also a "set" command with a shell shows that the variable does not exist under Windows slave. 实际上,带有外壳程序的“ set”命令也表明该变量在Windows从站下不存在。

I found some hints that Jenkins EnvInject plugin should solve my problems. 我发现Jenkins EnvInject插件应该可以解决我的问题。 However, I did not manage to configure it properly. 但是,我没有设法正确配置它。

May you help me? 你能帮我吗?

Thanks in advance! 提前致谢!

Maybe you can try the Parameterized Trigger Plugin to transport parameters between your projects. 也许您可以尝试使用参数化触发器插件在项目之间传输参数。 But I am not sure that works or not under your enviroment. 但是我不确定在您的环境下该方法是否可行。

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

相关问题 Jenkins Python API和多配置项目 - Jenkins Python API and Multi-Configuration Projects Jenkins主/从Windows - Jenkins Master/Slave Windows 传递给jenkins作业的参数不会在从属计算机上更新 - Parameters passed to jenkins job are not updated on slave machine 如何在多项目/多配置设置中使用Tensorflow的`file_io`? - How to use Tensorflow's `file_io` in multi-project/multi-configuration setting? 如何使用Jenkins API创建参数化作业 - How to create a parameterized job with Jenkins api 将参数化的构建参数传递给Jenkins中的Jython插件 - Passing parameterized build parameter to Jython plugin in Jenkins Jenkins-以作业名称为参数的构建触发链 - Jenkins - trigger chain of builds with job names as parameter 使用扩展选择参数自动化 Jenkins 作业 - Automating Jenkins Job with extended choice parameter 当我在Jenkins中使用Jenkinsbuild文件运行Shell脚本时,它是在主服务器还是从服务器上执行的? - When I use a Jenkinsbuild file in Jenkins to run a shell script, does it execute on master or slave? 如何在python中将jenkins作业配置config.xml转换为YAML格式以使用jenkins-job-builder? - How to convert jenkins job configuration config.xml to YAML format in python to be used jenkins-job-builder?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM