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

Handle environment variables in YAML config files #685

Closed
rbayliss opened this issue Feb 5, 2017 · 5 comments
Closed

Handle environment variables in YAML config files #685

rbayliss opened this issue Feb 5, 2017 · 5 comments
Milestone

Comments

@rbayliss
Copy link

rbayliss commented Feb 5, 2017

It would be a really great feature to have the base URL be separate from the URL of the test. The main use case for this is in having a single config file that you want to run on multiple environments of a site. In my config file, I'd like to be able to say:

url: /my-page

Then on the command line, be able to set the base with something like:

phantomas --config=my-config.yaml --base-url=http://foo.com

Is this implemented, or possible? I'm happy to help out with a PR here, but I'm not sure where to start.

@macbre macbre added this to the Roadmap milestone Feb 5, 2017
@macbre
Copy link
Owner

macbre commented Feb 5, 2017

@rbayliss, great suggestion 👍

Personally, I like the way Docker handles environment variables in their config files (YAML as well). What if we use the same approach in Phantomas YAML config files? This will be even more flexible then additional --base-url option.

Example:

url: ${HOST}/my-page

@rbayliss
Copy link
Author

rbayliss commented Feb 5, 2017

Yeah, even better!

@rbayliss
Copy link
Author

rbayliss commented Feb 5, 2017

Ah, just realized if this was supported for various configuration keys in the config file, it would also provide a way to change the report type on the fly too. Sweetness!

@macbre macbre changed the title Allow base url to be set independently from the URL. Handle environment variables in YAML config files Feb 5, 2017
@macbre macbre modified the milestones: v1.19, Roadmap Feb 5, 2017
@macbre
Copy link
Owner

macbre commented Feb 6, 2017

Let's add the env variables handling in optimist-config-file.js + move it to a separate npm module (with tests).

@macbre
Copy link
Owner

macbre commented Feb 8, 2017

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

No branches or pull requests

2 participants