所以我的源代码管理中有一个version.txt
文件。我在master和build上检查它,并通过文件路径为的文件设置环境变量
$WORKSPACE/Version.txt
在master上它正确找到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上工作?
答案 0 :(得分:3)
似乎EnvFile插件不适用于奴隶: https://issues.jenkins-ci.org/browse/JENKINS-9546
此外,根据此JIRA中的评论,他们建议使用EnvInject
插件:https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
此致