Skip to main content

❓ - I have two branches. `master` is my production and `staging` is my staging/dev environment. I also have two redis servers for production (`production-redis`) and staging (`non-prod-redis`) Cribl. Now in redis function, how can I use `C.env.CRIBL_GIT_BRANCH` variable to specify either `production-redis` OR `non-prod-redis`?

the redis URL field is an expressionyou reference the global vars there``redis://${C.env.CRIBL_GIT_BRANCH == "master" ? "production-redis" : "non-prod-redis"}:6379``


possibly easier to understand method:2 redis functions with filters that use the git branch to fire or noteg, redis function one has a filter `C.env.CRIBL_GIT_BRANCH == "master"` and inside references the production-redis url


I liked 2nd approach because my redis credentials are different in production and staging redis


Thank you Jon.


Reply