简体   繁体   English

詹金斯和路径

[英]Jenkins and PATH

I am using Jenkins and it runs a script that uses AWS command line tools. 我正在使用Jenkins,它运行的脚本使用AWS命令行工具。 Because Jenkins doesn't use a shell like a normal user, it will fail saying "EC2_HOME" not set. 因为Jenkins不像普通用户那样使用shell,所以说“ EC2_HOME”未设置将失败。 Now I know how to set this for a regular user but not for Jenkins. 现在,我知道如何为普通用户设置此设置,而不是为Jenkins设置。 Currently I have the EC2_HOME and keys exporting in my script that Jenkins uses but I don't feel comfortable having that info in my script. 目前,我在Jenkins使用的脚本中具有EC2_HOME和密钥导出功能,但是我不满意在脚本中包含该信息。

How/where can I edit Jenkin's PATH to use the EC2 tools? 如何/在何处编辑Jenkin的PATH以使用EC2工具? I already edited /etc/profile. 我已经编辑了/ etc / profile。 This was working until the server rebooted recently. 这一直有效,直到服务器最近重新启动为止。

You should use Injecting Environment variable, so you can set up all env related variables and consisting across job 您应该使用Injecting Environment变量,以便可以设置所有与env相关的变量,并在整个作业中

See more here at plugin doc: https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin 在插件文档中查看更多信息: https : //wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin

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

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