Skip to content
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

SAIL_FILE environment variable prevents using docker-compose.override.yml #355

Merged
merged 4 commits into from
Mar 11, 2022

Conversation

ribeirobreno
Copy link
Contributor

Fixes #354 covering the use-cases presented in the docs

  • Changed the variable name from SAIL_FILE to SAIL_FILES to better reflect the feature as it is now
  • The SAIL_FILES variable accepts multiple paths separated by :, similar to the PATH variable
  • Leaving the SAIL_FILES variable empty (or undefined) will not add a -f to the docker-compose command to allow for the default behavior to happen
  • Each of the paths is validated if it is a real file before being added to the command:
    • it assumes the path rules from Docker Compose are already taken into account in the configuration
    • it will stop execution early and inform which file didn't pass validation, if any
    • the order of files is preserved as the docs say it does matter

@ribeirobreno
Copy link
Contributor Author

Examples:

vendor/bin/sail up # Docker compose default files: docker-compose.yml and docker-compose.override.yml
SAIL_FILES="docker-compose.yml:docker-compose.override.yml" vendor/bin/sail up
SAIL_FILES="docker-compose.yml:docker-compose.override.yml:non-existent.yml" vendor/bin/sail up
SAIL_FILES="docker-compose.otherenv.yml" vendor/bin/sail up
SAIL_FILES="non-existent.yml" vendor/bin/sail up

@taylorotwell
Copy link
Member

I feel like I have never merged a single PR into Sail that didn't break something, and the logic just becomes more and more complex.

@taylorotwell taylorotwell merged commit 2092e1c into laravel:1.x Mar 11, 2022
@ribeirobreno
Copy link
Contributor Author

Shell script is weird, I hope this breaks less than average. hahaha

@curunoir
Copy link

Thanks for this improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SAIL_FILE environment variable prevents using docker-compose.override.yml
3 participants