-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use symfony/yaml, new Soketi service, and new sail:add command #532
Conversation
Hey @tonysm - this PR has some conflicts. Please mark as ready for review when those are resolved. |
…ommand, and uses symfony/yaml
@taylorotwell I've rebased it. By the way, I only opened this as a discussion starter. No pressure to merge it. Happy to open separate PRs for each of the changes I described here or to pick only the wanted pieces 👍🏼 |
@tonysm this all looks pretty good to me. I'm ready to merge it in if you are. |
Alright 👍 |
Thanks @tonysm! |
Changed
symfony/yaml
dependency to ease Yaml manipulation (there are some differences to the generated Yaml file, I'll try to describe them below)InstallCommand
methods into aInteractsWithDockerComposeServices
concern (trait). I needed those methods in the newsail:add
command.Add
artisan sail:add
command that we can use to add new services to our Sail setup. We're currently expecting this command to run from the host machine (since it uses some docker commands in theprepareInstallation
method). I think thesail:install
command also has the same expectation (I've always ran it from my host machine)soketi
service to ease broadcasting setup on SailThere are some changes to the Yaml generated by the
symfony/yaml
package, especially around sequences. One example is the Redis health-check command:Before:
After:
Both versions work the same, I guess it's just aesthetics (I prefer the before). Couldn't find a way to change it (maybe we could do some string manipulation as before?)
I explored adding a
sail add
command to thebin/sail
script, but not sure. The script would need a few changes, 'cause we can runphp artisan sail:add
inside the container but we'd need to run the docker commands from the host machine (unless we share the docker socket with the container and install docker in thelaravel.test
, this way I believe we could run theprepareInstallation
method inside the container as well).Why not use the
artisan sail:install
to add the new dependencies?That's what I've been using. But I always had to list all services I wanted to keep + the new service. Even though the new
sail:add
command and thesail:install
command are technically the same now (after the changes here), the add one passes the intention of addition. But I guess it's not necessary.This is all a proof of concept. Wasn't sure where to suggest the
sail:add
feature, but the GH workflow said to open a PR. Happy to open separate PRs in case y'all don't want to add an extra dependency, or don't want to add soketi, etc.