-
Notifications
You must be signed in to change notification settings - Fork 20
Allow local vcap
options to be supplied in a file, not just an object
#31
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
Comments
That sounds interesting, but I think I'll have to noodle on it. I'm hesitant to reset env vars magically, since I think if that functionality were to be added, it would have to be opt-in, like a new boolean option on |
Thank you for the response. Upon further work with Cloud Foundry and this module, I started using user-defined services to store my credentials instead of the env variables. But this now presents another problem. I understand how to read my credentials locally by passing {
vcap: {
services: {
"user-provided": [
{
"credentials": {
"password": "<password>",
"username": "<username>"
},
"name": "<custom-service>",
}
]
}
}
} to
I like the second bullet but I dislike having to either wrap the Is there a way to allow the options parameter passed to |
So maybe something like a That sounds fairly reasonable. |
vcap
options to be supplied in a file, not just an object
@jsmoorman I have an implementation of this in PR #33 ; see notes there about testing with this implementation. I'd like to find out if this works for you. |
So I've just tested it and it works amazingly! I've exported the VCAP_SERVICES from my Cloud Foundry App on Bluemix and just wrapped it with: {
"services": "<exported VCAP_SERVICES>"
} The only possible suggestion I have is to allow users to use the exported json itself as the VCAP_SERVICES instead of as the whole app environment so that users don't have to wrap the export as I did above -- but then you would lose the ability to customize the VCAP_APPLICATION. That is, unless you allowed them to use it in tandem with the |
But to answer your original question, this works exactly as expected and provides the functionality I needed. Thank you! |
Ya, I can see that, but I think only if such a 'services-only' JSON file would be useful in some other environment. Otherwise, it's kinda a one-off thing anyway, so I don't see the extra It would also not be parallel to the existing Probably worth noodling on whether there should be But let me go ahead and publish what I have now, I think this weekend or next week. Tied up for now and I want to have some time ready if for some unknown reason this causes existing users problems, so I can fix that. Thanks a bunch for trying this out! |
Would it be possible to load everything defined under
env:
in the manifest.yml to be loaded intoprocess.env
in the constructor whenisLocal
is true?This would allow me to access my environment variables defined in the manifest.yml without having to use another library or any additional code.
The text was updated successfully, but these errors were encountered: