hubotio / hubot-redis-brain

A hubot script to persist hubot's brain using redis
69 stars 55 forks source link

Add basic support for CloudFoundry Redis #34

Closed quickjp2 closed 1 year ago

quickjp2 commented 6 years ago

CloudFoundry automatically injects Redis info into apps via the VCAP_SERVICES environment variable. I've added code to use that env var when a user adds info about the service they chose and uses the name of the service as the Redis prefix.

I've added documentation for what env vars to set, as well as a test to check the call that uses the CF env vars.

I believe I've followed best practices, but if you notice something off, let me know and I can fix it. 😄

joeyguerra commented 1 year ago

What about changing the stagey a little bit to "push out the change impact" from the main function by changing the responsibility of getRedisEnv to actually building and returning the correctly formatted Redis URL.

const getRedisUrl = (robot) => {
/// do all the url building in here.
}
joeyguerra commented 1 year ago

Closing due to staleness.