【问题标题】:Hudson/Jenkins $WORKSPACE variable not working on nodeHudson/Jenkins $WORKSPACE 变量在节点上不起作用
【发布时间】:2012-08-13 07:53:31
【问题描述】:

所以我的源代码管理中有一个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指的是主人?任何人都知道如何让它在奴隶上工作?

【问题讨论】:

    标签: hudson jenkins environment-variables workspace slave


    【解决方案1】:

    EnvFile 插件似乎不适用于从属: https://issues.jenkins-ci.org/browse/JENKINS-9546

    此外,来自此 JIRA 中的 cmets,他们建议使用 EnvInject 插件:https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin

    问候,

    【讨论】:

      猜你喜欢
      • 2018-07-30
      • 1970-01-01
      • 2015-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多