kuby-core 0.17.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +44 -0
  3. data/Gemfile +6 -2
  4. data/Rakefile +5 -3
  5. data/bin/tapioca +29 -0
  6. data/kuby-core.gemspec +9 -11
  7. data/lib/kuby/basic_logger.rb +34 -34
  8. data/lib/kuby/cli_base.rb +43 -43
  9. data/lib/kuby/commands.rb +94 -11
  10. data/lib/kuby/definition.rb +12 -12
  11. data/lib/kuby/dependable.rb +20 -0
  12. data/lib/kuby/dependency.rb +14 -0
  13. data/lib/kuby/docker/alpine.rb +10 -10
  14. data/lib/kuby/docker/app_image.rb +11 -11
  15. data/lib/kuby/docker/app_phase.rb +36 -0
  16. data/lib/kuby/docker/assets_phase.rb +2 -2
  17. data/lib/kuby/docker/bundler_phase.rb +42 -40
  18. data/lib/kuby/docker/cli.rb +71 -43
  19. data/lib/kuby/docker/copy_phase.rb +7 -7
  20. data/lib/kuby/docker/credentials.rb +1 -0
  21. data/lib/kuby/docker/debian.rb +10 -10
  22. data/lib/kuby/docker/distro.rb +13 -13
  23. data/lib/kuby/docker/docker_uri.rb +20 -20
  24. data/lib/kuby/docker/dockerfile.rb +48 -39
  25. data/lib/kuby/docker/image.rb +66 -54
  26. data/lib/kuby/docker/inline_layer.rb +4 -4
  27. data/lib/kuby/docker/layer.rb +6 -6
  28. data/lib/kuby/docker/layer_stack.rb +35 -35
  29. data/lib/kuby/docker/local_tags.rb +16 -16
  30. data/lib/kuby/docker/package_list.rb +16 -16
  31. data/lib/kuby/docker/package_phase.rb +16 -16
  32. data/lib/kuby/docker/packages/managed_package.rb +13 -13
  33. data/lib/kuby/docker/packages/nodejs.rb +5 -5
  34. data/lib/kuby/docker/packages/package.rb +8 -8
  35. data/lib/kuby/docker/packages/simple_managed_package.rb +7 -7
  36. data/lib/kuby/docker/packages/yarn.rb +6 -6
  37. data/lib/kuby/docker/remote_tags.rb +16 -16
  38. data/lib/kuby/docker/setup_phase.rb +18 -20
  39. data/lib/kuby/docker/spec.rb +93 -72
  40. data/lib/kuby/docker/timestamp_tag.rb +16 -11
  41. data/lib/kuby/docker/timestamped_image.rb +59 -40
  42. data/lib/kuby/docker/webserver_phase.rb +20 -20
  43. data/lib/kuby/docker/yarn_phase.rb +29 -5
  44. data/lib/kuby/docker.rb +2 -1
  45. data/lib/kuby/kubernetes/bare_metal_provider.rb +9 -9
  46. data/lib/kuby/kubernetes/deployer.rb +22 -10
  47. data/lib/kuby/kubernetes/docker_config.rb +1 -0
  48. data/lib/kuby/kubernetes/provider.rb +1 -0
  49. data/lib/kuby/kubernetes/spec.rb +47 -7
  50. data/lib/kuby/plugin.rb +22 -1
  51. data/lib/kuby/plugins/nginx_ingress.rb +8 -6
  52. data/lib/kuby/plugins/rails_app/assets.rb +16 -4
  53. data/lib/kuby/plugins/rails_app/assets_image.rb +17 -8
  54. data/lib/kuby/plugins/rails_app/crdb/plugin.rb +473 -0
  55. data/lib/kuby/plugins/rails_app/crdb.rb +9 -0
  56. data/lib/kuby/plugins/rails_app/database.rb +12 -8
  57. data/lib/kuby/plugins/rails_app/generators/kuby.rb +17 -16
  58. data/lib/kuby/plugins/rails_app/plugin.rb +29 -18
  59. data/lib/kuby/plugins/rails_app/sqlite.rb +7 -3
  60. data/lib/kuby/plugins/rails_app/tasks.rake +25 -12
  61. data/lib/kuby/plugins/rails_app.rb +1 -0
  62. data/lib/kuby/plugins/system.rb +16 -0
  63. data/lib/kuby/plugins.rb +1 -0
  64. data/lib/kuby/railtie.rb +31 -1
  65. data/lib/kuby/tasks.rb +72 -5
  66. data/lib/kuby/trailing_hash.rb +2 -2
  67. data/lib/kuby/utils/sem_ver/constraint.rb +68 -0
  68. data/lib/kuby/utils/sem_ver/constraint_set.rb +25 -0
  69. data/lib/kuby/utils/sem_ver/version.rb +49 -0
  70. data/lib/kuby/utils/sem_ver.rb +17 -0
  71. data/lib/kuby/utils/which.rb +65 -0
  72. data/lib/kuby/utils.rb +7 -1
  73. data/lib/kuby/version.rb +1 -1
  74. data/lib/kuby.rb +37 -2
  75. data/rbi/kuby-core.rbi +2128 -0
  76. data/spec/docker/spec_spec.rb +50 -26
  77. data/spec/dummy/app/channels/application_cable/channel.rb +2 -1
  78. data/spec/dummy/app/channels/application_cable/connection.rb +2 -1
  79. data/spec/dummy/app/controllers/application_controller.rb +2 -1
  80. data/spec/dummy/app/jobs/application_job.rb +2 -1
  81. data/spec/dummy/app/mailers/application_mailer.rb +2 -1
  82. data/spec/dummy/app/models/application_record.rb +2 -1
  83. data/spec/dummy/config/application.rb +2 -1
  84. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -1
  85. data/spec/dummy/config/routes.rb +2 -1
  86. data/spec/dummy/test/application_system_test_case.rb +2 -1
  87. data/spec/dummy/test/channels/application_cable/connection_test.rb +2 -1
  88. data/spec/spec_helper.rb +13 -1
  89. metadata +44 -39
  90. data/lib/kuby/plugins/rails_app/mysql.rb +0 -158
  91. data/lib/kuby/plugins/rails_app/postgres.rb +0 -163
