Install a specific gem set in the CircleCI configuration file

I am trying to create a CircleCI configuration file that installs only a specific set of stones through an environment parameter. In this case, allow this environment continuous_integration , and this environment corresponds to the test environment. So far I have tried several things, and this is my current configuration in this surge.

Can someone point me in the right direction? Is it possible?

 machine: timezone: America/Los_Angeles ruby: version: 2.4.1 services: - redis environment: RAILS_ENV: continous_integration database: override: - bundle exec RAILS_ENV=continous_integration rake db:drop - bundle exec RAILS_ENV=continous_integration rake db:setup dependencies: pre: - gem install bundler override: - bundle install: timeout: 180 environment: RAILS_ENV: continous_integration test: override: - bundle exec RAILS_ENV=continous_integration rspec 
0
source share
1 answer

THIS SOLUTION ONLY WORKS WITH CIRCUS 1.0

From my current research, I had to check the environment continous_integration was correctly configured in all Rails inside secrets, environment folder, gems, etc. As it turned out, I found that bundler does not use the ENV set, so I work with the following configuration to force the stone cache, speed the build process and use the continous_integration environment.

References

.rspec

 --color --require spec_helper --format documentation 

.circle.yml

 machine: timezone: America/Los_Angeles ruby: version: 2.4.1 services: - redis dependencies: pre: - gem install bundler - gem update bundler override: - bundle config without development:test - bundle check --path=vendor/bundle || bundle install --without development test --path=vendor/bundle --jobs=4 --retry=3: timeout: 180 database: override: - RAILS_ENV=continous_integration bundle exec rake db:drop - RAILS_ENV=continous_integration bundle exec rake db:setup test: override: - RAILS_ENV=continous_integration bundle exec rspec --format RspecJunitFormatter -o $CIRCLE_TEST_REPORTS/rspec.xml post: - gem install brakeman - gem install rubocop - gem install rubocop-rspec - RAILS_ENV=continous_integration bundle exec rubocop --format fuubar --require rubocop-rspec --config .rubocop.yml - RAILS_ENV=continous_integration brakeman -z 

Gemfile

 group :development do gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' gem 'spring-commands-rspec' gem 'spring-commands-rubocop' end group :development, :test do gem 'pry-rails' gem 'pry-nav' gem 'pry-clipboard' gem 'pry-rescue' gem 'table_print' gem 'awesome_print' gem 'guard-rake' gem 'guard-rspec' end group :development, :test, :continous_integration do gem 'brakeman', require: false gem 'rubocop', require: false gem 'rubocop-rspec', require: false gem 'timecop' gem 'mail_safe' gem 'dotenv-rails' gem 'factory_girl_rails' gem 'faker', '~> 1.6.6' end group :test, :continous_integration do gem 'simplecov' gem 'database_cleaner' gem 'rspec-rails' gem 'json_spec' gem 'json-schema' gem 'json_matchers' gem 'shoulda-matchers' gem 'nyan-cat-formatter' gem 'rspec_junit_formatter', '~> 0.3.0.pre6' gem 'webmock' gem 'vcr' end 

This setting will give the correct error result in Circle CI too

enter image description here

0
source

All Articles