Vipin, Go's execution system doesn't behave like a shell to keep context across tasks. The only state that's available in a job across tasks is the files you create in the current working directory of the agent and nothing else. So the right way to handle this would be to put all the commands in a shell script (build.sh) and run that script via the task as "bash build.sh".
Hope this helps. On Thu, Apr 27, 2017 at 4:16 AM, Vipin <[email protected]> wrote: > Hi Everyone, > > I am using custom command "cd" . but it is not working.Though pwd command > is working fine .can any one please help. > > 08:19:20.046 [go] Start to execute task: <exec command="/bin/sh" > > <arg>-c</arg> > <arg>pwd</arg> > </exec>. > 08:19:20.047 /var/lib/go-agent/pipelines/salesorder > 08:19:20.147 [go] Current job status: passed. > > 08:19:20.148 [go] Start to execute task: <exec command="/bin/sh" > > <arg>-c</arg> > <arg>cd LPG</arg> > </exec>. > 08:19:20.149 [go] Current job status: passed. > > 08:19:20.149 [go] Start to execute task: <exec command="/bin/sh" > > <arg>-c</arg> > <arg>pwd</arg> > </exec>. > 08:19:20.150 /var/lib/go-agent/pipelines/salesorder > 08:19:20.251 [go] Current job status: passed. > > 08:19:20.251 [go] Start to execute task: <exec command="mvn" > > <arg>clean</arg> > <arg>deploy</arg> > <arg>-Dbuild.number=${GO_PIPELINE_LABEL}</arg> > <arg>--batch-mode</arg> > > > i also tried using "/bin/bash" in command and full path as well in cd > command .but it is not working. any help.. > > Regards, > Vipin > > -- > You received this message because you are subscribed to the Google Groups > "go-cd" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Ashwanth Kumar / ashwanthkumar.in -- You received this message because you are subscribed to the Google Groups "go-cd" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
