dockerfile-rails 1.6.10 → 1.6.11

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: d778306a922152b1b8fa89406d1afcb45d977c0d5b9bb468340464dbfa9dddbe
4
- data.tar.gz: e9bf92490211e18e117ccc5164761e2fa5ff3d32d886762e3bbb95d7e506b37c
3
+ metadata.gz: 38dcdef2aee6ee5c058a39c20f94dd1a786cebd4ae13b73c04ce105af60b1227
4
+ data.tar.gz: 491eb04d414d7a97268eddb82d5637997cd6bafe84ff8ae04c5c859ffbf62353
5
5
  SHA512:
6
- metadata.gz: e5be4fcf0d992d8c3fedf4fa3ccc216fddf02c132eeae4313498a11bdee40ea67f2680d7933339ad36ffc339294501cbc06b9377d70aee544c6c37e112d1bcce
7
- data.tar.gz: f23457093b3fd65b398770231cfc805efef41acf90419a742e7ac1e9d804e6bbddb3c1943cec9b47f8fd11a56833a31367d72dcd834595a6f15bd6b671d2bc09
6
+ metadata.gz: 9404ac27ff75311447320c4a0092a11dda3bd82fb7db8b369ccbb65efb7f291b445ea3d8867c8247baad9fb2efbe8f7aa9437c1a02529add19bdf416b4f5ff8c
7
+ data.tar.gz: 0703e28305e99057211826a13ba2d8992d52238fbaeb4b71e10a29ab2f3f130ae7efc91248f663bb1e4215b1b0bc484bcf05a6ad0a1842f93d76b3fce229ca76
data/README.md CHANGED
@@ -103,7 +103,8 @@ Args and environment variables can be tailored to a specific build phase by addi
103
103
  There may be times where feature detection plus flags just aren't enough. As an example, you may wish to configure and run multiple processes.
104
104
 
105
105
  * `--instructions=path` - a dockerfile fragment to be inserted into the final document.
106
- * `--migration=cmd` - a replacement (generally a script) for `db:prepare`/`db:migrate`.
106
+ * `--migrate=cmd` - a replacement (generally a script) for `db:prepare`/`db:migrate`.
107
+ * `--no-gemfile-updates` - do not modify my gemfile.
107
108
  * `--procfile=path` - a [Procfile](https://github.com/ddollar/foreman#foreman) to use in place of launching Rails directly.
108
109
 
109
110
  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`.
data/lib/fly_replay.rb ADDED
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fly
4
+ class FlyReplay
5
+ def initialize(app)
6
+ @app = app
7
+ end
8
+
9
+ def call(env)
10
+ # replay /prometheus/* to the prom proxy in bubblegum
11
+ if env["PATH_INFO"].starts_with?("/prometheus")
12
+ return [307, { "Fly-Replay" => "app=flyio-bubblegum-api" }, []]
13
+ end
14
+
15
+ # replay /debug to the debug app. unsure if this is actually used
16
+ if env["PATH_INFO"].starts_with?("/debug")
17
+ return [307, { "Fly-Replay" => "app=debug" }, []]
18
+ end
19
+
20
+ @status, @headers, @response = @app.call(env)
21
+
22
+ context = OpenTelemetry::Trace.current_span.context
23
+ @headers["fly-trace-id"] = context.trace_id.unpack1("H*")
24
+ @headers["fly-span-id"] = context.span_id.unpack1("H*")
25
+
26
+ [@status, @headers, @response]
27
+ end
28
+ end
29
+ end
@@ -14,6 +14,7 @@ class DockerfileGenerator < Rails::Generators::Base
14
14
  "ci" => false,
15
15
  "compose" => false,
16
16
  "fullstaq" => false,
17
+ "gemfile-updates" => true,
17
18
  "jemalloc" => false,
18
19
  "label" => {},
19
20
  "link" => true,
@@ -219,6 +220,9 @@ class DockerfileGenerator < Rails::Generators::Base
219
220
  class_option "private-gemserver-domain", type: :string, default: OPTION_DEFAULTS["private-gemserver-domain"],
220
221
  desc: "domain name of a private gemserver used when installing application gems"
221
222
 
223
+ class_option "gemfile-updates", type: :boolean, default: OPTION_DEFAULTS["gemfile-updates"],
224
+ desc: "include gemfile updates"
225
+
222
226
 
223
227
  class_option "add-base", type: :array, default: [],
224
228
  desc: "additional packages to install for both build and deploy"
@@ -510,6 +514,8 @@ private
510
514
  end
511
515
 
512
516
  def install_gems
517
+ return unless options["gemfile-updates"]
518
+
513
519
  ENV["BUNDLE_IGNORE_MESSAGES"] = "1"
514
520
 
515
521
  gemfile = IO.read("Gemfile")
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.10
4
+ version: 1.6.11
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-05-01 00:00:00.000000000 Z
11
+ date: 2024-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -37,6 +37,7 @@ files:
37
37
  - Rakefile
38
38
  - lib/dockerfile-rails.rb
39
39
  - lib/dockerfile-rails/scanner.rb
40
+ - lib/fly_replay.rb
40
41
  - lib/generators/dockerfile_generator.rb
41
42
  - lib/generators/templates/Dockerfile.erb
42
43
  - lib/generators/templates/_apt_install.erb