dockerfile-rails 1.0.14 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dockerfile-rails/scanner.rb +19 -15
- data/lib/generators/dockerfile_generator.rb +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97f3c4b0a7c797b143ddf74c5478ddf225660a04ca0329fbbe3dd480fa2e2080
|
4
|
+
data.tar.gz: 065ea2146179c5e3942874401a8912f8fa1dcb465b1141e6e60ab6b42b1faa18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4914704950b723956a5cabf755d77295e368a51cb0fee13f2795d09bcecde362a8fb50360d30438b1dbea16d41e8b8309dd977492519b231b01bd7d319629e7c
|
7
|
+
data.tar.gz: e9ea377ef708c94c141ce53f553b5e97db77f55a6f6d4763aea9b538b73cd37c0854f2378c8bc0978157c8b43eacd39e2413eb8f66a3607b1fcc96dcc9d7be4a
|
@@ -2,21 +2,6 @@ module DockerfileRails
|
|
2
2
|
module Scanner
|
3
3
|
def scan_rails_app
|
4
4
|
|
5
|
-
### database ###
|
6
|
-
|
7
|
-
database = YAML.load_file('config/database.yml', aliases: true).
|
8
|
-
dig('production', 'adapter') rescue nil
|
9
|
-
|
10
|
-
if database == 'sqlite3'
|
11
|
-
@sqlite3 = true
|
12
|
-
elsif database == 'postgresql'
|
13
|
-
@postgresql = true
|
14
|
-
elsif database == 'mysql' or database == 'mysql2'
|
15
|
-
@mysql = true
|
16
|
-
elsif database == 'sqlserver'
|
17
|
-
@sqlserver = true
|
18
|
-
end
|
19
|
-
|
20
5
|
### ruby gems ###
|
21
6
|
|
22
7
|
@gemfile = []
|
@@ -49,6 +34,25 @@ module DockerfileRails
|
|
49
34
|
@puppeteer = @gemfile.include? 'puppeteer'
|
50
35
|
@bootsnap = @gemfile.include? 'bootsnap'
|
51
36
|
|
37
|
+
### database ###
|
38
|
+
|
39
|
+
database = YAML.load_file('config/database.yml', aliases: true).
|
40
|
+
dig('production', 'adapter') rescue nil
|
41
|
+
|
42
|
+
if database == 'sqlite3'
|
43
|
+
@sqlite3 = true
|
44
|
+
elsif database == 'postgresql'
|
45
|
+
@postgresql = true
|
46
|
+
elsif database == 'mysql' or database == 'mysql2'
|
47
|
+
@mysql = true
|
48
|
+
elsif database == 'sqlserver'
|
49
|
+
@sqlserver = true
|
50
|
+
end
|
51
|
+
|
52
|
+
@sqlite3 = true if @gemfile.include? 'sqlite3'
|
53
|
+
@postgresql = true if @gemfile.include? 'pg'
|
54
|
+
@mysql = true if @gemfile.include? 'mysql2'
|
55
|
+
|
52
56
|
### node modules ###
|
53
57
|
|
54
58
|
@package_json = []
|
@@ -28,7 +28,7 @@ class DockerfileGenerator < Rails::Generators::Base
|
|
28
28
|
|
29
29
|
# load defaults from config file
|
30
30
|
if File.exist? 'config/dockerfile.yml'
|
31
|
-
options = YAML.
|
31
|
+
options = YAML.safe_load(IO.read('config/dockerfile.yml'), symbolize_names: true)[:options]
|
32
32
|
|
33
33
|
if options
|
34
34
|
OPTION_DEFAULTS.to_h.each do |option, value|
|
@@ -276,10 +276,12 @@ private
|
|
276
276
|
# is based on debian release included with the Ruby images on
|
277
277
|
# Dockerhub.
|
278
278
|
case RUBY_VERSION
|
279
|
-
when /^2
|
279
|
+
when /^2\.7/
|
280
280
|
bullseye = RUBY_VERSION >= "2.7.4"
|
281
|
-
when /^3
|
281
|
+
when /^3\.0/
|
282
282
|
bullseye = RUBY_VERSION >= "3.0.2"
|
283
|
+
when /^2\./
|
284
|
+
bullseye = false
|
283
285
|
else
|
284
286
|
bullseye = true
|
285
287
|
end
|
@@ -401,7 +403,7 @@ private
|
|
401
403
|
|
402
404
|
# optionally, adjust cwd
|
403
405
|
if options['bin-cd']
|
404
|
-
binfixups.push %{sed -i '/^#!/aDir.chdir File.expand_path("..", __dir__)' /
|
406
|
+
binfixups.push %{sed -i '/^#!/aDir.chdir File.expand_path("..", __dir__)' /rails/bin/*}
|
405
407
|
end
|
406
408
|
|
407
409
|
binfixups
|
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: 1.0.
|
4
|
+
version: 1.0.16
|
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-02-
|
11
|
+
date: 2023-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|