Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to handle different environments?

Jamie Fairweather June 7, 2017

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?

1 answer

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 3, 2019

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events