0

我从 ThoughtWorks 在 Go 中创建了一个失败的管道。错误消息是关于在 PATH 中找不到 ant。我已经定义了一个环境,我在其中覆盖了 PATH 变量,但这似乎不起作用。

源代码:https ://github.com/aavella77/junit-sample.git

我可以从终端使用 ant 进行编译。不确定如何使用 Go 设置 PATH。有什么建议么?

[go] Start to prepare junit-sample-Pipeline/25/defaultStage/1/defaultJob on AAVELLA-M-G0AM [/Applications/Go Agent.app] at Sun Jan 25 22:13:16 PST 2015

[go] Start updating files at revision bae3528396b34f842ebe495fefd9f3a37dfb5f6d from https://github.com/aavella77/junit-sample.git
[GIT] Fetch and reset in working directory pipelines/junit-sample-Pipeline
[GIT] Cleaning all unversioned files in working copy
[GIT] Cleaning submodule configurations in .git/config
[GIT] Fetching changes
[GIT] Performing git gc
[GIT] Updating working copy to revision bae3528396b34f842ebe495fefd9f3a37dfb5f6d
HEAD is now at bae3528 Create build.xml
[GIT] Removing modified files in submodules
[GIT] Cleaning all unversioned files in working copy

[go] Start to build junit-sample-Pipeline/25/defaultStage/1/defaultJob on AAVELLA-M-G0AM [/Applications/Go Agent.app] at Sun Jan 25 22:13:17 PST 2015

[go] Current job status: passed.

[go] Start to execute task: <ant buildfile="build.xml" />. 
[go] setting environment variable 'GO_ENVIRONMENT_NAME' to value 'Production'
[go] overriding environment variable 'PATH' with value '/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin/ant/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/bin/ant/bin'
[go] setting environment variable 'GO_SERVER_URL' to value 'https://127.0.0.1:8154/go/'
[go] setting environment variable 'GO_TRIGGER_USER' to value 'anonymous'
[go] setting environment variable 'GO_PIPELINE_NAME' to value 'junit-sample-Pipeline'
[go] setting environment variable 'GO_PIPELINE_COUNTER' to value '25'
[go] setting environment variable 'GO_PIPELINE_LABEL' to value '25'
[go] setting environment variable 'GO_STAGE_NAME' to value 'defaultStage'
[go] setting environment variable 'GO_STAGE_COUNTER' to value '1'
[go] setting environment variable 'GO_JOB_NAME' to value 'defaultJob'
[go] setting environment variable 'GO_REVISION' to value 'bae3528396b34f842ebe495fefd9f3a37dfb5f6d'
[go] setting environment variable 'GO_TO_REVISION' to value 'bae3528396b34f842ebe495fefd9f3a37dfb5f6d'
[go] setting environment variable 'GO_FROM_REVISION' to value 'bae3528396b34f842ebe495fefd9f3a37dfb5f6d'
[go] setting environment variable 'JUNIT_HOME' to value '/Library/JUNIT'
[go] setting environment variable 'CLASSPATH' to value '$CLASSPATH:/Library/JUNIT/junit-4.10.jar:.'
[go] setting environment variable 'ANT_HOME' to value '/usr/bin/ant/bin'
Error happened while attempting to execute 'ant -f build.xml'. 
Please make sure [ant] can be executed on this agent.

[Debug Information] Environment variable PATH: /usr/bin:/bin:/usr/sbin:/sbin

[go] Start to create properties junit-sample-Pipeline/25/defaultStage/1/defaultJob on AAVELLA-M-G0AM [/Applications/Go Agent.app] at Sun Jan 25 22:13:18 PST 2015

[go] Start to upload junit-sample-Pipeline/25/defaultStage/1/defaultJob on AAVELLA-M-G0AM [/Applications/Go Agent.app] at Sun Jan 25 22:13:18 PST 2015

[go] Job completed junit-sample-Pipeline/25/defaultStage/1/defaultJob on AAVELLA-M-G0AM [/Applications/Go Agent.app] at Sun Jan 25 22:13:18 PST 2015

提前致谢,

4

1 回答 1

0

OSX 代理上的 $PATH 设置存在问题。您可以找到详细信息以及此处记录的解决方案。

https://github.com/gocd/gocd/issues/852

于 2015-02-23T11:31:04.360 回答