Hi Aravind,

Thanks for your input, because of it I managed to solve my problem. The bat
file was not in the correct path.
In other words I did not explicitly tell gocd where to find the bat file.
The following fixed that issue for me:
Command:   cd
Arg:              /d D:\path\to\bat\file && cmd /c start_docker.bat

Perhaps not the most elegant, but it works.

I only recently started using GOCD and glanced over the jobs documentation,
something I missed was that changing the directory in a previous task
within a job does not "carry over" to the next
task. I will look into the documentation on environment variables
<https://docs.gocd.org/current/faq/dev_use_current_revision_in_build.html>
to perform this task more neatly.

Kind regards



On Tue, Oct 27, 2020 at 6:48 PM Andy Bergh <[email protected]> wrote:

> Great information thank you Aravind!
>
> Your confirmation of the cmd /c is very helpful. I have tried including
> the (static) path within the command, which worked in the terminal itself,
> but "hanged" when the job/command was run in the pipe. I was not using the
> environment variable PATH.
>
> As an aside, I am not able to see the output of the start_docker.bat file.
> Even if the bat file simply contains "echo 'Hello World'".
>
> It is evening here but I will certainly look into your PATH suggestion as
> soon as I can and update this forum if I make any useful findings.
>
> Again, thank you for your suggestions and input.
>
> Kind regards
>
> On Tue, Oct 27, 2020 at 6:15 PM Aravind SV <[email protected]>
> wrote:
>
>> Hello Andy,
>>
>> I’m not sure.
>>
>> On Windows, GoCD should be running eveything with cmd /c
>> <https://github.com/gocd/gocd/blob/fa1c20b7450a60af1434b0dcb4f473f6fa14ff18/common/src/main/java/com/thoughtworks/go/domain/builder/CommandBuilder.java#L44-L48>.
>> So, you shouldn’t have to do anything except use start_docker.bat. Maybe
>> it’s a PATH issue which is preventing you from using that?
>>
>> Might be worth trying to use the whole path to start_docker.bat and
>> checking. If it “hangs” as in when you used start /k etc, it usually
>> means that a child process is keeping the standard output open and not
>> exiting. You could try adding a message before the exit, to see if it
>> reached there (it likely will).
>>
>> If none of those work, someone with a Windows setup might need to help /
>> might have more ideas.
>>
>> Cheers,
>> Aravind
>>
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/CAAmck7WmRfjR0X8NpFNt_ZtUi%3DWq29o4eQh087BjXkKvjsNrfQ%40mail.gmail.com.

Reply via email to