flownative / localbeach

The Local Beach client written in Go
Apache License 2.0
7 stars 3 forks source link

Inconsistent $FLOW_CONTEXT with `beach exec` #82

Open kdambekalns opened 1 month ago

kdambekalns commented 1 month ago

Entering the container, running Flow:

$ beach exec
beach@04a76d00f9f2:/application$ ./flow
Neos 8.3.15 ("Development/Beach/Instance" context)

Running Flow directly with beach exec:

$ beach exec ./flow
Neos 8.3.15 ("Development" context)

Running Flow directly with beach exec, passing context:

$ beach exec FLOW_CONTEXT=Development/Beach/Instance ./flow
Neos 8.3.15 ("Development/Beach/Instance" context)

This obviously leads to issues when settings are needed that are specific for Beach…

kdambekalns commented 1 month ago

This should be whatever is configured for the project and definitely the same as when going into the container first.

kitsunet commented 1 month ago

I think I looked at something similar to this and it's problematic because you can only set the environment for a shell? and with exec direct you are not opening the shell so the environment is never created? Something along those lines.

kdambekalns commented 1 month ago

Well, you can change https://github.com/flownative/localbeach/blob/c11b6efbc8a9a31b7ce850eed8284b9561666ee5/cmd/beach/cmd/exec.go#L49

to be

commandArgs := []string{"exec", "-e", "FLOW_CONTEXT=Development/Beach/Instance", "-ti", sandbox.ProjectName + "_php"}

but with the context potentially configured by the user.

kitsunet commented 1 month ago

Yep we can do that, good idea! I was mostly saying there is probably no easy way to do that on the container side of things.