go-cd pipeline cannot execute custom command

1.9k views Asked by At

I have ubuntu and go-agent/server on it, I have defined task:

<exec command="/bin/sh" >
<arg>-c</arg>
<arg>sbt test</arg>
</exec>

Sbt is available from terminal, so I easily can run this commands from terminal:

sbt test

and

/bin/sh -c 'sbt test'

but when I run the pipeline, I got an error:

[go] Start to execute task: <exec command="/bin/sh" >
<arg>-c</arg>
<arg>sbt test</arg>
</exec>. 
[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 'poll-app'
[go] setting environment variable 'GO_PIPELINE_COUNTER' to value '60'
[go] setting environment variable 'GO_PIPELINE_LABEL' to value 'poll-app.1.0.60'
[go] setting environment variable 'GO_STAGE_NAME' to value 'build-test-stage'
[go] setting environment variable 'GO_STAGE_COUNTER' to value '1'
[go] setting environment variable 'GO_JOB_NAME' to value 'build-test-job'
[go] setting environment variable 'GO_REVISION_POLL_APP_GIT' to value '13b313a2ed32f260ebfecfb18e34ac10123353bf'
[go] setting environment variable 'GO_TO_REVISION_POLL_APP_GIT' to value '13b313a2ed32f260ebfecfb18e34ac10123353bf'
[go] setting environment variable 'GO_FROM_REVISION_POLL_APP_GIT' to value '13b313a2ed32f260ebfecfb18e34ac10123353bf'
[go] overriding environment variable 'PATH' with value '$PATH:/var/lib/go-agent/pipelines/poll-app'
/bin/sh: 1: sbt: not found

What could be a problem?

1

There are 1 answers

0
janis.kom On BEST ANSWER

Problem was about the PATH, I should not to override it in pipeline configuration.