CircleCI - Different Value To Environment Variable According To The Branch
Answer : The question is almost 2 years now but recently I was looking for similar solution and I found it. It refers to CircleCI's feature called Contexts (https://circleci.com/docs/2.0/contexts/). Thanks to Contexts you can create multiple sets of environment variables which are available within entire organisation. Then you can dynamically load one of the sets depending of workflows' filters property. Let me demonstrate it with following example: Imagine you have two branches and you want each of them to be deployed into different server. What you have to do is: create two contexts (e.g. prod-ctx and dev-ctx ) and define SERVER_URL environment variable in each of them. You need to log into CircleCI dashboard and go to "Settings" -> "Contexts". in your .circleci/config.yml define job's template and call it deploy : deploy: &deploy steps: - ... define workflows: workflows: version: 2 deploy: jobs: - dep...