kuby-core 0.19.0 → 0.20.0

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: c0d4130691d41056e212ebe92b1f0284b13fcd3b2459d5c86f05ad9f3c5a5261
4
- data.tar.gz: 5685c32062c4883261fbfe9bb14bef8c69d3d09d585a8c58bfe908455ae87856
3
+ metadata.gz: c3e98a72e5798436209eb36042b9cb6e59ea7491d772c3b04ea04ea12b81b612
4
+ data.tar.gz: 1a8b6a6e8704c885d3326e4a8e4e2aaf77fff5f67d9a9c4d8bb3cac546798fd6
5
5
  SHA512:
6
- metadata.gz: 3339e14436ef7bf06037a81f1acdf00753f15021a1bef00d8e13ad958c6f56f3aa913b03b698980e7b71bc3b3640fc5de80fa781eefe83fc04c935e1e38dfd54
7
- data.tar.gz: cb1bb78c42467746fbd92ed8a1350b1a1edb71863a92d4c50f6e7e08eb9c13f1768fd2d3ecd1452dc50b34ad820c9e701ea879df1b86b7bf75c1d51b45674e09
6
+ metadata.gz: 17f78515bf3e52d54299f678e3f55a6a11e4b5ad0272aff8051b447bc0904787df10f382fea3ecb470d6c46f67b0fb935817f4bd3816d292a4e5f55f37e8594a
7
+ data.tar.gz: 200a1df0299181a7334e4deaa737f69b6d3f30cbc5583c71be73b7ae088cb7f71e3bdf4b3418b6f1173ed3161bde00387410ecbe2b85d8f4c10bca6fa8a5ad64
data/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  ## Unreleased
2
+
3
+ ## 0.20.0
2
4
  * Modify the Rails generator to add the `activerecord-cockroachdb-adapter` to your bundle.
5
+ * Add the `LayerStack#replace` and corresponding `Docker::Spec#replace` methods for replacing phases. This can be a lot easier than using `#insert` and `#delete`, which can mess with the relative order of the phases and cause surprising results.
6
+ * Don't run init containers for creating and migrating the database if database management is turned off.
3
7
 
4
8
  ## 0.19.0
5
- * Add support to configure the number of web workers for puma (#124, @zhalltyemill)
9
+ * Add support for configuring the number of web workers for puma (#124, @zhalltyemill)
6
10
 
7
11
  ## 0.18.0
8
12
  * Add the ability to specify your app's root directory.
data/bin/kuby CHANGED
@@ -2,5 +2,7 @@
2
2
 
3
3
  $stdout.sync = true
4
4
 
5
+ require 'sorbet-runtime'
6
+
5
7
  require 'kuby'
6
8
  exit Kuby::Commands.run(ARGV)
@@ -94,6 +94,15 @@ module Kuby
94
94
  end
95
95
  end
96
96
 
97
+ # T::Sig::WithoutRuntime.sig { params(name: Symbol, layer: Layer).void }
98
+ def replace(name, layer)
99
+ unless layers.include?(name)
100
+ raise ArgumentError, "Could not find existing layer '#{name}'"
101
+ end
102
+
103
+ layers[name] = layer
104
+ end
105
+
97
106
  # T::Sig::WithoutRuntime.sig { params(name: Symbol).void }
98
107
  def delete(name)
99
108
  stack.delete(name)
@@ -145,6 +145,11 @@ module Kuby
145
145
  layer_stack.insert(name, layer, options, &block)
146
146
  end
147
147
 
148
+ # T::Sig::WithoutRuntime.sig { params(name: Symbol, layer: Layer).void }
149
+ def replace(name, layer)
150
+ layer_stack.replace(name, layer)
151
+ end
152
+
148
153
  # T::Sig::WithoutRuntime.sig { params(name: Symbol).void }
149
154
  def delete(name)
150
155
  layer_stack.delete(name)
@@ -106,12 +106,14 @@ module Kuby
106
106
  image image_with_tag
107
107
  end
108
108
 
109
- init_container(:create_db) do
110
- image image_with_tag
111
- end
109
+ if spec.manage_database?
110
+ init_container(:create_db) do
111
+ image image_with_tag
112
+ end
112
113
 
113
- init_container(:migrate_db) do
114
- image image_with_tag
114
+ init_container(:migrate_db) do
115
+ image image_with_tag
116
+ end
115
117
  end
116
118
  end
117
119
  end
@@ -308,36 +310,38 @@ module Kuby
308
310
  end
309
311
  end
310
312
 
311
- init_container(:create_db) do
312
- name "#{kube_spec.selector_app}-create-db"
313
- command %w(bundle exec rake kuby:rails_app:db:bootstrap)
313
+ if kube_spec.manage_database?
314
+ init_container(:create_db) do
315
+ name "#{kube_spec.selector_app}-create-db"
316
+ command %w(bundle exec rake kuby:rails_app:db:bootstrap)
314
317
 
315
- env_from do
316
- config_map_ref do
317
- name kube_spec.config_map.metadata.name
318
+ env_from do
319
+ config_map_ref do
320
+ name kube_spec.config_map.metadata.name
321
+ end
318
322
  end
319
- end
320
323
 
321
- env_from do
322
- secret_ref do
323
- name kube_spec.app_secrets.metadata.name
324
+ env_from do
325
+ secret_ref do
326
+ name kube_spec.app_secrets.metadata.name
327
+ end
324
328
  end
325
329
  end
326
- end
327
330
 
328
- init_container(:migrate_db) do
329
- name "#{kube_spec.selector_app}-migrate-db"
330
- command %w(bundle exec rake kuby:rails_app:db:migrate)
331
+ init_container(:migrate_db) do
332
+ name "#{kube_spec.selector_app}-migrate-db"
333
+ command %w(bundle exec rake kuby:rails_app:db:migrate)
331
334
 
332
- env_from do
333
- config_map_ref do
334
- name kube_spec.config_map.metadata.name
335
+ env_from do
336
+ config_map_ref do
337
+ name kube_spec.config_map.metadata.name
338
+ end
335
339
  end
336
- end
337
340
 
338
- env_from do
339
- secret_ref do
340
- name kube_spec.app_secrets.metadata.name
341
+ env_from do
342
+ secret_ref do
343
+ name kube_spec.app_secrets.metadata.name
344
+ end
341
345
  end
342
346
  end
343
347
  end
data/lib/kuby/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # typed: true
2
2
 
3
3
  module Kuby
4
- VERSION = '0.19.0'.freeze
4
+ VERSION = '0.20.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-27 00:00:00.000000000 Z
11
+ date: 2023-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize