diff --git a/README.md b/README.md index a01b027..be67f7a 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ There may be times where feature detection plus flags just aren't enough. As an * `--instructions=path` - a dockerfile fragment to be inserted into the final document. * `--migration=cmd` - a replacement (generally a script) for `db:prepare`/`db:migrate`. +* `--no-gemfile-updates` - do not modify my gemfile. * `--procfile=path` - a [Procfile](https://github.com/ddollar/foreman#foreman) to use in place of launching Rails directly. Like with environment variables, packages, and build args, `--instructions` can be tailored to a specific build phase by adding `-base`, `-build`, or `-deploy` after the flag name, with the default being `-deploy`. diff --git a/lib/generators/dockerfile_generator.rb b/lib/generators/dockerfile_generator.rb index fab88d3..4b13c8f 100644 --- a/lib/generators/dockerfile_generator.rb +++ b/lib/generators/dockerfile_generator.rb @@ -14,6 +14,7 @@ class DockerfileGenerator < Rails::Generators::Base "ci" => false, "compose" => false, "fullstaq" => false, + "gemfile-updates" => true, "jemalloc" => false, "label" => {}, "link" => true, @@ -219,6 +220,9 @@ class DockerfileGenerator < Rails::Generators::Base class_option "private-gemserver-domain", type: :string, default: OPTION_DEFAULTS["private-gemserver-domain"], desc: "domain name of a private gemserver used when installing application gems" + class_option "gemfile-updates", type: :boolean, default: OPTION_DEFAULTS["gemfile-updates"], + desc: "include gemfile updates" + class_option "add-base", type: :array, default: [], desc: "additional packages to install for both build and deploy" @@ -510,6 +514,8 @@ def keeps? end def install_gems + return unless options["gemfile-updates"] + ENV["BUNDLE_IGNORE_MESSAGES"] = "1" gemfile = IO.read("Gemfile")