Browse Source

[ruby] Only install optional gems (#9574)

This should reduce build times slightly.
Petrik de Heus 5 months ago
parent
commit
6f8ba24f4f

+ 5 - 5
frameworks/Ruby/rack-sequel/Gemfile

@@ -4,26 +4,26 @@ gem 'json', '~> 2.8'
 gem 'sequel', '~> 5.0'
 gem 'rack', '~> 3.0'
 
-group :mysql do
+group :mysql, optional: true do
   gem 'jdbc-mysql', '~> 5.1', platforms: :jruby, require: 'jdbc/mysql'
   gem 'mysql2', '~> 0.4', platforms: [:ruby, :mswin]
 end
 
-group :postgresql do
+group :postgresql, optional: true do
   gem 'jdbc-postgres', '~> 9.4', platforms: :jruby, require: 'jdbc/postgres'
   gem 'pg', '~> 1.5', platforms: [:ruby, :mswin]
   gem 'sequel_pg', '~> 1.6', platforms: :ruby, require: false
 end
 
-group :passenger do
+group :passenger, optional: true do
   gem 'base64' # required by passenger on Ruby 3.4
   gem 'passenger', '~> 6.0', platforms: [:ruby, :mswin], require: false
 end
 
-group :puma do
+group :puma, optional: true do
   gem 'puma', '~> 6.4', require: false
 end
 
-group :unicorn do
+group :unicorn, optional: true do
   gem 'unicorn', '~> 6.1', platforms: [:ruby, :mswin], require: false
 end

+ 1 - 1
frameworks/Ruby/rack-sequel/rack-sequel-passenger-mri.dockerfile

@@ -11,7 +11,7 @@ RUN apt-get update && \
     apt-get install -y --no-install-recommends libjemalloc2
 ENV LD_PRELOAD=libjemalloc.so.2
 
-RUN bundle config set without 'postgresql puma unicorn'
+RUN bundle config set with 'mysql passenger'
 RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile
 
 # TODO: https://github.com/phusion/passenger/issues/1916

+ 1 - 1
frameworks/Ruby/rack-sequel/rack-sequel-postgres-passenger-mri.dockerfile

@@ -11,7 +11,7 @@ RUN apt-get update && \
     apt-get install -y --no-install-recommends libjemalloc2
 ENV LD_PRELOAD=libjemalloc.so.2
 
-RUN bundle config set without 'mysql puma unicorn'
+RUN bundle config set with 'postgresql passenger'
 RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile
 
 # TODO: https://github.com/phusion/passenger/issues/1916

+ 1 - 1
frameworks/Ruby/rack-sequel/rack-sequel-postgres-unicorn-mri.dockerfile

@@ -11,7 +11,7 @@ RUN apt-get update && \
     apt-get install -y --no-install-recommends libjemalloc2
 ENV LD_PRELOAD=libjemalloc.so.2
 
-RUN bundle config set without 'mysql passenger puma'
+RUN bundle config set with 'postgresql unicorn'
 RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile
 
 ENV DBTYPE=postgresql

+ 1 - 1
frameworks/Ruby/rack-sequel/rack-sequel-postgres.dockerfile

@@ -11,7 +11,7 @@ RUN apt-get update && \
     apt-get install -y --no-install-recommends libjemalloc2
 ENV LD_PRELOAD=libjemalloc.so.2
 
-RUN bundle config set without 'mysql passenger unicorn'
+RUN bundle config set with 'postgresql puma'
 RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile
 
 ENV DBTYPE=postgresql

+ 1 - 1
frameworks/Ruby/rack-sequel/rack-sequel-unicorn-mri.dockerfile

@@ -11,7 +11,7 @@ RUN apt-get update && \
     apt-get install -y --no-install-recommends libjemalloc2
 ENV LD_PRELOAD=libjemalloc.so.2
 
-RUN bundle config set without 'postgresql passenger puma'
+RUN bundle config set with 'mysql unicorn'
 RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile
 
 ENV DBTYPE=mysql

+ 1 - 1
frameworks/Ruby/rack-sequel/rack-sequel.dockerfile

@@ -11,7 +11,7 @@ RUN apt-get update && \
     apt-get install -y --no-install-recommends libjemalloc2
 ENV LD_PRELOAD=libjemalloc.so.2
 
-RUN bundle config set without 'postgresql passenger unicorn'
+RUN bundle config set with 'mysql puma'
 RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile
 
 ENV DBTYPE=mysql

+ 2 - 2
frameworks/Ruby/roda-sequel/Gemfile

@@ -7,11 +7,11 @@ gem "sequel", "~> 5.67"
 gem "roda", "~> 3.66"
 gem "tilt", "~> 2.1", require: "tilt/erb"
 
-group :mysql do
+group :mysql, optional: true do
   gem "mysql2", "~> 0.5", platforms: %i[ruby mswin]
 end
 
-group :postgresql do
+group :postgresql, optional: true do
   gem "pg", "~> 1.4", platforms: %i[ruby mswin]
   gem "sequel_pg", "~> 1.17", platforms: :ruby, require: false
 end

+ 2 - 0
frameworks/Ruby/roda-sequel/Gemfile.lock

@@ -4,6 +4,7 @@ GEM
     base64 (0.2.0)
     bigdecimal (3.1.8)
     erubi (1.13.0)
+    iodine (0.7.58)
     json (2.9.1)
     kgio (2.11.4)
     mysql2 (0.5.6)
@@ -32,6 +33,7 @@ PLATFORMS
 DEPENDENCIES
   base64
   erubi (~> 1.12)
+  iodine (~> 0.7)
   json (~> 2.8)
   mysql2 (~> 0.5)
   pg (~> 1.4)

+ 1 - 1
frameworks/Ruby/roda-sequel/roda-sequel-postgres-iodine-mri.dockerfile

@@ -11,7 +11,7 @@ RUN apt-get update && \
 ENV LD_PRELOAD=libjemalloc.so.2
 
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
-RUN bundle config set with 'iodine'
+RUN bundle config set with 'postgresql iodine'
 RUN bundle install --jobs=8
 
 ENV DBTYPE=postgresql

+ 1 - 1
frameworks/Ruby/roda-sequel/roda-sequel-postgres-unicorn-mri.dockerfile

@@ -11,7 +11,7 @@ RUN apt-get update && \
 ENV LD_PRELOAD=libjemalloc.so.2
 
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
-RUN bundle config set with 'unicorn'
+RUN bundle config set with 'postgresql unicorn'
 RUN bundle install --jobs=8
 
 ENV DBTYPE=postgresql

+ 1 - 1
frameworks/Ruby/roda-sequel/roda-sequel-postgres.dockerfile

@@ -11,7 +11,7 @@ RUN apt-get update && \
 ENV LD_PRELOAD=libjemalloc.so.2
 
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
-RUN bundle config set with 'puma'
+RUN bundle config set with 'postgresql puma'
 RUN bundle install --jobs=8
 
 ENV DBTYPE=postgresql

+ 1 - 1
frameworks/Ruby/roda-sequel/roda-sequel.dockerfile

@@ -11,7 +11,7 @@ RUN apt-get update && \
 ENV LD_PRELOAD=libjemalloc.so.2
 
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
-RUN bundle config set with 'puma'
+RUN bundle config set with 'mysql puma'
 RUN bundle install --jobs=8
 
 ENV DBTYPE=mysql

+ 0 - 1
frameworks/Ruby/sinatra-sequel/Gemfile

@@ -13,7 +13,6 @@ group :postgresql, optional: true do
   gem 'sequel_pg', '~> 1.6', :platforms=>:ruby, :require=>false
 end
 
-
 group :iodine, optional: true do
   gem 'iodine', '~> 0.7', platforms: [:ruby, :mswin], require: false
 end