data/rbi/kuby-core.rbi ADDED
@@ -0,0 +1,2128 @@
1
+ # typed: strong
2
+ class KubyGenerator < Rails::Generators::Base
3
+ sig { returns(T.untyped) }
4
+ def create_initializer_file; end
5
+
6
+ sig { returns(T.untyped) }
7
+ def create_config_file; end
8
+
9
+ sig { returns(T.untyped) }
10
+ def create_dockerignore; end
11
+
12
+ sig { returns(T.untyped) }
13
+ def app_name; end
14
+ end
15
+
16
+ module Kuby
17
+ VERSION = '0.17.0'.freeze
18
+
19
+ class BasicLogger < Logger
20
+ extend T::Sig
21
+
22
+ sig do
23
+ override.params(
24
+ logdev: T.any(String, IO, StringIO, NilClass),
25
+ shift_age: Integer,
26
+ shift_size: Integer,
27
+ level: Integer,
28
+ progname: T.nilable(String),
29
+ formatter: T.nilable(FormatterProcType),
30
+ datetime_format: T.nilable(String),
31
+ shift_period_suffix: T.nilable(String)
32
+ ).void
33
+ end
34
+ def initialize(logdev, shift_age = 0, shift_size = 1048576, level: DEBUG, progname: nil, formatter: nil, datetime_format: nil, shift_period_suffix: '%Y%m%d'); end
35
+
36
+ sig { override.params(progname_or_msg: T.untyped, block: T.nilable(T.proc.returns(T.untyped))).void }
37
+ def info(progname_or_msg = nil, &block); end
38
+
39
+ sig { override.params(progname_or_msg: T.untyped, block: T.nilable(T.proc.returns(T.untyped))).void }
40
+ def fatal(progname_or_msg = nil, &block); end
41
+
42
+ sig { params(out: T.any(IO, StringIO), err: T.any(IO, StringIO), block: T.proc.void).void }
43
+ def with_pipes(out = STDOUT, err = STDERR, &block); end
44
+
45
+ sig { returns(T.nilable(Process::Status)) }
46
+ def last_status; end
47
+ end
48
+
49
+ class CLIBase
50
+ extend T::Sig
51
+ BeforeCallback = T.type_alias { T.proc.params(cmd: T::Array[String]).void }
52
+ AfterCallback = T.type_alias { T.proc.params(cmd: T::Array[String], last_status: T.nilable(Process::Status)).void }
53
+
54
+ sig { returns(T.nilable(Process::Status)) }
55
+ def last_status; end
56
+
57
+ sig { params(block: BeforeCallback).void }
58
+ def before_execute(&block); end
59
+
60
+ sig { params(block: AfterCallback).void }
61
+ def after_execute(&block); end
62
+
63
+ sig { params(out: T.any(IO, StringIO), err: T.any(IO, StringIO), block: T.proc.void).void }
64
+ def with_pipes(out = STDOUT, err = STDERR, &block); end
65
+
66
+ sig { returns(T.nilable(T.any(IO, StringIO))) }
67
+ def stdout; end
68
+
69
+ sig { params(new_stdout: T.nilable(T.any(IO, StringIO))).void }
70
+ def stdout=(new_stdout); end
71
+
72
+ sig { returns(T.nilable(T.any(IO, StringIO))) }
73
+ def stderr; end
74
+
75
+ sig { params(new_stderr: T.nilable(T.any(IO, StringIO))).void }
76
+ def stderr=(new_stderr); end
77
+
78
+ sig { params(cmd: T::Array[String], block: T.proc.params(stdin: IO).void).void }
79
+ def open3_w(cmd, &block); end
80
+
81
+ sig { params(cmd: T::Array[String]).void }
82
+ def execc(cmd); end
83
+
84
+ sig { params(cmd: T::Array[String]).void }
85
+ def systemm(cmd); end
86
+
87
+ sig { params(cmd: T::Array[String]).void }
88
+ def systemm_default(cmd); end
89
+
90
+ sig { params(cmd: T::Array[String]).void }
91
+ def systemm_open3(cmd); end
92
+
93
+ sig { params(cmd: T::Array[String]).returns(String) }
94
+ def backticks(cmd); end
95
+
96
+ sig { params(cmd: T::Array[String]).returns(String) }
97
+ def backticks_default(cmd); end
98
+
99
+ sig { params(cmd: T::Array[String]).returns(String) }
100
+ def backticks_open3(cmd); end
101
+
102
+ sig { params(cmd: T::Array[String]).void }
103
+ def run_before_callbacks(cmd); end
104
+
105
+ sig { params(cmd: T::Array[String]).void }
106
+ def run_after_callbacks(cmd); end
107
+
108
+ sig { params(status: Process::Status).void }
109
+ def last_status=(status); end
110
+
111
+ sig { returns(Symbol) }
112
+ def status_key; end
113
+
114
+ sig { returns(Symbol) }
115
+ def stdout_key; end
116
+
117
+ sig { returns(Symbol) }
118
+ def stderr_key; end
119
+ end
120
+
121
+ class Commands
122
+ extend T::Sig
123
+ extend GLI::App
124
+
125
+ sig { returns(Kuby::Tasks) }
126
+ def self.tasks; end
127
+
128
+ sig { params(global_options: T::Hash[T.any(String, Symbol), T.any(String, Integer)]).void }
129
+ def self.load_kuby_config!(global_options); end
130
+ end
131
+
132
+ class Definition
133
+ extend T::Sig
134
+
135
+ sig { returns(String) }
136
+ attr_reader :app_name
137
+
138
+ sig { params(app_name: String, block: T.nilable(T.proc.void)).void }
139
+ def initialize(app_name, &block); end
140
+
141
+ sig { params(name: Symbol, block: T.nilable(T.proc.void)).returns(Kuby::Environment) }
142
+ def environment(name = Kuby.env, &block); end
143
+
144
+ sig { returns(T::Hash[Symbol, Kuby::Environment]) }
145
+ def environments; end
146
+ end
147
+
148
+ class Dependable
149
+ sig { returns(T.untyped) }
150
+ attr_reader :name
151
+
152
+ sig { returns(T.untyped) }
153
+ attr_reader :version_or_callable
154
+
155
+ sig { params(name: T.untyped, version_or_callable: T.untyped).void }
156
+ def initialize(name, version_or_callable); end
157
+
158
+ sig { returns(T.untyped) }
159
+ def version; end
160
+ end
161
+
162
+ class Dependency
163
+ sig { returns(T.untyped) }
164
+ attr_reader :name
165
+
166
+ sig { returns(T.untyped) }
167
+ attr_reader :constraints
168
+
169
+ sig { params(name: T.untyped, constraints: T.untyped).void }
170
+ def initialize(name, *constraints); end
171
+
172
+ sig { params(dependable: T.untyped).returns(T.untyped) }
173
+ def satisfied_by?(dependable); end
174
+ end
175
+
176
+ class Environment
177
+ sig { returns(T.untyped) }
178
+ attr_reader :name
179
+
180
+ sig { returns(T.untyped) }
181
+ attr_reader :definition
182
+
183
+ sig { returns(T.untyped) }
184
+ attr_accessor :configured
185
+
186
+ sig { params(name: T.untyped, definition: T.untyped, block: T.untyped).void }
187
+ def initialize(name, definition, &block); end
188
+
189
+ sig { params(block: T.untyped).returns(T.untyped) }
190
+ def docker(&block); end
191
+
192
+ sig { params(block: T.untyped).returns(T.untyped) }
193
+ def kubernetes(&block); end
194
+
195
+ sig { returns(T.untyped) }
196
+ def app_name; end
197
+ end
198
+
199
+ class Plugin
200
+ sig { returns(T.untyped) }
201
+ attr_reader :environment
202
+
203
+ sig { params(environment: T.untyped).void }
204
+ def initialize(environment); end
205
+
206
+ sig { returns(T.untyped) }
207
+ def self.task_dirs; end
208
+
209
+ sig { params(dependable_name: T.untyped, constraints: T.untyped).returns(T.untyped) }
210
+ def self.depends_on(dependable_name, *constraints); end
211
+
212
+ sig { returns(T.untyped) }
213
+ def self.dependencies; end
214
+
215
+ sig { params(block: T.untyped).returns(T.untyped) }
216
+ def configure(&block); end
217
+
218
+ sig { returns(T.untyped) }
219
+ def setup; end
220
+
221
+ sig { returns(T.untyped) }
222
+ def remove; end
223
+
224
+ sig { returns(T.untyped) }
225
+ def resources; end
226
+
227
+ sig { returns(T.untyped) }
228
+ def docker_images; end
229
+
230
+ sig { returns(T.untyped) }
231
+ def after_configuration; end
232
+
233
+ sig { returns(T.untyped) }
234
+ def before_setup; end
235
+
236
+ sig { returns(T.untyped) }
237
+ def after_setup; end
238
+
239
+ sig { params(manifest: T.untyped).returns(T.untyped) }
240
+ def before_deploy(manifest); end
241
+
242
+ sig { params(manifest: T.untyped).returns(T.untyped) }
243
+ def after_deploy(manifest); end
244
+
245
+ sig { returns(T.untyped) }
246
+ def after_initialize; end
247
+ end
248
+
249
+ class PluginRegistry
250
+ include Enumerable
251
+ ANY = 'any'.freeze
252
+
253
+ sig { params(plugin_name: T.untyped, plugin_klass: T.untyped, environment: T.untyped).returns(T.untyped) }
254
+ def register(plugin_name, plugin_klass, environment: ANY); end
255
+
256
+ sig { params(plugin_name: T.untyped, environment: T.untyped).returns(T.untyped) }
257
+ def find(plugin_name, environment: Kuby.env); end
258
+
259
+ sig { params(block: T.untyped).returns(T.untyped) }
260
+ def each(&block); end
261
+
262
+ sig { returns(T.untyped) }
263
+ def plugins; end
264
+ end
265
+
266
+ class Tasks
267
+ sig { returns(T.untyped) }
268
+ attr_reader :environment
269
+
270
+ sig { params(environment: T.untyped).void }
271
+ def initialize(environment); end
272
+
273
+ sig { params(only: T.untyped).returns(T.untyped) }
274
+ def print_dockerfiles(only: []); end
275
+
276
+ sig { params(only: T.untyped).returns(T.untyped) }
277
+ def setup(only: []); end
278
+
279
+ sig { params(name: T.untyped).returns(T.untyped) }
280
+ def remove_plugin(name); end
281
+
282
+ sig { params(all: T.untyped).returns(T.untyped) }
283
+ def list_plugins(all: false); end
284
+
285
+ sig { params(tasks: T.untyped).returns(T.untyped) }
286
+ def run_rake_tasks(tasks); end
287
+
288
+ sig { returns(T.untyped) }
289
+ def list_rake_tasks; end
290
+
291
+ sig do
292
+ params(
293
+ build_args: T.untyped,
294
+ docker_args: T.untyped,
295
+ only: T.untyped,
296
+ ignore_missing_args: T.untyped,
297
+ context: T.untyped,
298
+ cache_from_latest: T.untyped
299
+ ).returns(T.untyped)
300
+ end
301
+ def build(build_args = {}, docker_args = [], only: [], ignore_missing_args: false, context: nil, cache_from_latest: true); end
302
+
303
+ sig { params(only: T.untyped).returns(T.untyped) }
304
+ def push(only: []); end
305
+
306
+ sig { params(image: T.untyped).returns(T.untyped) }
307
+ def push_image(image); end
308
+
309
+ sig { params(tag: T.untyped).returns(T.untyped) }
310
+ def deploy(tag = nil); end
311
+
312
+ sig { returns(T.untyped) }
313
+ def rollback; end
314
+
315
+ sig { params(kind: T.untyped, name_pattern: T.untyped).returns(T.untyped) }
316
+ def print_resources(kind = nil, name_pattern = nil); end
317
+
318
+ sig { returns(T.untyped) }
319
+ def print_kubeconfig; end
320
+
321
+ sig { returns(T.untyped) }
322
+ def print_images; end
323
+
324
+ sig { params(cmd: T.untyped).returns(T.untyped) }
325
+ def kubectl(*cmd); end
326
+
327
+ sig { returns(T.untyped) }
328
+ def remote_logs; end
329
+
330
+ sig { returns(T.untyped) }
331
+ def remote_status; end
332
+
333
+ sig { params(cmd: T.untyped).returns(T.untyped) }
334
+ def remote_exec(cmd); end
335
+
336
+ sig { params(cmd: T.untyped).returns(T.untyped) }
337
+ def remote_system(cmd); end
338
+
339
+ sig { returns(T.untyped) }
340
+ def remote_shell; end
341
+
342
+ sig { returns(T.untyped) }
343
+ def remote_console; end
344
+
345
+ sig { returns(T.untyped) }
346
+ def remote_dbconsole; end
347
+
348
+ sig { returns(T.untyped) }
349
+ def remote_restart; end
350
+
351
+ sig { params(docker_args: T.untyped).returns(T.untyped) }
352
+ def check_platform(docker_args); end
353
+
354
+ sig { params(build_args: T.untyped).returns(T.untyped) }
355
+ def check_build_args(build_args); end
356
+
357
+ sig { params(image: T.untyped).returns(T.untyped) }
358
+ def perform_docker_login_if_necessary(image); end
359
+
360
+ sig { returns(T.untyped) }
361
+ def get_first_pod; end
362
+
363
+ sig { returns(T.untyped) }
364
+ def namespace; end
365
+
366
+ sig { returns(T.untyped) }
367
+ def match_labels; end
368
+
369
+ sig { returns(T.untyped) }
370
+ def rails_app; end
371
+
372
+ sig { returns(T.untyped) }
373
+ def kubernetes_cli; end
374
+
375
+ sig { returns(T.untyped) }
376
+ def helm_cli; end
377
+
378
+ sig { returns(T.untyped) }
379
+ def docker_cli; end
380
+
381
+ sig { returns(T.untyped) }
382
+ def kubernetes; end
383
+
384
+ sig { returns(T.untyped) }
385
+ def docker; end
386
+ end
387
+
388
+ class TrailingHash < Hash
389
+ sig { params(block: T.untyped).returns(T.untyped) }
390
+ def each(&block); end
391
+ end
392
+
393
+ module Docker
394
+ LATEST_TAG = T.let('latest'.freeze, String)
395
+
396
+ class Alpine < Distro
397
+ SHELL_EXE = T.let('/bin/sh'.freeze, String)
398
+ DEFAULT_PACKAGES = T.let([
399
+ [:ca_certificates, nil],
400
+ [:nodejs, '12.14.1'],
401
+ [:yarn, '1.21.1'],
402
+ [:c_toolchain, nil],
403
+ [:tzdata, nil],
404
+ [:git, nil]
405
+ ].freeze, T::Array[[Symbol, T.nilable(String)]])
406
+
407
+ sig { returns(Layer) }
408
+ attr_reader :phase
409
+
410
+ sig { override.params(packages: T::Array[Distro::PackageImpl], into: Dockerfile).void }
411
+ def install(packages, into:); end
412
+
413
+ sig { override.returns(T::Array[[Symbol, T.nilable(String)]]) }
414
+ def default_packages; end
415
+
416
+ sig { override.returns(String) }
417
+ def shell_exe; end
418
+
419
+ sig { params(packages: T::Array[Distro::PackageImpl], dockerfile: Dockerfile).void }
420
+ def install_managed(packages, dockerfile); end
421
+
422
+ sig { params(packages: T::Array[Distro::PackageImpl], dockerfile: Dockerfile).void }
423
+ def install_unmanaged(packages, dockerfile); end
424
+ end
425
+
426
+ class AppImage < ::Kuby::Docker::TimestampedImage
427
+ extend T::Sig
428
+
429
+ sig do
430
+ params(
431
+ dockerfile: T.any(Dockerfile, T.proc.returns(Dockerfile)),
432
+ image_url: String,
433
+ credentials: Credentials,
434
+ registry_index_url: T.nilable(String),
435
+ main_tag: T.nilable(String),
436
+ alias_tags: T::Array[String]
437
+ ).void
438
+ end
439
+ def initialize(dockerfile, image_url, credentials, registry_index_url = nil, main_tag = nil, alias_tags = []); end
440
+ end
441
+
442
+ class AppPhase < Layer
443
+ extend T::Sig
444
+
445
+ sig { params(environment: Environment).void }
446
+ def initialize(environment); end
447
+
448
+ sig { override.params(dockerfile: Dockerfile).void }
449
+ def apply_to(dockerfile); end
450
+
451
+ sig { params(key: String, value: String).void }
452
+ def env(key, value); end
453
+ end
454
+
455
+ class AssetsPhase < Layer
456
+ extend T::Sig
457
+
458
+ sig { override.params(dockerfile: Dockerfile).void }
459
+ def apply_to(dockerfile); end
460
+ end
461
+
462
+ class BundlerPhase < Layer
463
+ extend T::Sig
464
+ DEFAULT_GEMFILE = T.let('Gemfile'.freeze, String)
465
+ DEFAULT_WITHOUT = T.let(
466
+ ['development', 'test', 'deploy'].freeze, T::Array[String]
467
+ )
468
+
469
+ sig { returns(T.nilable(String)) }
470
+ attr_reader :version
471
+
472
+ sig { params(version: String).returns(String) }
473
+ attr_writer :version
474
+
475
+ sig { returns(T.nilable(String)) }
476
+ attr_reader :gemfile
477
+
478
+ sig { params(gemfile: String).returns(String) }
479
+ attr_writer :gemfile
480
+
481
+ sig { returns(T.nilable(T::Array[String])) }
482
+ attr_reader :without
483
+
484
+ sig { params(without: T::Array[String]).returns(T::Array[String]) }
485
+ attr_writer :without
486
+
487
+ sig { returns(T.nilable(String)) }
488
+ attr_reader :executable
489
+
490
+ sig { params(executable: String).returns(String) }
491
+ attr_writer :executable
492
+
493
+ sig { params(environment: Environment).void }
494
+ def initialize(environment); end
495
+
496
+ sig { override.params(dockerfile: Dockerfile).void }
497
+ def apply_to(dockerfile); end
498
+
499
+ sig { params(paths: String).void }
500
+ def gemfiles(*paths); end
501
+
502
+ sig { returns(String) }
503
+ def default_version; end
504
+ end
505
+
506
+ class CLI < CLIBase
507
+ extend T::Sig
508
+
509
+ sig { returns(String) }
510
+ attr_reader :executable
511
+
512
+ sig { params(executable: T.nilable(String)).void }
513
+ def initialize(executable = nil); end
514
+
515
+ sig { returns(T.nilable(String)) }
516
+ def config_file; end
517
+
518
+ sig { returns(String) }
519
+ def default_config_file; end
520
+
521
+ sig { params(url: String, username: String, password: String).void }
522
+ def login(url:, username:, password:); end
523
+
524
+ sig { returns(T::Array[String]) }
525
+ def auths; end
526
+
527
+ sig do
528
+ params(
529
+ image: Image,
530
+ build_args: T::Hash[T.any(Symbol, String), String],
531
+ docker_args: T::Array[String],
532
+ context: T.nilable(String),
533
+ cache_from: T.nilable(String)
534
+ ).void
535
+ end
536
+ def build(image, build_args: {}, docker_args: [], context: nil, cache_from: nil); end
537
+
538
+ sig do
539
+ params(
540
+ image_url: String,
541
+ tag: String,
542
+ env: T::Hash[T.any(Symbol, String), String],
543
+ ports: T::Array[T.any(String, Integer)]
544
+ ).void
545
+ end
546
+ def run(image_url:, tag: 'latest', env: {}, ports: []); end
547
+
548
+ sig { params(container: String, command: String, tty: T::Boolean).returns(String) }
549
+ def exec_capture(container:, command:, tty: true); end
550
+
551
+ sig { params(image_url: String, tag: String, format: T.nilable(String)).returns(String) }
552
+ def inspect(image_url:, tag: 'latest', format: nil); end
553
+
554
+ sig { params(image_url: String, digests: T::Boolean).returns(T::Array[T::Hash[Symbol, String]]) }
555
+ def images(image_url, digests: true); end
556
+
557
+ sig { params(image_url: String, tag: String).void }
558
+ def push(image_url, tag); end
559
+
560
+ sig { params(image_url: String, tag: String).void }
561
+ def pull(image_url, tag); end
562
+
563
+ sig { returns(Symbol) }
564
+ def status_key; end
565
+
566
+ sig { returns(Symbol) }
567
+ def stdout_key; end
568
+
569
+ sig { returns(Symbol) }
570
+ def stderr_key; end
571
+ end
572
+
573
+ class CopyPhase < Layer
574
+ extend T::Sig
575
+ DEFAULT_PATHS = T.let(['./'].freeze, T::Array[String])
576
+
577
+ sig { returns(T::Array[String]) }
578
+ attr_reader :paths
579
+
580
+ sig { params(environment: Environment).void }
581
+ def initialize(environment); end
582
+
583
+ sig { params(path: String).void }
584
+ def <<(path); end
585
+
586
+ sig { params(dockerfile: Dockerfile).void }
587
+ def apply_to(dockerfile); end
588
+ end
589
+
590
+ class Credentials
591
+ extend ::KubeDSL::ValueFields
592
+ end
593
+
594
+ class Debian < Distro
595
+ SHELL_EXE = T.let('/bin/bash'.freeze, String)
596
+ DEFAULT_PACKAGES = T.let([
597
+ [:ca_certificates, nil],
598
+ [:nodejs, '12.14.1'],
599
+ [:yarn, '1.21.1']
600
+ ].freeze, T::Array[[Symbol, T.nilable(String)]])
601
+
602
+ sig { returns(Layer) }
603
+ attr_reader :phase
604
+
605
+ sig { override.params(packages: T::Array[Distro::PackageImpl], into: Dockerfile).void }
606
+ def install(packages, into:); end
607
+
608
+ sig { override.returns(T::Array[[Symbol, T.nilable(String)]]) }
609
+ def default_packages; end
610
+
611
+ sig { override.returns(String) }
612
+ def shell_exe; end
613
+
614
+ sig { params(packages: T::Array[Distro::PackageImpl], dockerfile: Dockerfile).void }
615
+ def install_managed(packages, dockerfile); end
616
+
617
+ sig { params(packages: T::Array[Distro::PackageImpl], dockerfile: Dockerfile).void }
618
+ def install_unmanaged(packages, dockerfile); end
619
+ end
620
+
621
+ class Distro
622
+ abstract!
623
+
624
+ extend T::Sig
625
+ extend T::Helpers
626
+ PackageImpl = T.type_alias { T.any(Packages::Package, Packages::ManagedPackage, Packages::SimpleManagedPackage) }
627
+ ManagedPackageImpl = T.type_alias { T.any(Packages::ManagedPackage, Packages::SimpleManagedPackage) }
628
+
629
+ sig { params(phase: Layer).void }
630
+ def initialize(phase); end
631
+
632
+ sig { params(packages: T::Array[PackageImpl], into: Dockerfile).void }
633
+ def install(packages, into:); end
634
+
635
+ sig { returns(T::Array[[Symbol, T.nilable(String)]]) }
636
+ def default_packages; end
637
+
638
+ sig { returns(String) }
639
+ def shell_exe; end
640
+ end
641
+
642
+ class DockerURI
643
+ extend T::Sig
644
+ DEFAULT_REGISTRY_HOST = T.let('docker.io'.freeze, String)
645
+ DEFAULT_REGISTRY_INDEX_HOST = T.let('index.docker.io'.freeze, String)
646
+ DEFAULT_PORT = T.let(443, Integer)
647
+
648
+ sig { params(url: String).returns(DockerURI) }
649
+ def self.parse_uri(url); end
650
+
651
+ sig { params(url: String).returns(DockerURI) }
652
+ def self.parse_index_uri(url); end
653
+
654
+ sig { params(url: String, default_host: T.nilable(String), default_port: T.nilable(Integer)).returns(DockerURI) }
655
+ def self.parse(url, default_host:, default_port:); end
656
+
657
+ sig { returns(String) }
658
+ attr_reader :host
659
+
660
+ sig { returns(Integer) }
661
+ attr_reader :port
662
+
663
+ sig { returns(String) }
664
+ attr_reader :path
665
+
666
+ sig { params(host: String, port: Integer, path: String).void }
667
+ def initialize(host, port, path); end
668
+
669
+ sig { returns(T::Boolean) }
670
+ def has_default_port?; end
671
+ end
672
+
673
+ class Dockerfile
674
+ extend T::Sig
675
+
676
+ class Command
677
+ extend T::Sig
678
+
679
+ sig { returns(T::Array[T.any(String, Integer)]) }
680
+ attr_reader :args
681
+
682
+ sig { params(args: T::Array[T.any(String, Integer)]).void }
683
+ def initialize(args); end
684
+
685
+ sig { returns(String) }
686
+ def to_s; end
687
+ end
688
+
689
+ class From < Command
690
+ sig { returns(String) }
691
+ attr_reader :image_url
692
+
693
+ sig { returns(T.nilable(String)) }
694
+ attr_reader :as
695
+
696
+ sig { params(image_url: String, as: T.nilable(String)).void }
697
+ def initialize(image_url, as: nil); end
698
+
699
+ sig { returns(String) }
700
+ def to_s; end
701
+ end
702
+
703
+ class Workdir < Command
704
+ sig { returns(String) }
705
+ def to_s; end
706
+ end
707
+
708
+ class Env < Command
709
+ sig { returns(String) }
710
+ def to_s; end
711
+ end
712
+
713
+ class Run < Command
714
+ sig { returns(String) }
715
+ def to_s; end
716
+ end
717
+
718
+ class Copy < Command
719
+ sig { returns(String) }
720
+ attr_reader :source
721
+
722
+ sig { returns(String) }
723
+ attr_reader :dest
724
+
725
+ sig { returns(T.nilable(String)) }
726
+ attr_reader :from
727
+
728
+ sig { params(source: String, dest: String, from: T.nilable(String)).void }
729
+ def initialize(source, dest, from: nil); end
730
+
731
+ sig { returns(String) }
732
+ def to_s; end
733
+ end
734
+
735
+ class Expose < Command
736
+ sig { returns(String) }
737
+ def to_s; end
738
+ end
739
+
740
+ class Cmd < Command
741
+ sig { returns(String) }
742
+ def to_s; end
743
+ end
744
+
745
+ class Arg < Command
746
+ sig { returns(String) }
747
+ def to_s; end
748
+ end
749
+
750
+ sig { returns(T::Array[Command]) }
751
+ attr_reader :commands
752
+
753
+ sig { returns(Integer) }
754
+ attr_reader :cursor
755
+
756
+ sig { void }
757
+ def initialize; end
758
+
759
+ sig { params(image_url: String, as: T.nilable(String)).void }
760
+ def from(image_url, as: nil); end
761
+
762
+ sig { params(args: String).void }
763
+ def workdir(*args); end
764
+
765
+ sig { params(args: String).void }
766
+ def env(*args); end
767
+
768
+ sig { params(args: String).void }
769
+ def arg(*args); end
770
+
771
+ sig { params(args: String).void }
772
+ def run(*args); end
773
+
774
+ sig { params(source: String, dest: String, from: T.nilable(String)).void }
775
+ def copy(source, dest, from: nil); end
776
+
777
+ sig { params(port: Integer).void }
778
+ def expose(port); end
779
+
780
+ sig { params(args: String).void }
781
+ def cmd(*args); end
782
+
783
+ sig { returns(String) }
784
+ def to_s; end
785
+
786
+ sig { returns(String) }
787
+ def checksum; end
788
+
789
+ sig { returns(T::Array[Integer]) }
790
+ def exposed_ports; end
791
+
792
+ sig { returns(T.nilable(String)) }
793
+ def current_workdir; end
794
+
795
+ sig { params(pos: Integer, block: T.proc.void).void }
796
+ def insert_at(pos, &block); end
797
+
798
+ sig { params(cmd: Command).void }
799
+ def add(cmd); end
800
+ end
801
+
802
+ class BuildError < StandardError
803
+ end
804
+
805
+ class PushError < StandardError
806
+ end
807
+
808
+ class PullError < StandardError
809
+ end
810
+
811
+ class LoginError < StandardError
812
+ end
813
+
814
+ class MissingTagError < StandardError
815
+ end
816
+
817
+ class UnsupportedDistroError < StandardError
818
+ end
819
+
820
+ class MissingPackageError < StandardError
821
+ end
822
+
823
+ class MissingDistroError < StandardError
824
+ end
825
+
826
+ class Image
827
+ extend T::Sig
828
+
829
+ sig { returns(T.nilable(String)) }
830
+ attr_reader :identifier
831
+
832
+ sig { returns(String) }
833
+ attr_reader :image_url
834
+
835
+ sig { returns(T.nilable(String)) }
836
+ attr_reader :registry_index_url
837
+
838
+ sig { returns(Kuby::Docker::Credentials) }
839
+ attr_reader :credentials
840
+
841
+ sig { returns(T.nilable(String)) }
842
+ attr_reader :main_tag
843
+
844
+ sig { returns(T::Array[String]) }
845
+ attr_reader :alias_tags
846
+
847
+ sig do
848
+ params(
849
+ dockerfile: T.any(Dockerfile, T.proc.returns(Kuby::Docker::Dockerfile)),
850
+ image_url: String,
851
+ credentials: Kuby::Docker::Credentials,
852
+ registry_index_url: T.nilable(String),
853
+ main_tag: T.nilable(String),
854
+ alias_tags: T::Array[String]
855
+ ).void
856
+ end
857
+ def initialize(dockerfile, image_url, credentials, registry_index_url = nil, main_tag = nil, alias_tags = []); end
858
+
859
+ sig { returns(Kuby::Docker::Image) }
860
+ def new_version; end
861
+
862
+ sig { returns(Kuby::Docker::Image) }
863
+ def current_version; end
864
+
865
+ sig { params(current_tag: T.nilable(String)).returns(Image) }
866
+ def previous_version(current_tag = nil); end
867
+
868
+ sig { returns(Kuby::Docker::Dockerfile) }
869
+ def dockerfile; end
870
+
871
+ sig { returns(String) }
872
+ def image_host; end
873
+
874
+ sig { returns(String) }
875
+ def registry_index_host; end
876
+
877
+ sig { returns(String) }
878
+ def registry_index_hostname; end
879
+
880
+ sig { returns(String) }
881
+ def image_hostname; end
882
+
883
+ sig { returns(String) }
884
+ def image_repo; end
885
+
886
+ sig { returns(Kuby::Docker::DockerURI) }
887
+ def image_uri; end
888
+
889
+ sig { returns(Kuby::Docker::DockerURI) }
890
+ def registry_index_uri; end
891
+
892
+ sig { returns(T::Array[String]) }
893
+ def tags; end
894
+
895
+ sig do
896
+ params(
897
+ build_args: T::Hash[String, String],
898
+ docker_args: T::Array[String],
899
+ context: T.nilable(String),
900
+ cache_from: T.nilable(String)
901
+ ).void
902
+ end
903
+ def build(build_args = {}, docker_args = [], context: nil, cache_from: nil); end
904
+
905
+ sig { params(tag: String).void }
906
+ def push(tag); end
907
+
908
+ sig { params(tag: String).void }
909
+ def pull(tag); end
910
+
911
+ sig { returns(Kuby::Docker::CLI) }
912
+ def docker_cli; end
913
+
914
+ sig { params(main_tag: String, alias_tags: T::Array[String]).returns(Image) }
915
+ def duplicate_with_tags(main_tag, alias_tags); end
916
+ end
917
+
918
+ class InlineLayer < Layer
919
+ extend T::Sig
920
+
921
+ sig { returns(T.proc.params(df: Dockerfile).void) }
922
+ attr_reader :block
923
+
924
+ sig { params(block: T.proc.params(df: Dockerfile).void).void }
925
+ def initialize(block); end
926
+
927
+ sig { override.params(dockerfile: Dockerfile).void }
928
+ def apply_to(dockerfile); end
929
+ end
930
+
931
+ class Layer
932
+ abstract!
933
+
934
+ extend T::Sig
935
+ extend T::Helpers
936
+
937
+ sig { returns(Environment) }
938
+ attr_reader :environment
939
+
940
+ sig { params(environment: Environment).void }
941
+ def initialize(environment); end
942
+
943
+ sig { params(dockerfile: Dockerfile).void }
944
+ def apply_to(dockerfile); end
945
+ end
946
+
947
+ class LayerStack
948
+ include Enumerable
949
+ extend T::Sig
950
+ extend T::Generic
951
+ Elem = type_member { { fixed: Kuby::Docker::Layer } }
952
+
953
+ sig { returns(T::Array[Symbol]) }
954
+ attr_reader :stack
955
+
956
+ sig { returns(T::Hash[Symbol, Kuby::Docker::Layer]) }
957
+ attr_reader :layers
958
+
959
+ sig { void }
960
+ def initialize; end
961
+
962
+ sig { override.params(block: T.nilable(T.proc.params(layer: Kuby::Docker::Layer).void)).void }
963
+ def each(&block); end
964
+
965
+ sig { params(name: Symbol, layer: T.nilable(Layer), block: T.nilable(T.proc.params(df: Kuby::Docker::Dockerfile).void)).void }
966
+ def use(name, layer = nil, &block); end
967
+
968
+ sig do
969
+ params(
970
+ name: Symbol,
971
+ layer: T.nilable(T.any(Layer, T::Hash[Symbol, T.untyped])),
972
+ options: T::Hash[Symbol, T.untyped],
973
+ block: T.nilable(T.proc.params(df: Kuby::Docker::Dockerfile).void)
974
+ ).void
975
+ end
976
+ def insert(name, layer = nil, options = {}, &block); end
977
+
978
+ sig { params(name: Symbol).void }
979
+ def delete(name); end
980
+
981
+ sig { params(name: Symbol).returns(T::Boolean) }
982
+ def includes?(name); end
983
+ end
984
+
985
+ class LocalTags
986
+ extend T::Sig
987
+
988
+ sig { returns(Kuby::Docker::CLI) }
989
+ attr_reader :cli
990
+
991
+ sig { returns(String) }
992
+ attr_reader :image_url
993
+
994
+ sig { params(cli: Kuby::Docker::CLI, image_url: String).void }
995
+ def initialize(cli, image_url); end
996
+
997
+ sig { returns(T::Array[String]) }
998
+ def tags; end
999
+
1000
+ sig { returns(T::Array[String]) }
1001
+ def latest_tags; end
1002
+
1003
+ sig { returns(T::Array[Kuby::Docker::TimestampTag]) }
1004
+ def timestamp_tags; end
1005
+
1006
+ sig { returns(T.nilable(Kuby::Docker::TimestampTag)) }
1007
+ def latest_timestamp_tag; end
1008
+ end
1009
+
1010
+ class PackageList
1011
+ include Enumerable
1012
+ extend T::Sig
1013
+ extend T::Generic
1014
+ Elem = type_member { { fixed: Distro::PackageImpl } }
1015
+
1016
+ sig { returns(T::Array[Distro::PackageImpl]) }
1017
+ attr_reader :packages
1018
+
1019
+ sig { params(package_tuples: T::Array[[Symbol, T.nilable(String)]]).void }
1020
+ def initialize(package_tuples); end
1021
+
1022
+ sig { params(name: Symbol).returns(T.nilable(Distro::PackageImpl)) }
1023
+ def [](name); end
1024
+
1025
+ sig { params(name: Symbol, version: T.nilable(String)).void }
1026
+ def add(name, version = nil); end
1027
+
1028
+ sig { params(name: String).void }
1029
+ def delete(name); end
1030
+
1031
+ sig { override.params(block: T.proc.params(package: Distro::PackageImpl).void).void }
1032
+ def each(&block); end
1033
+
1034
+ sig { returns(T::Boolean) }
1035
+ def empty?; end
1036
+ end
1037
+
1038
+ class PackagePhase < Layer
1039
+ extend T::Sig
1040
+ Operation = T.type_alias { [Symbol, Symbol, T.nilable(String)] }
1041
+
1042
+ sig { returns(T::Array[Operation]) }
1043
+ attr_reader :operations
1044
+
1045
+ sig { params(environment: Kuby::Environment).void }
1046
+ def initialize(environment); end
1047
+
1048
+ sig { params(package_name: Symbol, version: T.nilable(String)).void }
1049
+ def add(package_name, version = nil); end
1050
+
1051
+ sig { params(package_name: Symbol).void }
1052
+ def remove(package_name); end
1053
+
1054
+ sig { override.params(dockerfile: Kuby::Docker::Dockerfile).void }
1055
+ def apply_to(dockerfile); end
1056
+
1057
+ sig { returns(Kuby::Docker::Distro) }
1058
+ def distro_spec; end
1059
+
1060
+ sig { params(package_name: Symbol, version: T.nilable(String)).returns(Kuby::Docker::Distro::PackageImpl) }
1061
+ def get_package(package_name, version); end
1062
+ end
1063
+
1064
+ class RemoteTags
1065
+ extend T::Sig
1066
+
1067
+ sig { returns(::Docker::Remote::Client) }
1068
+ attr_reader :remote_client
1069
+
1070
+ sig { returns(String) }
1071
+ attr_reader :image_url
1072
+
1073
+ sig { params(remote_client: ::Docker::Remote::Client, image_url: String).void }
1074
+ def initialize(remote_client, image_url); end
1075
+
1076
+ sig { returns(T::Array[String]) }
1077
+ def tags; end
1078
+
1079
+ sig { returns(T::Array[String]) }
1080
+ def latest_tags; end
1081
+
1082
+ sig { returns(T::Array[Kuby::Docker::TimestampTag]) }
1083
+ def timestamp_tags; end
1084
+ end
1085
+
1086
+ class SetupPhase < Layer
1087
+ extend T::Sig
1088
+ DEFAULT_WORKING_DIR = T.let('/usr/src/app'.freeze, String)
1089
+
1090
+ sig { params(base_image: String).returns(String) }
1091
+ attr_writer :base_image
1092
+
1093
+ sig { returns(T.nilable(String)) }
1094
+ attr_reader :working_dir
1095
+
1096
+ sig { params(working_dir: String).returns(String) }
1097
+ attr_writer :working_dir
1098
+
1099
+ sig { returns(T.nilable(String)) }
1100
+ attr_reader :rails_env
1101
+
1102
+ sig { params(rails_env: String).returns(String) }
1103
+ attr_writer :rails_env
1104
+
1105
+ sig { returns(Docker::Spec) }
1106
+ attr_reader :docker_spec
1107
+
1108
+ sig { params(environment: Environment, docker_spec: Docker::Spec).void }
1109
+ def initialize(environment, docker_spec); end
1110
+
1111
+ sig { override.params(dockerfile: Dockerfile).void }
1112
+ def apply_to(dockerfile); end
1113
+
1114
+ sig { returns(String) }
1115
+ def base_image; end
1116
+
1117
+ sig { returns(String) }
1118
+ def default_base_image; end
1119
+ end
1120
+
1121
+ class Spec
1122
+ extend T::Sig
1123
+ DEFAULT_DISTRO = T.let(:debian, Symbol)
1124
+ DEFAULT_APP_ROOT_PATH = T.let('.'.freeze, String)
1125
+
1126
+ sig { returns(Kuby::Environment) }
1127
+ attr_reader :environment
1128
+
1129
+ sig { returns(T.nilable(String)) }
1130
+ attr_reader :image_url_str
1131
+
1132
+ sig { returns(T.nilable(String)) }
1133
+ attr_reader :registry_index_url_str
1134
+
1135
+ sig { returns(T.nilable(String)) }
1136
+ attr_reader :app_root_path
1137
+
1138
+ sig { returns(T.nilable(Kuby::Docker::AppImage)) }
1139
+ attr_reader :image
1140
+
1141
+ sig { params(environment: Kuby::Environment).void }
1142
+ def initialize(environment); end
1143
+
1144
+ sig { returns(Symbol) }
1145
+ def distro_name; end
1146
+
1147
+ sig { params(image_url: String).void }
1148
+ def base_image(image_url); end
1149
+
1150
+ sig { params(dir: String).void }
1151
+ def working_dir(dir); end
1152
+
1153
+ sig { params(env: String).void }
1154
+ def rails_env(env); end
1155
+
1156
+ sig { params(version: String).void }
1157
+ def bundler_version(version); end
1158
+
1159
+ sig { params(path: String).void }
1160
+ def gemfile(path); end
1161
+
1162
+ sig { params(path: String).void }
1163
+ def app_root(path); end
1164
+
1165
+ sig { params(package_name: Symbol, version: T.nilable(String)).void }
1166
+ def package(package_name, version = nil); end
1167
+
1168
+ sig { params(distro_name: Symbol).void }
1169
+ def distro(distro_name); end
1170
+
1171
+ sig { params(path: String).void }
1172
+ def files(path); end
1173
+
1174
+ sig { params(port: Integer).void }
1175
+ def port(port); end
1176
+
1177
+ sig { params(url: String).void }
1178
+ def image_url(url); end
1179
+
1180
+ sig { params(url: String).void }
1181
+ def registry_index_url(url); end
1182
+
1183
+ sig { params(name: Symbol, layer: T.nilable(Layer), block: T.nilable(T.proc.params(df: Kuby::Docker::Dockerfile).void)).void }
1184
+ def use(name, layer = nil, &block); end
1185
+
1186
+ sig do
1187
+ params(
1188
+ name: Symbol,
1189
+ layer: T.nilable(T.any(Layer, T::Hash[Symbol, T.untyped])),
1190
+ options: T::Hash[Symbol, T.untyped],
1191
+ block: T.nilable(T.proc.params(df: Dockerfile).void)
1192
+ ).void
1193
+ end
1194
+ def insert(name, layer = nil, options = {}, &block); end
1195
+
1196
+ sig { params(name: Symbol).void }
1197
+ def delete(name); end
1198
+
1199
+ sig { params(name: Symbol).returns(T::Boolean) }
1200
+ def exists?(name); end
1201
+
1202
+ sig { params(block: T.nilable(T.proc.void)).returns(Kuby::Docker::Credentials) }
1203
+ def credentials(&block); end
1204
+
1205
+ sig { void }
1206
+ def after_configuration; end
1207
+
1208
+ sig { returns(Kuby::Docker::SetupPhase) }
1209
+ def setup_phase; end
1210
+
1211
+ sig { returns(Kuby::Docker::PackagePhase) }
1212
+ def package_phase; end
1213
+
1214
+ sig { returns(Kuby::Docker::BundlerPhase) }
1215
+ def bundler_phase; end
1216
+
1217
+ sig { returns(Kuby::Docker::YarnPhase) }
1218
+ def yarn_phase; end
1219
+
1220
+ sig { returns(Kuby::Docker::CopyPhase) }
1221
+ def copy_phase; end
1222
+
1223
+ sig { returns(Kuby::Docker::AppPhase) }
1224
+ def app_phase; end
1225
+
1226
+ sig { returns(Kuby::Docker::AssetsPhase) }
1227
+ def assets_phase; end
1228
+
1229
+ sig { returns(Kuby::Docker::WebserverPhase) }
1230
+ def webserver_phase; end
1231
+
1232
+ sig { returns(Kuby::Docker::Distro) }
1233
+ def distro_spec; end
1234
+
1235
+ sig { returns(Kuby::Docker::LayerStack) }
1236
+ def layer_stack; end
1237
+ end
1238
+
1239
+ class TimestampTag
1240
+ extend T::Sig
1241
+ FORMAT = T.let('%Y%m%d%H%M%S'.freeze, String)
1242
+
1243
+ sig { params(str: T.nilable(String)).returns(T.nilable(Kuby::Docker::TimestampTag)) }
1244
+ def self.try_parse(str); end
1245
+
1246
+ sig { returns(Kuby::Docker::TimestampTag) }
1247
+ def self.now; end
1248
+
1249
+ sig { returns(Time) }
1250
+ attr_reader :time
1251
+
1252
+ sig { params(time: Time).void }
1253
+ def initialize(time); end
1254
+
1255
+ sig { returns(String) }
1256
+ def to_s; end
1257
+
1258
+ sig { params(other: Kuby::Docker::TimestampTag).returns(T.nilable(Integer)) }
1259
+ def <=>(other); end
1260
+
1261
+ sig { params(other: Kuby::Docker::TimestampTag).returns(T::Boolean) }
1262
+ def ==(other); end
1263
+
1264
+ sig { returns(Integer) }
1265
+ def hash; end
1266
+
1267
+ sig { params(other: Kuby::Docker::TimestampTag).returns(T::Boolean) }
1268
+ def eql?(other); end
1269
+ end
1270
+
1271
+ class TimestampedImage < Image
1272
+ extend T::Sig
1273
+
1274
+ sig do
1275
+ params(
1276
+ dockerfile: T.any(Dockerfile, T.proc.returns(Kuby::Docker::Dockerfile)),
1277
+ image_url: String,
1278
+ credentials: Kuby::Docker::Credentials,
1279
+ registry_index_url_str: T.nilable(String),
1280
+ main_tag: T.nilable(String),
1281
+ alias_tags: T::Array[String]
1282
+ ).void
1283
+ end
1284
+ def initialize(dockerfile, image_url, credentials, registry_index_url_str = nil, main_tag = nil, alias_tags = []); end
1285
+
1286
+ sig { returns(Kuby::Docker::Image) }
1287
+ def new_version; end
1288
+
1289
+ sig { returns(Kuby::Docker::Image) }
1290
+ def current_version; end
1291
+
1292
+ sig { params(current_tag: T.nilable(String)).returns(Kuby::Docker::Image) }
1293
+ def previous_version(current_tag = nil); end
1294
+
1295
+ sig { params(current_tag: T.nilable(String)).returns(Kuby::Docker::TimestampTag) }
1296
+ def previous_timestamp_tag(current_tag = nil); end
1297
+
1298
+ sig { returns(Kuby::Docker::TimestampTag) }
1299
+ def latest_timestamp_tag; end
1300
+
1301
+ sig do
1302
+ params(
1303
+ build_args: T::Hash[String, String],
1304
+ docker_args: T::Array[String],
1305
+ context: T.nilable(String),
1306
+ cache_from: T.nilable(String)
1307
+ ).void
1308
+ end
1309
+ def build(build_args = {}, docker_args = [], context: nil, cache_from: nil); end
1310
+
1311
+ sig { params(tag: String).void }
1312
+ def push(tag); end
1313
+
1314
+ sig { params(tag: String).void }
1315
+ def pull(tag); end
1316
+
1317
+ sig { returns(T::Boolean) }
1318
+ def exists?; end
1319
+
1320
+ sig { returns(::Docker::Remote::Client) }
1321
+ def remote_client; end
1322
+
1323
+ sig { returns(T::Array[Kuby::Docker::TimestampTag]) }
1324
+ def timestamp_tags; end
1325
+
1326
+ sig { returns(Kuby::Docker::LocalTags) }
1327
+ def local; end
1328
+
1329
+ sig { returns(Kuby::Docker::RemoteTags) }
1330
+ def remote; end
1331
+ end
1332
+
1333
+ class WebserverPhase < Layer
1334
+ extend T::Sig
1335
+ DEFAULT_PORT = T.let(8080, Integer)
1336
+ WEBSERVER_MAP = T.let({ puma: Puma }.freeze, T::Hash[Symbol, T.class_of(Webserver)])
1337
+
1338
+ class Webserver
1339
+ abstract!
1340
+
1341
+ extend T::Sig
1342
+ extend T::Helpers
1343
+
1344
+ sig { returns(WebserverPhase) }
1345
+ attr_reader :phase
1346
+
1347
+ sig { params(phase: WebserverPhase).void }
1348
+ def initialize(phase); end
1349
+
1350
+ sig { abstract.params(dockerfile: Dockerfile).void }
1351
+ def apply_to(dockerfile); end
1352
+ end
1353
+
1354
+ class Puma < Webserver
1355
+ sig { override.params(dockerfile: Dockerfile).void }
1356
+ def apply_to(dockerfile); end
1357
+ end
1358
+
1359
+ sig { params(port: Integer).returns(Integer) }
1360
+ attr_writer :port
1361
+
1362
+ sig { returns(T.nilable(Symbol)) }
1363
+ attr_reader :webserver
1364
+
1365
+ sig { params(webserver: Symbol).returns(Symbol) }
1366
+ attr_writer :webserver
1367
+
1368
+ sig { override.params(environment: Environment).void }
1369
+ def initialize(environment); end
1370
+
1371
+ sig { override.params(dockerfile: Dockerfile).void }
1372
+ def apply_to(dockerfile); end
1373
+
1374
+ sig { returns(Integer) }
1375
+ def port; end
1376
+
1377
+ sig { returns(T.nilable(Symbol)) }
1378
+ def default_webserver; end
1379
+ end
1380
+
1381
+ class YarnPhase < Layer
1382
+ extend T::Sig
1383
+
1384
+ sig { params(dockerfile: Dockerfile).void }
1385
+ def apply_to(dockerfile); end
1386
+
1387
+ sig { params(path: String).returns(String) }
1388
+ def ensure_trailing_delimiter(path); end
1389
+ end
1390
+
1391
+ module Packages
1392
+ class ManagedPackage
1393
+ extend T::Sig
1394
+
1395
+ sig { returns(Symbol) }
1396
+ attr_reader :name
1397
+
1398
+ sig { returns(T::Hash[Symbol, String]) }
1399
+ attr_reader :names_per_distro
1400
+
1401
+ sig { params(name: Symbol, names_per_distro: T::Hash[Symbol, String]).void }
1402
+ def initialize(name, names_per_distro); end
1403
+
1404
+ sig { params(distro: Symbol).returns(String) }
1405
+ def package_name_for(distro); end
1406
+
1407
+ sig { params(ver: String).returns(T.self_type) }
1408
+ def with_version(ver); end
1409
+
1410
+ sig { returns(T::Boolean) }
1411
+ def managed?; end
1412
+ end
1413
+
1414
+ class Nodejs < Package
1415
+ extend T::Sig
1416
+
1417
+ sig { params(dockerfile: Dockerfile).void }
1418
+ def install_on_debian(dockerfile); end
1419
+
1420
+ sig { params(dockerfile: Dockerfile).void }
1421
+ def install_on_alpine(dockerfile); end
1422
+
1423
+ sig { returns(String) }
1424
+ def version; end
1425
+
1426
+ sig { params(image: String, dockerfile: Dockerfile).void }
1427
+ def install_from_image(image, dockerfile); end
1428
+ end
1429
+
1430
+ class Package
1431
+ abstract!
1432
+
1433
+ extend T::Sig
1434
+ extend T::Helpers
1435
+
1436
+ sig { returns(Symbol) }
1437
+ attr_reader :name
1438
+
1439
+ sig { returns(T.nilable(String)) }
1440
+ attr_reader :version
1441
+
1442
+ sig { params(name: Symbol, version: T.nilable(String)).void }
1443
+ def initialize(name, version = nil); end
1444
+
1445
+ sig { params(ver: String).returns(T.self_type) }
1446
+ def with_version(ver); end
1447
+
1448
+ sig { returns(T::Boolean) }
1449
+ def managed?; end
1450
+ end
1451
+
1452
+ class SimpleManagedPackage
1453
+ extend T::Sig
1454
+
1455
+ sig { returns(String) }
1456
+ attr_reader :name
1457
+
1458
+ sig { params(name: T.any(String, Symbol)).void }
1459
+ def initialize(name); end
1460
+
1461
+ sig { params(distro: Symbol).returns(String) }
1462
+ def package_name_for(distro); end
1463
+
1464
+ sig { params(ver: String).returns(T.self_type) }
1465
+ def with_version(ver); end
1466
+
1467
+ sig { returns(T::Boolean) }
1468
+ def managed?; end
1469
+ end
1470
+
1471
+ class Yarn < Package
1472
+ extend T::Sig
1473
+
1474
+ sig { params(name: Symbol, version: T.nilable(String)).void }
1475
+ def initialize(name, version = nil); end
1476
+
1477
+ sig { params(dockerfile: Dockerfile).void }
1478
+ def install_on_debian(dockerfile); end
1479
+
1480
+ sig { params(dockerfile: Dockerfile).void }
1481
+ def install_on_alpine(dockerfile); end
1482
+
1483
+ sig { returns(String) }
1484
+ def url; end
1485
+ end
1486
+ end
1487
+ end
1488
+
1489
+ module Kubernetes
1490
+ class BareMetalProvider < Provider
1491
+ extend T::Sig
1492
+ DEFAULT_STORAGE_CLASS = T.let('hostpath'.freeze, String)
1493
+
1494
+ class Config
1495
+ extend ::KubeDSL::ValueFields
1496
+ end
1497
+
1498
+ sig { returns(Config) }
1499
+ attr_reader :config
1500
+
1501
+ sig { params(environment: Environment).void }
1502
+ def initialize(environment); end
1503
+
1504
+ sig { params(block: T.proc.void).void }
1505
+ def configure(&block); end
1506
+
1507
+ sig { returns(String) }
1508
+ def kubeconfig_path; end
1509
+
1510
+ sig { returns(String) }
1511
+ def storage_class_name; end
1512
+
1513
+ sig { void }
1514
+ def after_initialize; end
1515
+ end
1516
+
1517
+ class DeployTask
1518
+ sig { returns(T.untyped) }
1519
+ attr_reader :deploy_task
1520
+
1521
+ sig { params(kwargs: T.untyped).void }
1522
+ def initialize(**kwargs); end
1523
+
1524
+ sig { params(kwargs: T.untyped).returns(T.untyped) }
1525
+ def run!(**kwargs); end
1526
+
1527
+ sig { returns(T.untyped) }
1528
+ def logger; end
1529
+
1530
+ sig { params(new_env: T.untyped).returns(T.untyped) }
1531
+ def with_env(new_env); end
1532
+ end
1533
+
1534
+ class Deployer
1535
+ sig { returns(T.untyped) }
1536
+ attr_reader :environment
1537
+
1538
+ sig { params(logdev: T.untyped).returns(T.untyped) }
1539
+ attr_writer :logdev
1540
+
1541
+ sig { params(environment: T.untyped).void }
1542
+ def initialize(environment); end
1543
+
1544
+ sig { returns(T.untyped) }
1545
+ def deploy; end
1546
+
1547
+ sig { params(out: T.untyped, err: T.untyped).returns(T.untyped) }
1548
+ def with_pipes(out = STDOUT, err = STDERR); end
1549
+
1550
+ sig { returns(T.untyped) }
1551
+ def logdev; end
1552
+
1553
+ sig { returns(T.untyped) }
1554
+ def last_status; end
1555
+
1556
+ sig { params(resources: T.untyped).returns(T.untyped) }
1557
+ def deploy_global_resources(resources); end
1558
+
1559
+ sig { params(resources: T.untyped, ns: T.untyped).returns(T.untyped) }
1560
+ def deploy_namespaced_resources(resources, ns); end
1561
+
1562
+ sig { returns(T.untyped) }
1563
+ def restart_rails_deployment_if_necessary; end
1564
+
1565
+ sig { returns(T.untyped) }
1566
+ def provider; end
1567
+
1568
+ sig { returns(T.untyped) }
1569
+ def namespace; end
1570
+
1571
+ sig { returns(T.untyped) }
1572
+ def all_resources; end
1573
+
1574
+ sig { returns(T.untyped) }
1575
+ def docker; end
1576
+
1577
+ sig { returns(T.untyped) }
1578
+ def kubernetes; end
1579
+
1580
+ sig { returns(T.untyped) }
1581
+ def cli; end
1582
+ end
1583
+
1584
+ class DockerConfig
1585
+ extend ::KubeDSL::ValueFields
1586
+
1587
+ sig { params(block: T.untyped).void }
1588
+ def initialize(&block); end
1589
+
1590
+ sig { returns(T.untyped) }
1591
+ def serialize; end
1592
+ end
1593
+
1594
+ class DockerDesktopProvider < Provider
1595
+ STORAGE_CLASS_NAME = 'hostpath'.freeze
1596
+
1597
+ class Config
1598
+ extend ::KubeDSL::ValueFields
1599
+ end
1600
+
1601
+ sig { returns(T.untyped) }
1602
+ attr_reader :config
1603
+
1604
+ sig { params(block: T.untyped).returns(T.untyped) }
1605
+ def configure(&block); end
1606
+
1607
+ sig { returns(T.untyped) }
1608
+ def kubeconfig_path; end
1609
+
1610
+ sig { returns(T.untyped) }
1611
+ def storage_class_name; end
1612
+
1613
+ sig { returns(T.untyped) }
1614
+ def after_initialize; end
1615
+ end
1616
+
1617
+ class MissingDeploymentError < StandardError
1618
+ end
1619
+
1620
+ class MissingProviderError < StandardError
1621
+ end
1622
+
1623
+ class MissingPluginError < StandardError
1624
+ end
1625
+
1626
+ class MissingResourceError < StandardError
1627
+ end
1628
+
1629
+ class DuplicateResourceError < StandardError
1630
+ end
1631
+
1632
+ class Manifest
1633
+ include Enumerable
1634
+
1635
+ sig { params(resources: T.untyped).void }
1636
+ def initialize(resources); end
1637
+
1638
+ sig { params(block: T.untyped).returns(T.untyped) }
1639
+ def each(&block); end
1640
+
1641
+ sig { params(kind: T.untyped, name: T.untyped).returns(T.untyped) }
1642
+ def find(kind, name); end
1643
+
1644
+ sig { params(kind: T.untyped, name: T.untyped).returns(T.untyped) }
1645
+ def delete(kind, name); end
1646
+
1647
+ sig { params(resource: T.untyped).returns(T.untyped) }
1648
+ def <<(resource); end
1649
+
1650
+ sig { params(resource: T.untyped, kind: T.untyped, name: T.untyped).returns(T.untyped) }
1651
+ def matches?(resource, kind, name); end
1652
+
1653
+ sig { returns(T.untyped) }
1654
+ def ensure_all_resources_unique!; end
1655
+ end
1656
+
1657
+ class Provider
1658
+ sig { returns(T.untyped) }
1659
+ attr_reader :environment
1660
+
1661
+ sig { params(environment: T.untyped).void }
1662
+ def initialize(environment); end
1663
+
1664
+ sig { params(block: T.untyped).returns(T.untyped) }
1665
+ def configure(&block); end
1666
+
1667
+ sig { returns(T.untyped) }
1668
+ def setup; end
1669
+
1670
+ sig { returns(T.untyped) }
1671
+ def after_configuration; end
1672
+
1673
+ sig { returns(T.untyped) }
1674
+ def before_setup; end
1675
+
1676
+ sig { returns(T.untyped) }
1677
+ def after_setup; end
1678
+
1679
+ sig { params(manifest: T.untyped).returns(T.untyped) }
1680
+ def before_deploy(manifest); end
1681
+
1682
+ sig { params(manifest: T.untyped).returns(T.untyped) }
1683
+ def after_deploy(manifest); end
1684
+
1685
+ sig { returns(T.untyped) }
1686
+ def deploy; end
1687
+
1688
+ sig { returns(T.untyped) }
1689
+ def rollback; end
1690
+
1691
+ sig { returns(T.untyped) }
1692
+ def kubernetes_cli; end
1693
+
1694
+ sig { returns(T.untyped) }
1695
+ def helm_cli; end
1696
+
1697
+ sig { returns(T.untyped) }
1698
+ def kubeconfig_path; end
1699
+
1700
+ sig { returns(T.untyped) }
1701
+ def deployer; end
1702
+
1703
+ sig { returns(T.untyped) }
1704
+ def after_initialize; end
1705
+
1706
+ sig { returns(T.untyped) }
1707
+ def spec; end
1708
+ end
1709
+
1710
+ class RegistrySecret < ::KubeDSL::DSL::V1::Secret
1711
+ sig { params(block: T.untyped).void }
1712
+ def initialize(&block); end
1713
+
1714
+ sig { returns(T.untyped) }
1715
+ def serialize; end
1716
+ end
1717
+
1718
+ class Spec
1719
+ extend ::KubeDSL::ValueFields
1720
+
1721
+ sig { returns(T.untyped) }
1722
+ attr_reader :environment
1723
+
1724
+ sig { returns(T.untyped) }
1725
+ attr_reader :plugins
1726
+
1727
+ sig { returns(T.untyped) }
1728
+ attr_reader :tag
1729
+
1730
+ sig { params(environment: T.untyped).void }
1731
+ def initialize(environment); end
1732
+
1733
+ sig { params(provider_name: T.untyped, block: T.untyped).returns(T.untyped) }
1734
+ def provider(provider_name = nil, &block); end
1735
+
1736
+ sig { params(plugin_name: T.untyped, block: T.untyped).returns(T.untyped) }
1737
+ def configure_plugin(plugin_name, &block); end
1738
+
1739
+ sig { params(plugin_name: T.untyped).returns(T.untyped) }
1740
+ def plugin(plugin_name); end
1741
+
1742
+ sig { returns(T.untyped) }
1743
+ def after_configuration; end
1744
+
1745
+ sig { returns(T.untyped) }
1746
+ def before_deploy; end
1747
+
1748
+ sig { params(plugins: T.untyped).returns(T.untyped) }
1749
+ def check_dependencies!(plugins = @plugins); end
1750
+
1751
+ sig { returns(T.untyped) }
1752
+ def after_deploy; end
1753
+
1754
+ sig { params(only: T.untyped).returns(T.untyped) }
1755
+ def setup(only: []); end
1756
+
1757
+ sig { params(tag: T.untyped).returns(T.untyped) }
1758
+ def deploy(tag = nil); end
1759
+
1760
+ sig { returns(T.untyped) }
1761
+ def rollback; end
1762
+
1763
+ sig { params(block: T.untyped).returns(T.untyped) }
1764
+ def namespace(&block); end
1765
+
1766
+ sig { params(block: T.untyped).returns(T.untyped) }
1767
+ def registry_secret(&block); end
1768
+
1769
+ sig { returns(T.untyped) }
1770
+ def resources; end
1771
+
1772
+ sig { returns(T.untyped) }
1773
+ def docker_images; end
1774
+
1775
+ sig { returns(T.untyped) }
1776
+ def selector_app; end
1777
+
1778
+ sig { returns(T.untyped) }
1779
+ def docker; end
1780
+ end
1781
+ end
1782
+
1783
+ module Middleware
1784
+ class HealthCheck
1785
+ sig { returns(T.untyped) }
1786
+ attr_reader :app
1787
+
1788
+ sig { params(app: T.untyped).void }
1789
+ def initialize(app); end
1790
+
1791
+ sig { params(env: T.untyped).returns(T.untyped) }
1792
+ def call(env); end
1793
+ end
1794
+ end
1795
+
1796
+ module Plugins
1797
+ class NginxIngress < ::Kuby::Plugin
1798
+ VERSION = '1.1.1'.freeze
1799
+ DEFAULT_PROVIDER = 'cloud'.freeze
1800
+ NAMESPACE = 'ingress-nginx'.freeze
1801
+ SERVICE_NAME = 'ingress-nginx-controller'.freeze
1802
+ SETUP_RESOURCES = [
1803
+ "https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v#{VERSION}/deploy/static/provider/%{provider}/deploy.yaml"
1804
+ ].freeze
1805
+
1806
+ class Config
1807
+ extend ::KubeDSL::ValueFields
1808
+ end
1809
+
1810
+ sig { params(block: T.untyped).returns(T.untyped) }
1811
+ def configure(&block); end
1812
+
1813
+ sig { returns(T.untyped) }
1814
+ def setup; end
1815
+
1816
+ sig { returns(T.untyped) }
1817
+ def namespace; end
1818
+
1819
+ sig { returns(T.untyped) }
1820
+ def service_name; end
1821
+
1822
+ sig { returns(T.untyped) }
1823
+ def already_deployed?; end
1824
+
1825
+ sig { returns(T.untyped) }
1826
+ def after_initialize; end
1827
+
1828
+ sig { returns(T.untyped) }
1829
+ def kubernetes_cli; end
1830
+ end
1831
+
1832
+ class System < ::Kuby::Plugin
1833
+ end
1834
+
1835
+ module RailsApp
1836
+ class AssetCopyTask
1837
+ TIMESTAMP_FORMAT = '%Y%m%d%H%M%S'.freeze
1838
+ KEEP = 5
1839
+
1840
+ sig { returns(T.untyped) }
1841
+ attr_reader :dest_path
1842
+
1843
+ sig { returns(T.untyped) }
1844
+ attr_reader :source_path
1845
+
1846
+ sig { params(to: T.untyped, from: T.untyped).void }
1847
+ def initialize(to:, from:); end
1848
+
1849
+ sig { returns(T.untyped) }
1850
+ def run; end
1851
+
1852
+ sig { returns(T.untyped) }
1853
+ def copy_new_assets; end
1854
+
1855
+ sig { returns(T.untyped) }
1856
+ def delete_old_assets; end
1857
+
1858
+ sig { params(ts: T.untyped).returns(T.untyped) }
1859
+ def try_parse_ts(ts); end
1860
+
1861
+ sig { params(ts: T.untyped).returns(T.untyped) }
1862
+ def parse_ts(ts); end
1863
+
1864
+ sig { returns(T.untyped) }
1865
+ def ts_dir; end
1866
+
1867
+ sig { returns(T.untyped) }
1868
+ def current_dir; end
1869
+ end
1870
+
1871
+ class Assets < ::Kuby::Plugin
1872
+ extend ::KubeDSL::ValueFields
1873
+ ROLE = 'assets'.freeze
1874
+ NGINX_IMAGE = 'nginx:1.9-alpine'.freeze
1875
+ NGINX_PORT = 8082
1876
+ NGINX_MOUNT_PATH = '/usr/share/nginx/assets'.freeze
1877
+ RAILS_MOUNT_PATH = '/usr/share/assets'.freeze
1878
+
1879
+ sig { params(block: T.untyped).returns(T.untyped) }
1880
+ def configure(&block); end
1881
+
1882
+ sig { params(ingress: T.untyped, hostname: T.untyped).returns(T.untyped) }
1883
+ def configure_ingress(ingress, hostname); end
1884
+
1885
+ sig { returns(T.untyped) }
1886
+ def copy_task; end
1887
+
1888
+ sig { params(block: T.untyped).returns(T.untyped) }
1889
+ def service(&block); end
1890
+
1891
+ sig { params(block: T.untyped).returns(T.untyped) }
1892
+ def service_account(&block); end
1893
+
1894
+ sig { params(block: T.untyped).returns(T.untyped) }
1895
+ def nginx_config(&block); end
1896
+
1897
+ sig { params(block: T.untyped).returns(T.untyped) }
1898
+ def deployment(&block); end
1899
+
1900
+ sig { returns(T.untyped) }
1901
+ def resources; end
1902
+
1903
+ sig { returns(T.untyped) }
1904
+ def namespace; end
1905
+
1906
+ sig { returns(T.untyped) }
1907
+ def selector_app; end
1908
+
1909
+ sig { returns(T.untyped) }
1910
+ def role; end
1911
+
1912
+ sig { returns(T.untyped) }
1913
+ def docker; end
1914
+
1915
+ sig { returns(T.untyped) }
1916
+ def kubernetes; end
1917
+
1918
+ sig { returns(T.untyped) }
1919
+ def image; end
1920
+
1921
+ sig { returns(T.untyped) }
1922
+ def dockerfile; end
1923
+
1924
+ sig { returns(T.untyped) }
1925
+ def docker_images; end
1926
+ end
1927
+
1928
+ class AssetsImage < ::Kuby::Docker::Image
1929
+ sig { returns(T.untyped) }
1930
+ attr_reader :base_image
1931
+
1932
+ sig do
1933
+ params(
1934
+ base_image: T.untyped,
1935
+ dockerfile: T.untyped,
1936
+ registry_index_url: T.untyped,
1937
+ main_tag: T.untyped,
1938
+ alias_tags: T.untyped
1939
+ ).void
1940
+ end
1941
+ def initialize(base_image, dockerfile, registry_index_url = nil, main_tag = nil, alias_tags = []); end
1942
+
1943
+ sig { returns(T.untyped) }
1944
+ def new_version; end
1945
+
1946
+ sig { returns(T.untyped) }
1947
+ def current_version; end
1948
+
1949
+ sig { returns(T.untyped) }
1950
+ def previous_version; end
1951
+
1952
+ sig do
1953
+ params(
1954
+ build_args: T.untyped,
1955
+ docker_args: T.untyped,
1956
+ context: T.untyped,
1957
+ cache_from: T.untyped
1958
+ ).returns(T.untyped)
1959
+ end
1960
+ def build(build_args = {}, docker_args = [], context: nil, cache_from: nil); end
1961
+
1962
+ sig { params(tag: T.untyped).returns(T.untyped) }
1963
+ def push(tag); end
1964
+
1965
+ sig { params(tag: T.untyped).returns(T.untyped) }
1966
+ def pull(tag); end
1967
+
1968
+ sig { params(image: T.untyped).returns(T.untyped) }
1969
+ def duplicate_with_annotated_tags(image); end
1970
+
1971
+ sig { params(tag: T.untyped).returns(T.untyped) }
1972
+ def annotate_tag(tag); end
1973
+ end
1974
+
1975
+ module CRDB
1976
+ end
1977
+
1978
+ class RewriteDbConfig
1979
+ sig { params(dockerfile: T.untyped).returns(T.untyped) }
1980
+ def apply_to(dockerfile); end
1981
+ end
1982
+
1983
+ class Sqlite < ::Kuby::Plugin
1984
+ sig { returns(T.untyped) }
1985
+ attr_reader :environment
1986
+
1987
+ sig { params(environment: T.untyped, _: T.untyped).void }
1988
+ def initialize(environment, *_); end
1989
+
1990
+ sig { returns(T.untyped) }
1991
+ def after_configuration; end
1992
+
1993
+ sig { params(_pod_spec: T.untyped).returns(T.untyped) }
1994
+ def configure_pod_spec(_pod_spec); end
1995
+
1996
+ sig { returns(T.untyped) }
1997
+ def bootstrap; end
1998
+
1999
+ sig { params(_user: T.untyped).returns(T.untyped) }
2000
+ def user(_user); end
2001
+
2002
+ sig { params(_password: T.untyped).returns(T.untyped) }
2003
+ def password(_password); end
2004
+
2005
+ sig { returns(T.untyped) }
2006
+ def name; end
2007
+ end
2008
+ end
2009
+ end
2010
+
2011
+ module Utils
2012
+ sig { params(args: T.untyped).returns(T.untyped) }
2013
+ def self.which(*args); end
2014
+
2015
+ class Table
2016
+ sig { returns(T.untyped) }
2017
+ attr_reader :headers
2018
+
2019
+ sig { returns(T.untyped) }
2020
+ attr_reader :rows
2021
+
2022
+ sig { params(headers: T.untyped, rows: T.untyped).void }
2023
+ def initialize(headers, rows); end
2024
+
2025
+ sig { returns(T.untyped) }
2026
+ def to_s; end
2027
+
2028
+ sig { params(values: T.untyped).returns(T.untyped) }
2029
+ def make_row(values); end
2030
+
2031
+ sig { params(idx: T.untyped).returns(T.untyped) }
2032
+ def col_width_at(idx); end
2033
+
2034
+ sig { returns(T.untyped) }
2035
+ def col_widths; end
2036
+ end
2037
+
2038
+ module Which
2039
+ extend self
2040
+
2041
+ sig { params(program: T.untyped, path: T.untyped).returns(T.untyped) }
2042
+ def which(program, path = ENV['PATH']); end
2043
+ end
2044
+
2045
+ module SemVer
2046
+ sig { params(str: T.untyped).returns(T.untyped) }
2047
+ def self.parse_version(str); end
2048
+
2049
+ sig { params(strs: T.untyped).returns(T.untyped) }
2050
+ def self.parse_constraints(*strs); end
2051
+
2052
+ class Constraint
2053
+ OPERATOR_MAP = {
2054
+ '=' => :eq,
2055
+ '>' => :gt,
2056
+ '>=' => :gteq,
2057
+ '<' => :lt,
2058
+ '<=' => :lteq,
2059
+ '~>' => :waka
2060
+ }
2061
+ OPERATOR_INVERSE = OPERATOR_MAP.invert.freeze
2062
+
2063
+ sig { returns(T.untyped) }
2064
+ attr_reader :operator
2065
+
2066
+ sig { returns(T.untyped) }
2067
+ attr_reader :version
2068
+
2069
+ sig { params(str: T.untyped).returns(T.untyped) }
2070
+ def self.parse(str); end
2071
+
2072
+ sig { params(operator: T.untyped, version: T.untyped).void }
2073
+ def initialize(operator, version); end
2074
+
2075
+ sig { returns(T.untyped) }
2076
+ def to_s; end
2077
+
2078
+ sig { params(other_version: T.untyped).returns(T.untyped) }
2079
+ def satisfied_by?(other_version); end
2080
+ end
2081
+
2082
+ class ConstraintSet
2083
+ sig { returns(T.untyped) }
2084
+ attr_reader :constraints
2085
+
2086
+ sig { params(arr: T.untyped).returns(T.untyped) }
2087
+ def self.parse(*arr); end
2088
+
2089
+ sig { params(constraints: T.untyped).void }
2090
+ def initialize(constraints); end
2091
+
2092
+ sig { params(version: T.untyped).returns(T.untyped) }
2093
+ def satisfied_by?(version); end
2094
+
2095
+ sig { returns(T.untyped) }
2096
+ def to_s; end
2097
+ end
2098
+
2099
+ class Version
2100
+ include Comparable
2101
+
2102
+ sig { returns(T.untyped) }
2103
+ attr_reader :major
2104
+
2105
+ sig { returns(T.untyped) }
2106
+ attr_reader :minor
2107
+
2108
+ sig { returns(T.untyped) }
2109
+ attr_reader :patch
2110
+
2111
+ sig { params(str: T.untyped, default: T.untyped).returns(T.untyped) }
2112
+ def self.parse(str, default: 0); end
2113
+
2114
+ sig { params(major: T.untyped, minor: T.untyped, patch: T.untyped).void }
2115
+ def initialize(major, minor, patch); end
2116
+
2117
+ sig { returns(T.untyped) }
2118
+ def to_s; end
2119
+
2120
+ sig { returns(T.untyped) }
2121
+ def to_a; end
2122
+
2123
+ sig { params(other: T.untyped).returns(T.untyped) }
2124
+ def <=>(other); end
2125
+ end
2126
+ end
2127
+ end
2128
+ end