Skip to content

Commit

Permalink
make RUBYOPT available to all run steps
Browse files Browse the repository at this point in the history
The earlier export was probably having no effect.

The circleci 'Set an environment variable' doc [1] states:

Since every run step is a new shell, environment variables are not
shared across steps. If you need an environment variable to be
accessible in more than one step, export the value using
BASH_ENV.

- [1]:
https://circleci.com/docs/set-environment-variable/#set-an-environment-variable-in-a-step
  • Loading branch information
nitishr authored and floehopper committed Mar 1, 2025
1 parent 26212bd commit d1d4b82
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ jobs:
- run: gem --version
- run: bundle --version
- run: bundle install --gemfile=<< parameters.gemfile >>
- run: |
if [ "<< parameters.docker-image >>" > "ruby:2.2" ]; then
export RUBYOPT="--enable-frozen-string-literal"
fi
- unless:
condition:
equal: ["ruby:2.2", << parameters.docker-image >>]
steps:
- run: echo 'export RUBYOPT="--enable-frozen-string-literal"' >> "$BASH_ENV"
- when:
condition:
equal: ["Gemfile", << parameters.gemfile >>]
Expand Down

0 comments on commit d1d4b82

Please sign in to comment.