dockerfile-rails 1.6.9 → 1.6.10
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/generators/dockerfile_generator.rb +24 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d778306a922152b1b8fa89406d1afcb45d977c0d5b9bb468340464dbfa9dddbe
|
4
|
+
data.tar.gz: e9bf92490211e18e117ccc5164761e2fa5ff3d32d886762e3bbb95d7e506b37c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5be4fcf0d992d8c3fedf4fa3ccc216fddf02c132eeae4313498a11bdee40ea67f2680d7933339ad36ffc339294501cbc06b9377d70aee544c6c37e112d1bcce
|
7
|
+
data.tar.gz: f23457093b3fd65b398770231cfc805efef41acf90419a742e7ac1e9d804e6bbddb3c1943cec9b47f8fd11a56833a31367d72dcd834595a6f15bd6b671d2bc09
|
@@ -364,6 +364,30 @@ class DockerfileGenerator < Rails::Generators::Base
|
|
364
364
|
elsif File.exist? "config/dockerfile.yml"
|
365
365
|
remove_file "config/dockerfile.yml"
|
366
366
|
end
|
367
|
+
|
368
|
+
# check Dockerfile for common errors: missing packages, mismatched Ruby version
|
369
|
+
if options.skip? && File.exist?("Dockerfile")
|
370
|
+
message = nil
|
371
|
+
shell = Thor::Base.shell.new
|
372
|
+
|
373
|
+
dockerfile = IO.read("Dockerfile")
|
374
|
+
missing = Set.new(base_packages + build_packages) -
|
375
|
+
Set.new(dockerfile.scan(/[-\w]+/))
|
376
|
+
|
377
|
+
unless missing.empty?
|
378
|
+
message = "The following packages are missing from the Dockerfile: #{missing.to_a.join(", ")}"
|
379
|
+
STDERR.puts "\n" + shell.set_color(message, Thor::Shell::Color::RED, Thor::Shell::Color::BOLD)
|
380
|
+
end
|
381
|
+
|
382
|
+
ruby_version = dockerfile.match(/ARG RUBY_VERSION=(\d+\.\d+\.\d+)/)[1]
|
383
|
+
|
384
|
+
if ruby_version && ruby_version != RUBY_VERSION
|
385
|
+
message = "The Ruby version in the Dockerfile (#{ruby_version}) does not match the Ruby version of the Rails app (#{RUBY_VERSION})"
|
386
|
+
STDERR.puts "\n" + shell.set_color(message, Thor::Shell::Color::RED, Thor::Shell::Color::BOLD)
|
387
|
+
end
|
388
|
+
|
389
|
+
exit 42 if message
|
390
|
+
end
|
367
391
|
end
|
368
392
|
|
369
393
|
private
|
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.6.
|
4
|
+
version: 1.6.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
|
-
rubygems_version: 3.5.
|
77
|
+
rubygems_version: 3.5.9
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: Dockerfile generator for Rails
|