因此,我的源代码控制中有一个version.txt文件。我在master和build上签出它,并通过文件路径为$WORKSPACE/Version.txt的文件设置环境变量
在主服务器上,它正确地找到Version.txt并设置MAJOR=x等。
当我在从节点上执行相同的构建时,使用相同的配置,我总是得到一个
[envfile] Reading environment variables from file.
[envfile] Path to file: /var/hudson/workspace/DEV_BUILD/Version.txt
[envfile] Can not find environment file. Path to file=[/var/hudson/workspace/DEV_BUILD/Version.txt]但我之前看到的是:
Building remotely on cent5.5_64
Cleaning the workspace because project is configured to clean the workspace before each build.
server: 192.168.1.207
[UGCS_DEV_BUILD] $ sscm get / -wreplace  -d/var/hudson/workspace/DEV_BUILD -r从main/DEV获取:
/var/hudson/workspace/DEV_BUILD/Version.txt我猜$WORKSPACE指的是主人?有没有人知道如何在Slave上工作?
发布于 2012-08-20 19:27:38
看起来EnvFile插件不能与slaves一起工作:https://issues.jenkins-ci.org/browse/JENKINS-9546
此外,根据本JIRA中的评论,他们建议使用EnvInject插件:https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
致以敬意,
https://stackoverflow.com/questions/11996079
复制相似问题