Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Install mysql gem only when mysql environment is required (#11535)

Damian Legawiecf8ce33d52852
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 5cbb426449..4cd0c6ef25 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -25,8 +25,8 @@ run_tests: &run_tests
- checkout
- restore_cache:
keys:
- - spree-bundle-v9-ruby-2-7-{{ .Branch }}
- - spree-bundle-v9-ruby-2-7
+ - spree-bundle-v10-ruby-2-7-{{ .Branch }}
+ - spree-bundle-v10-ruby-2-7
- run:
name: Run rspec in parallel
command: ./bin/build-ci.rb test
@@ -46,8 +46,8 @@ run_tests_3_0: &run_tests_3_0
- checkout
- restore_cache:
keys:
- - spree-bundle-v9-ruby-3-0-{{ .Branch }}
- - spree-bundle-v9-ruby-3-0
+ - spree-bundle-v10-ruby-3-0-{{ .Branch }}
+ - spree-bundle-v10-ruby-3-0
- run:
name: Run rspec in parallel
command: ./bin/build-ci.rb test
@@ -67,15 +67,15 @@ jobs:
- checkout
- restore_cache:
keys:
- - spree-bundle-v9-ruby-2-7-{{ .Branch }}
- - spree-bundle-v9-ruby-2-7
+ - spree-bundle-v10-ruby-2-7-{{ .Branch }}
+ - spree-bundle-v10-ruby-2-7
- run:
name: Bundle Install
command: |
bundle check || bundle install
./bin/build-ci.rb install
- save_cache:
- key: spree-bundle-v9-ruby-2-7-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
+ key: spree-bundle-v10-ruby-2-7-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
paths:
- ~/spree/vendor/bundle
@@ -85,15 +85,15 @@ jobs:
- checkout
- restore_cache:
keys:
- - spree-bundle-v9-ruby-3-0-{{ .Branch }}
- - spree-bundle-v9-ruby-3-0
+ - spree-bundle-v10-ruby-3-0-{{ .Branch }}
+ - spree-bundle-v10-ruby-3-0
- run:
name: Bundle Install
command: |
bundle check || bundle install
./bin/build-ci.rb install
- save_cache:
- key: spree-bundle-v9-ruby-3-0-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
+ key: spree-bundle-v10-ruby-3-0-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
paths:
- ~/spree/vendor/bundle
@@ -129,8 +129,8 @@ jobs:
- checkout
- restore_cache:
keys:
- - spree-bundle-v9-ruby-2-7-{{ .Branch }}
- - spree-bundle-v9-ruby-2-7
+ - spree-bundle-v10-ruby-2-7-{{ .Branch }}
+ - spree-bundle-v10-ruby-2-7
- run:
name: Ensure Bundle Install
command: |
@@ -157,8 +157,8 @@ jobs:
- checkout
- restore_cache:
keys:
- - spree-bundle-v9-ruby-2-7-{{ .Branch }}
- - spree-bundle-v9-ruby-2-7
+ - spree-bundle-v10-ruby-2-7-{{ .Branch }}
+ - spree-bundle-v10-ruby-2-7
- run:
name: Ensure Bundle Install
command: |
@@ -203,8 +203,13 @@ jobs:
- checkout
- restore_cache:
keys:
- - spree-bundle-v9-ruby-3-0-{{ .Branch }}
- - spree-bundle-v9-ruby-3-0
+ - spree-bundle-v10-ruby-3-0-{{ .Branch }}
+ - spree-bundle-v10-ruby-3-0
+ - run:
+ name: Ensure Bundle Install
+ command: |
+ bundle install
+ ./bin/build-ci.rb install
- run:
name: Run rspec in parallel
command: ./bin/build-ci.rb test
diff --git a/common_spree_dependencies.rb b/common_spree_dependencies.rb
index 668e070db2..168bb58680 100644
--- a/common_spree_dependencies.rb
+++ b/common_spree_dependencies.rb
@@ -17,8 +17,11 @@ platforms :jruby do
end
platforms :ruby do
- gem 'mysql2'
- gem 'pg', '~> 1.1'
+ if ENV['DB'] == 'mysql'
+ gem 'mysql2'
+ else
+ gem 'pg', '~> 1.1'
+ end
end
if ENV['RAILS_VERSION']&.match(/7\.0\.0/)