-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Custom file location #178
base: main
Are you sure you want to change the base?
Custom file location #178
Conversation
…onfiguration YAML - Only works in the context of rails - It takes precedence over the default `config/application.yml` - Add README and include other examples of how you can customise your file path
Not sure why this caused the travis build to 🔴 fail for rails 3.2 on ruby 1.9.3 since it's not even related code. Is this a bug caused by something else? |
Restarting that particular job. Recently, the suite has been experiencing some intermittent failures and I haven't had the chance to get to the bottom of it yet. 😢 🐼 |
@laserlemon Ah, cool, looks like they all pass now! Wohoo! |
I have a few suggestions and concerns. First, let's call the variable Next, I think this feature would be more useful if the user could specify any path on the server, not just a path within |
@laserlemon I like the idea of As for your concern. Joining an absolute path with As for my rationale. I ran in to issues and came up with this feature trying to support defaults for different environments on different platforms in development. For OS X defaults I would like something like this: # config/application.osx+brew.yml
development: &defaults
database_url: postgres://app@localhost:5432/dev?template=template0&pool=5&encoding=unicode
redis_url: redis://localhost:6379/0
test:
<<: *defaults
database_url: postgres://app@localhost:5432/test?template=template0&pool=5&encoding=unicode
redis_url: redis://localhost:6379/0 While something like # config/application.fig+docker.yml
development: &defaults
database_url: postgres://app@postgres:5432/dev?template=template0&pool=5&encoding=unicode
redis_url: redis://redis:6379/0
test:
<<: *defaults
database_url: postgres://app@postgres:5432/test?template=template0&pool=5&encoding=unicode
redis_url: redis://redis:6379/0 |
@laserlemon Does this replace #78 or do you want to take another direction altogether? |
@laserlemon What are your thoughts? |
This patch looks familiar |
@jbussdieker Haha, yeah sorry. I didn't realise until long after submitting this pull request. Kind of jumped the gun. |
@laserlemon Any thoughts on whether this (or #78) is likely to get merged? |
+1 This fix is exactly what I was looking for, could someone please merge ??? |
@carltonbrown Unfortunately Figaro seems to have been unmaintained for several years. Personally I've found https://github.com/bkeepers/dotenv works well as a replacement. |
Possibly solves or replaces #78
Say your deployment process require you to have your configuration at a certain file path or that you want to provide defaults for different platforms in development.
You can achieve this by using an environment variable to tell Figaro where to look for your yaml file.
If you're not using rails or if you want to determine the file path by other means, set the
Figaro.adapter.path
to your desired value.Now you can get your environment variables using environment variables