I'd love to use pipelines to build a real CICD environment, however I'm circling around how to handle environment variables. The env variable values will change depending on if I'm deploying to production, staging or whatever environment.
I could handle this with different variables depending on the environment, however like the 12 Factor App describes "In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy."
Which I happen to agree with. So, given this how are others managing their different deploys from Pipelines?
Bitbucket Pipelines now has support for Deployment Variables. These are variables that are only defined for a single environment. So for example, you can have a variable mapping like:
Staging environment:
DEPLOYMENT_ENVIRONMENT = staging
RESOURCE_FILE = stg.yml
Production:
DEPLOYMENT_ENVIRONMENT = production
RESOURCE_FILE = prod.yml
More details can be found here: https://confluence.atlassian.com/bitbucket/variables-in-pipelines-794502608.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.