Get current deployment group as environment var

circle.yml

#1

Hi guys,

Just want to ask if it’s possible to get name of selected deployment group, i.e. feature or dev in this circle.yml?

machine:
  php:
    version: 7.0.4
deployment:
  feature:
    branch: /feature.*/
    commands:
      - ...
  dev:
    branch: develop
    commands:
      - ...

It’s important for us because we need to split deployments depending on this matching. As you can see, we can’t just use CIRCLE_BRANCH because some time branch name might be dynamic.

Cheers!


#2

I think the best way would be to use CIRCLE_BRANCH and do a regex to find the word feature.

It’s important for us because we need to split deployments depending on this matching.

But I am not sure what you are trying to do when you say you need to split deployments based on matching. I would run different commands for different branches. Perhaps I am missing something?


#3

Same branch could be deployed on different environments (on different servers). So there will be different build settings.


#4