简体   繁体   English

Jenkins的EnvInject插件不保留值

[英]Jenkins' EnvInject Plugin does not persist values

I have a build that uses EnvInject Plugin to set an environmental value. 我有一个使用EnvInject插件来设置环境值的版本。 A different job needs to scan last good Jenkins build of that job and get the value of that environmental variable. 一项不同的工作需要扫描该工作的最后一份詹金斯模型,并获取该环境变量的值。

This all works well, except sometimes the variable will disappear from build history. 这一切都很好,除了有时变量将从构建历史记录中消失。 It seems that after some time passes, when I look at the 'Environment variables' section in build history, the injected value simply disappears. 似乎经过一段时间,当我查看构建历史记录中的“环境变量”部分时,注入的值只是消失了。

How can I make this persist? 我该如何保持下去? Is this a bug, or part of the design? 这是错误还是设计的一部分?

If it make any difference, the value of the injected variable is +1500 chars and in the following format: 'component1=1.1.2;component2=1.1.3,component3=4.1.2,component4=1.1.1,component4=1.3.2,component4=1.1.4' 如果有任何区别,则注入的变量的值为+1500个字符,并采用以下格式:'component1 = 1.1.2; component2 = 1.1.3,component3 = 4.1.2,component4 = 1.1.1,component4 = 1.3 .2,component4 = 1.1.4'

Looks like EnvInject and/or JobDSL have a bug. 看起来EnvInject和/或JobDSL有错误。

Steps to reproduce: 重现步骤:

  1. Set up a job that runs this JobDSL: 设置运行此JobDSL的作业:

    job('run_deploy_mock') { steps { environmentVariables { env('deployedArtifacts', 'component1=1.0.0.2') } } }

  2. Run it and it will create a job called 'deploy_mock' 运行它,它将创建一个名为“ deploy_mock”的作业

  3. Run the 'deploy_mock' job. 运行“ deploy_mock”作业。 After build #1 is done, go to build details and check 'Environmental Variables' section for an entry called 'component1' 在完成构建#1之后,转到构建详细信息并检查“环境变量”部分中是否存在名为“ component1”的条目。
  4. Run the JobDSL job again 再次运行JobDSL作业
  5. Check 'Environmental Variables' section for 'deploy_mock' build #1. 检查“环境变量”部分中的“ deploy_mock”内部版本1。 The 'component1' variable is now missing. 现在缺少“ component1”变量。

If I substitute the '=' for something else, it works as expected. 如果我用'='代替其他东西,它将按预期工作。

Created Jenkins Jira 创建詹金斯· 吉拉( Jenkins Jira)

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

相关问题 会话变量不持久 - Session variable does not persist Jenkins 插件 - 环境变量 - Jenkins plugin - environment variables 为什么我的函数范围 static 变量在 object 实例之间持续存在? - Why does my function-scoped static variable persist between object instances? jQuery插件更改静态变量的值 - jQuery plugin change values of static variables vim:在哪里放置插件变量的默认值? - vim: where to put default values for plugin variables? Jenkins:使用文件操作插件中的当前分支复制到动态目标位置 - Jenkins: Copy to a dynamic target location using the current branch in the file operations plugin jenkins 上 windows。 声明性管道 jenkinsfile。 如何设置和获取正确的变量值 - jenkins on windows. Declarative pipeline jenkinsfile. how to set and get correct variable values 作为映射的 Ansible 变量文件不考虑参数化值 - Ansible variables file as map does not consider parameterized values 我在 while 循环中使用函数的程序不保留更新的值 - My program that uses functions in a while loop does not keep updated values 如何将jQuery“ fancybox”插件值放在array \\ variable中,并在以后使用javascript使用它? - How to put jQuery “fancybox” plugin values in array\variable and use it later using javascript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM