How to handle different environments?

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

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
Community showcase
Published Thursday in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

....sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables ROLLBAR_ACCESS_TOKEN...

188 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you