简体   繁体   English

从詹金斯的自由式作业下游管道作业传递值

[英]Pass values from a freestyle job downstream pipeline job in jenkins

On Jenkins, I have a freestyle job which takes user input (release branch and environment to deploy). 在Jenkins上,我有一个自由式工作,需要用户输入(发布分支和要部署的环境)。 I want to use these values in pipeline job. 我想在管道作业中使用这些值。 I tried to export the user input to a file, read the file, set the values as environment variables, tried to print in the pipeline job. 我尝试将用户输入导出到文件,读取文件,将值设置为环境变量,尝试在管道作业中打印。 This doesn't seem to work for me. 这似乎对我不起作用。 Any inputs are appreciated? 任何输入表示赞赏?

There is an issue in later versions of Jenkins JENKINS-SECURITY-170 that prevents passing environment variables (or more precisely any arbitrary build parameters) between consecutive jobs in pipeline. 詹金斯JENKINS-SECURITY-170的更高版本中存在一个问题,该问题阻止在管道中的连续作业之间传递环境变量(或更准确地说,是任意构建参数)。 The workaround is to start Jenkins instance with system property hudson.model.ParametersAction.keepUndefinedParameters set to true 解决方法是使用系统属性hudson.model.ParametersAction.keepUndefinedParameters设置为true启动Jenkins实例

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

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