dockerfile-rails 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a58947d6c45936ce561ae3ddfdd3799773d17c5145fb15ae8013c9b293b53ce1
4
- data.tar.gz: 0a9aff0df9a5e4688d47fa40fe151f6aabe4cdc8f5010c0e5e5514bd0d013fc8
3
+ metadata.gz: f7578107905d7265d79a480e52c9a960e58d5b5cde92e6a3c6de22e3a7c2b269
4
+ data.tar.gz: 8a1a483463c405746298d425a259838d18a1128231aac5e0c68733be607f1e7b
5
5
  SHA512:
6
- metadata.gz: 44675c3dbac8f26938a990209e821a2974bd330c4ee1ab7a1cf59316ae2a622ed0cfb03ccf0bf6dfe5f776d200dff31ce789c0840c407fcd6fa64c96e88c4d89
7
- data.tar.gz: 9f37b005a98f99c06d724c25afd61a50cb0d1e3c63391fd252b8a7179493b78624b1dd2ae70df45fedd5b92405f99a44bfc6b980369f194e8caa15d66d79bdaf
6
+ metadata.gz: 7d459f7291d6588b1f1b6353f27bde783f018f1f7dd16d80dc4f643cb8ec5a3934c5cc1d96eaabd857a7c0cb43a947917cdaf44b4e064e24397bfc2a8876f1cc
7
+ data.tar.gz: 0f4b1859a1b07a8f7b6e7e3679a7a3566a1957148f708d66be5be0ec2e2ead03706a4f7d30ac964a216e7912d0896bcf2e83612534a9c841780454c73c726b78
@@ -235,18 +235,22 @@ private
235
235
 
236
236
  def yarn_version
237
237
  package = JSON.parse(IO.read('package.json'))
238
- if package['packageManager'].to_s.start_with? "yarn@"
238
+
239
+ if ENV['RAILS_ENV'] == 'test'
240
+ # yarn install instructions changed in v2
241
+ version = '1.22.19'
242
+ elsif package['packageManager'].to_s.start_with? "yarn@"
239
243
  version = package['packageManager'].sub('yarn@', '')
240
244
  else
241
- version = `yarn --version`[/\d+\.\d+\.\d+/]
245
+ version = `yarn --version`[/\d+\.\d+\.\d+/] || '1.22.19'
242
246
  system "yarn set version #{version}"
243
-
244
- # apparently not all versions of yarn will update package.json
245
247
  package = JSON.parse(IO.read('package.json'))
246
- unless package['packageManager']
247
- package['packageManager'] = "yarn@#{version}"
248
- IO.write('package.json', JSON.pretty_generate(package))
249
- end
248
+ # apparently not all versions of yarn will update package.json...
249
+ end
250
+
251
+ unless package['packageManager']
252
+ package['packageManager'] = "yarn@#{version}"
253
+ IO.write('package.json', JSON.pretty_generate(package))
250
254
  end
251
255
 
252
256
  version
@@ -95,7 +95,7 @@ RUN bundle exec bootsnap precompile app/ lib/
95
95
  <%= "RUN " + binfile_fixups.join(" && \\\n ") %>
96
96
 
97
97
  <% end -%>
98
- <% if Dir.exist?('assets') and !api_only? -%>
98
+ <% if Dir.exist?('app/assets') and !api_only? -%>
99
99
  # Precompiling assets for production without requiring secret RAILS_MASTER_KEY
100
100
  RUN SECRET_KEY_BASE<%= Rails::VERSION::MAJOR<7 || Rails::VERSION::STRING.start_with?('7.0') ? '=DUMMY' : '_DUMMY=1' %> ./bin/rails assets:precompile
101
101
 
@@ -17,5 +17,14 @@ RUN curl -fsSL https://fnm.vercel.app/install | bash && \
17
17
  ENV PATH=/root/.local/share/fnm/aliases/default/bin/:$PATH
18
18
  <% end -%>
19
19
  <% if yarn_version -%>
20
+ <% if yarn_version < '2' -%>
20
21
  RUN npm install -g yarn@$YARN_VERSION
22
+ <% else -%>
23
+ <% if (node_version.split('.').map(&:to_i) <=> [16,10,0]) < 0 -%>
24
+ RUN npm i -g corepack && \
25
+ <% else -%>
26
+ RUN corepack enable && \
27
+ <% end -%>
28
+ corepack prepare yarn@$YARN_VERSION --activate
29
+ <% end -%>
21
30
  <% end -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerfile-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-21 00:00:00.000000000 Z
11
+ date: 2023-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails