Hi Joel,

There is no way that I know of to specify a particular interpreter for GoCD 
Tasks but it isn't something I have ever looked into so it might be 
possible.

You are correct that each Task needs to explicitly invoke the child shell 
of choice. We use PowerShell rather than MSYS2 bash, but I suspect many of 
the concepts are the same.

The way we avoid having to do that for every command is with PowerShell 
scripts that we store in source control. Instead of having each command 
explicitly called from its own GoCD Task, a single GoCD Task launches a 
PowerShell script that does any number of things. This is nice because it 
eliminates a lot of otherwise redundant configuration in GoCD (how many 
times do I really want to type "powershell.exe -NonInteractive" into 
GoCD?). It also creates a reasonable boundary between our build/deploy 
processes (the scripts) and the orchestration tool (GoCD). If at some point 
we should decide that we want to look at other CD solutions, we already 
have all of the code necessary to execute our processes in a portable 
format.

If scripting isn't a viable option, I suggest comparing the filesystems 
between the working "Test Drive GoCD" environment and the broken agent-only 
environment. Maybe something will jump out as an obvious solution to the 
apparently missing wrapper problem.

Hope this helps,
Jason

On Friday, 27 November 2020 at 11:51:47 UTC-5 [email protected] wrote:

> Hello Jason,
>
> Unfortunately I made no progress on this. Furthermore, this is the only 
> thing I have to solve/get working before I can start transitioning to GoCD.
> The issue is exactly that the custom task command gets passed to `cmd.exe` 
> on Windows.
>
> Before continuing going down the rabbit hole: Is there a way within GoCD 
> to specify the terminal/shell to use for executing tasks? Something such as 
> `SHELL_BIN`?
>
> I am able to issue commands on cmd.exe which get executed in the MSYS2 
> bash. However, I have to do this for every command (eventually GoCD task). 
> You mentioned the possibility to launch the MSYS2 shell from cmd.exe (easy) 
> as a child process. Once the shell is up, how would I instruct GoCD to use 
> that child process shell?
>
>
> Best regards,
> ~ Joel
>
>
> On Wednesday, November 25, 2020 at 8:21:54 AM UTC+1 [email protected] 
> wrote:
>
>> Hi All,
>>
>> Very oftenly pipeline cannot be triggered and material update in master 
>> will get hunger for long.
>>
>> How can I resolve this?
>>
>> Regards,
>> Sushma
>>
>> On Tue, Nov 24, 2020, 10:15 PM Joel Bodenmann <[email protected]> wrote:
>>
>>> I've been testing GoCD today. One of my main requirements is that the 
>>> Windows agent(s) can perform builds within MSYS2 (unix environment).
>>>
>>> To get started I've opened an MSYS2 / MinGW64 terminal and pasted the 
>>> "Test Drive GoCD" line in there. Everything worked out of the box. The 
>>> script properly setup both the server and the agent and everything was 
>>> running within MSYS2. I was able to perform builds as per my requirements.
>>>
>>> The next step was to only get the agent running as the server itself is 
>>> running on a separate FreeBSD machine. However, when attempting to run the 
>>> agent within MSYS2 (MinGW64 shell) I'm presented with this message:
>>>
>>> $ ./bin/go-agent console
>>> Unable to locate any of the following binaries:
>>>   
>>> /home/joel/go-agent-20.10.0/bin/../wrapper/wrapper-mingw64_nt-10.0-19042-x86-64
>>>   
>>> /home/joel/go-agent-20.10.0/bin/../wrapper/wrapper-mingw64_nt-10.0-19042-x86-32
>>>   /home/joel/go-agent-20.10.0/bin/../wrapper/wrapper
>>>
>>> To me it seems that the java server wrapper is not finding the binaries 
>>> for my particular environment. However, the "Test Drive GoCD" 
>>> script/binaries ran without any issues.
>>>
>>> How can I solve this problem? Ultimately I just need to run the go-agent 
>>> within MSYS2.
>>>
>>> -- 
>>> 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/027ae335-8701-4d90-afe9-09558a961c57n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/go-cd/027ae335-8701-4d90-afe9-09558a961c57n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/da3c8e3b-403c-4388-aab9-dd67dff3deb7n%40googlegroups.com.

Reply via email to