Environment variable identifying a deployment?

Is there a way to determine if a build is running specifically as a deployment? Something along the lines of the CI variable, but maybe CI_DEPLOYMENT=true?

Thanks!

The deployment phase is just a part of the build process. Any build in theory can be a deployment depending on what is specified in circle.yml.

Depending on what you are doing, if you really need an environment variable you can prefix a deployment command with one:

deployment:
  production:
    branch: master
    commands:
      - CI_DEPLOYMENT=true ./run-this-thing.sh

How helpful that would be is dependent on what you’re doing I guess.

Ah, I see. That actually answered a bunch of other questions I had… :slight_smile:

I’m trying not to run test on tagged deploys since they’ve already run once in our process. I can do that by overriding the test phase, but I was hoping to short circuit it higher up to avoid duplicated logic and to let Circle be in control of test.

Thanks!

1 Like