简体   繁体   English

jenkins管道工作的“环境变量”视图

[英]“Environment Variables” view for jenkins pipeline job

For freestyle job I used to have "environment variable" view that allowed me to view all the variables that were available during runtime of the build. 对于自由式作业,我曾经有过“环境变量”视图,它允许我查看构建运行时期间可用的所有变量。

What is the equivalent for pipeline job? 管道工作的等价物是什么?

Add this code in your pipeline to view variables at runtime 在管道中添加此代码以在运行时查看变量

  • For linux 对于Linux

      sh 'env > env.txt' for (String i : readFile('env.txt').split("\\r?\\n")) { println i } 
  • For windows 对于窗户

     bat 'set > env.txt' for (String i : readFile('env.txt').split("\\r?\\n")) { println i } 

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

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