In CircleCI 1.0 you could do this by adding commands to the .circlerc file. This was great - because it was driven by CirclCI itself and didn't rely on shell specific tricks (e.g. like $BASH_ENV). In CircleCI 2.0 this capability is not present and there is currently no way to do this for the official Alpine docker images. You have to include your step(s) in every single run command.
We have large modular build and deploy scripts with many run commands and having this capability keep things simple and follows DRY principals.
It's also a very flexible feature
  • People can easily carry environment variables across step (or even set them from within a step and have them available to other steps)
  • You can setup you shell the way you need to before each run step
CCI-I-600