dockerfile-rails 0.4.8 → 0.4.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9b601d4f4e8ba2476ebdc5a721aa605f605b54b36cd2ebda0d8959035ed6621
4
- data.tar.gz: 8f87d53ade0657596d6b0915c1523b477d213684019dfb66fd48949a86568186
3
+ metadata.gz: 92c7394bd97da528362105514f095458b56872645ce0c3082c748c7bee22c54f
4
+ data.tar.gz: e7a158e41126aa6321e5b4461951b6323f7fa950f8eef8eb366ee436454c0057
5
5
  SHA512:
6
- metadata.gz: cfe3dc014ee68c023c65c8dfe1716ba9d05ac6266bf0b1ef478f73968c974be78303d9b108ef91e475cf81fd9398185d46ee4b13ebb9435ca15357db31a71c8a
7
- data.tar.gz: 25124c64efc2e59bdd00e608c72758ea6996655051f15cf85242b99311c0d04f700d98c13d936d5e752516eaf58f777964c5e113b0203606a7f0a535e6082ccf
6
+ metadata.gz: 35619e605b9ed5176157c841efb21f4cfec9029c6383732d440bd9a440144719c8cc62e43974124148d5dbc1fb2705bd0160d4581f6829aa8ccdeb0040b665bb
7
+ data.tar.gz: 94b595caa9b67e1d814b863f535eae373dca80a5b14d410122a0b0199fdb46955ddb6d7609f3ce58945e9419047da6128864a751f8af36dbb2d8230bfd87f1d8
data/README.md CHANGED
@@ -17,6 +17,7 @@ General options:
17
17
 
18
18
  * `--force` - overwrite existing files
19
19
  * `--ci` - include test gems in deployed image
20
+ * `--bin-cd` - adjust binstubs to set current working directory
20
21
  * `--platform=s` - specify target platform. See [FROM](https://docs.docker.com/engine/reference/builder/#from) for details.
21
22
  * `--cache` - use build caching to speed up builds
22
23
  * `--parallel` - use multi-stage builds to install gems and node modules in parallel
@@ -55,9 +56,14 @@ To assis with this process, outputs of tests can be captured automatically. Thi
55
56
 
56
57
  ```
57
58
  rake test:capture
58
- TEST_CAPTURE=1 ruby test/test_minimal.rb
59
59
  ```
60
60
 
61
+ If you are running a single test, the following environment variables settings may be helpful:
62
+
63
+ * `RAILS_ENV=TEST` will match the environment used to produce the captured outputs.
64
+ * `TEST_CAPTURE=1` will capture test results.
65
+ * `TEST_KEEP=1` will leave the test app behind for inspection after the test completes.
66
+
61
67
  ## Links
62
68
 
63
69
  Many of the following links relate to the current development status with respect to Rails 7.1 and will be removed once that is resolved.
@@ -7,6 +7,9 @@ class DockerfileGenerator < Rails::Generators::Base
7
7
  class_option :ci, type: :boolean, default: false,
8
8
  desc: 'include test gems in bundle'
9
9
 
10
+ class_option 'bin-cd', type: :boolean, default: false,
11
+ desc: 'modify binstubs to set working directory'
12
+
10
13
  class_option :cache, type: :boolean, default: false,
11
14
  desc: 'use build cache to speed up installs'
12
15
 
@@ -210,6 +213,11 @@ private
210
213
  binfixups.unshift "chmod +x bin/*"
211
214
  end
212
215
 
216
+ # optionally, adjust cwd
217
+ if options['bin-cd']
218
+ binfixups.push %{sed -i '/^#!/aDir.chdir File.expand_path("..", __dir__)' /app/bin/*}
219
+ end
220
+
213
221
  binfixups
214
222
  end
215
223
 
@@ -19,7 +19,7 @@ WORKDIR /rails
19
19
  # Set production environment
20
20
  ENV RAILS_ENV="production" \
21
21
  BUNDLE_PATH="vendor/bundle" \
22
- BUNDLE_WITHOUT="<%= options.ci? ? 'test' : 'development:test' %>"
22
+ BUNDLE_WITHOUT="<%= options.ci? ? 'development' : 'development:test' %>"
23
23
 
24
24
  # Update gems and preinstall the desired version of bundler
25
25
  ARG BUNDLER_VERSION=<%= Bundler::VERSION %>
@@ -93,7 +93,11 @@ RUN bundle exec bootsnap precompile app/ lib/
93
93
 
94
94
  <% end -%>
95
95
  <% unless binfile_fixups.empty? -%>
96
- # Adjust binfiles to be executable on Linux
96
+ <% if options['bin-cd'] and binfile_fixups.length == 1 -%>
97
+ # Adjust binfiles to set current working directory
98
+ <% else -%>
99
+ # Adjust binfiles to be executable on Linux<%= options['bin-cd'] ? ' and set current working directory' : '' %>
100
+ <% end -%>
97
101
  <%= "RUN " + binfile_fixups.join(" && \\\n ") %>
98
102
 
99
103
  <% 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.8
4
+ version: 0.4.9
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-22 00:00:00.000000000 Z
11
+ date: 2023-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails