dash 3.2.0 → 3.2.1

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.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/dash +2 -2
  4. data/lib/{kamal → dash}/cli/accessory.rb +24 -24
  5. data/lib/dash/cli/alias/command.rb +10 -0
  6. data/lib/{kamal → dash}/cli/app/assets.rb +2 -2
  7. data/lib/{kamal → dash}/cli/app/boot.rb +15 -15
  8. data/lib/{kamal → dash}/cli/app/error_pages.rb +6 -6
  9. data/lib/{kamal → dash}/cli/app/rollout_boot.rb +6 -6
  10. data/lib/{kamal → dash}/cli/app/ssl_certificates.rb +3 -3
  11. data/lib/{kamal → dash}/cli/app.rb +86 -86
  12. data/lib/{kamal → dash}/cli/base.rb +71 -47
  13. data/lib/dash/cli/build/clone.rb +59 -0
  14. data/lib/{kamal → dash}/cli/build/port_forwarding.rb +1 -1
  15. data/lib/{kamal → dash}/cli/build.rb +45 -45
  16. data/lib/{kamal → dash}/cli/doctor/config_checks.rb +3 -3
  17. data/lib/{kamal → dash}/cli/doctor/endpoint_checks.rb +25 -7
  18. data/lib/{kamal → dash}/cli/doctor/host_checks.rb +18 -18
  19. data/lib/{kamal → dash}/cli/doctor.rb +9 -9
  20. data/lib/{kamal → dash}/cli/healthcheck/barrier.rb +2 -2
  21. data/lib/{kamal → dash}/cli/healthcheck/drift_error.rb +2 -2
  22. data/lib/dash/cli/healthcheck/error.rb +2 -0
  23. data/lib/{kamal → dash}/cli/healthcheck/poller.rb +7 -7
  24. data/lib/{kamal → dash}/cli/lock.rb +1 -1
  25. data/lib/dash/cli/main/migrate.rb +77 -0
  26. data/lib/{kamal → dash}/cli/main.rb +77 -66
  27. data/lib/{kamal → dash}/cli/proxy/drift.rb +3 -3
  28. data/lib/{kamal → dash}/cli/proxy/loadbalancer_claim.rb +3 -3
  29. data/lib/{kamal → dash}/cli/proxy/loadbalancer_reboot.rb +22 -22
  30. data/lib/{kamal → dash}/cli/proxy/reboot.rb +15 -15
  31. data/lib/{kamal → dash}/cli/proxy.rb +166 -154
  32. data/lib/{kamal → dash}/cli/prune.rb +10 -10
  33. data/lib/{kamal → dash}/cli/registry.rb +11 -11
  34. data/lib/{kamal → dash}/cli/secrets.rb +3 -3
  35. data/lib/{kamal → dash}/cli/server.rb +14 -14
  36. data/lib/{kamal → dash}/cli/templates/deploy.yml +4 -4
  37. data/lib/dash/cli/templates/sample_hooks/docker-setup.sample +3 -0
  38. data/lib/dash/cli/templates/sample_hooks/post-app-boot.sample +3 -0
  39. data/lib/dash/cli/templates/sample_hooks/post-app-stop.sample +9 -0
  40. data/lib/dash/cli/templates/sample_hooks/post-deploy.sample +14 -0
  41. data/lib/dash/cli/templates/sample_hooks/post-proxy-deploy.sample +3 -0
  42. data/lib/dash/cli/templates/sample_hooks/post-proxy-reboot.sample +3 -0
  43. data/lib/dash/cli/templates/sample_hooks/pre-app-boot.sample +3 -0
  44. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-app-stop.sample +2 -2
  45. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-build.sample +8 -8
  46. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-connect.sample +8 -8
  47. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-deploy.sample +9 -9
  48. data/lib/dash/cli/templates/sample_hooks/pre-proxy-deploy.sample +3 -0
  49. data/lib/dash/cli/templates/sample_hooks/pre-proxy-reboot.sample +3 -0
  50. data/lib/{kamal → dash}/cli/templates/secrets +6 -6
  51. data/lib/{kamal → dash}/cli.rb +2 -2
  52. data/lib/{kamal → dash}/commander/specifics.rb +2 -2
  53. data/lib/{kamal → dash}/commander.rb +31 -23
  54. data/lib/{kamal → dash}/commands/accessory/proxy.rb +1 -1
  55. data/lib/{kamal → dash}/commands/accessory.rb +2 -2
  56. data/lib/{kamal → dash}/commands/app/assets.rb +1 -1
  57. data/lib/{kamal → dash}/commands/app/containers.rb +1 -1
  58. data/lib/{kamal → dash}/commands/app/error_pages.rb +2 -2
  59. data/lib/{kamal → dash}/commands/app/execution.rb +1 -1
  60. data/lib/{kamal → dash}/commands/app/images.rb +1 -1
  61. data/lib/{kamal → dash}/commands/app/logging.rb +1 -1
  62. data/lib/{kamal → dash}/commands/app/proxy.rb +1 -1
  63. data/lib/{kamal → dash}/commands/app.rb +1 -1
  64. data/lib/{kamal → dash}/commands/auditor.rb +3 -7
  65. data/lib/{kamal → dash}/commands/base.rb +39 -3
  66. data/lib/{kamal → dash}/commands/builder/base.rb +2 -2
  67. data/lib/{kamal → dash}/commands/builder/clone.rb +3 -3
  68. data/lib/{kamal → dash}/commands/builder/cloud.rb +1 -1
  69. data/lib/{kamal → dash}/commands/builder/hybrid.rb +1 -1
  70. data/lib/{kamal → dash}/commands/builder/local.rb +1 -1
  71. data/lib/{kamal → dash}/commands/builder/pack.rb +1 -1
  72. data/lib/{kamal → dash}/commands/builder/remote.rb +1 -1
  73. data/lib/{kamal → dash}/commands/builder.rb +7 -7
  74. data/lib/{kamal → dash}/commands/docker.rb +1 -1
  75. data/lib/{kamal → dash}/commands/hook.rb +1 -1
  76. data/lib/{kamal → dash}/commands/loadbalancer.rb +9 -8
  77. data/lib/{kamal → dash}/commands/lock.rb +2 -2
  78. data/lib/{kamal → dash}/commands/proxy/cert_transfer.rb +2 -2
  79. data/lib/{kamal → dash}/commands/proxy.rb +20 -10
  80. data/lib/{kamal → dash}/commands/prune.rb +1 -1
  81. data/lib/dash/commands/registry.rb +44 -0
  82. data/lib/{kamal → dash}/commands/server.rb +1 -5
  83. data/lib/dash/commands.rb +2 -0
  84. data/lib/{kamal → dash}/configuration/accessory.rb +11 -11
  85. data/lib/{kamal → dash}/configuration/alias.rb +3 -3
  86. data/lib/{kamal → dash}/configuration/boot.rb +2 -2
  87. data/lib/{kamal → dash}/configuration/builder.rb +7 -7
  88. data/lib/{kamal → dash}/configuration/docs/builder.yml +3 -3
  89. data/lib/{kamal → dash}/configuration/docs/configuration.yml +12 -5
  90. data/lib/{kamal → dash}/configuration/docs/env.yml +10 -10
  91. data/lib/{kamal → dash}/configuration/docs/proxy.yml +31 -8
  92. data/lib/{kamal → dash}/configuration/docs/registry.yml +5 -5
  93. data/lib/{kamal → dash}/configuration/env/tag.rb +2 -2
  94. data/lib/{kamal → dash}/configuration/env.rb +5 -5
  95. data/lib/{kamal → dash}/configuration/loadbalancer.rb +3 -3
  96. data/lib/{kamal → dash}/configuration/logging.rb +3 -3
  97. data/lib/{kamal → dash}/configuration/output.rb +4 -4
  98. data/lib/{kamal → dash}/configuration/proxy/acme.rb +4 -3
  99. data/lib/{kamal → dash}/configuration/proxy/boot.rb +7 -7
  100. data/lib/{kamal → dash}/configuration/proxy/run.rb +11 -11
  101. data/lib/{kamal → dash}/configuration/proxy.rb +15 -15
  102. data/lib/{kamal → dash}/configuration/registry.rb +3 -3
  103. data/lib/{kamal → dash}/configuration/role/healthcheck.rb +3 -3
  104. data/lib/{kamal → dash}/configuration/role.rb +12 -12
  105. data/lib/{kamal → dash}/configuration/servers.rb +4 -4
  106. data/lib/{kamal → dash}/configuration/ssh.rb +2 -2
  107. data/lib/{kamal → dash}/configuration/sshkit.rb +2 -2
  108. data/lib/{kamal → dash}/configuration/validation.rb +2 -2
  109. data/lib/{kamal → dash}/configuration/validator/accessory.rb +1 -1
  110. data/lib/{kamal → dash}/configuration/validator/alias.rb +2 -2
  111. data/lib/{kamal → dash}/configuration/validator/builder.rb +1 -1
  112. data/lib/dash/configuration/validator/configuration.rb +6 -0
  113. data/lib/{kamal → dash}/configuration/validator/env.rb +2 -2
  114. data/lib/{kamal → dash}/configuration/validator/proxy.rb +8 -8
  115. data/lib/{kamal → dash}/configuration/validator/registry.rb +1 -1
  116. data/lib/{kamal → dash}/configuration/validator/role.rb +1 -1
  117. data/lib/{kamal → dash}/configuration/validator/servers.rb +1 -1
  118. data/lib/{kamal → dash}/configuration/validator.rb +4 -4
  119. data/lib/{kamal → dash}/configuration/volume.rb +2 -2
  120. data/lib/{kamal → dash}/configuration.rb +39 -29
  121. data/lib/{kamal → dash}/docker.rb +1 -1
  122. data/lib/{kamal → dash}/env_file.rb +1 -1
  123. data/lib/{kamal → dash}/git.rb +1 -1
  124. data/lib/{kamal → dash}/otel_shipper.rb +3 -3
  125. data/lib/{kamal → dash}/output/base_logger.rb +1 -1
  126. data/lib/{kamal → dash}/output/file_logger.rb +1 -1
  127. data/lib/{kamal → dash}/output/formatter.rb +1 -1
  128. data/lib/{kamal → dash}/output/otel_logger.rb +3 -3
  129. data/lib/dash/project_directory.rb +28 -0
  130. data/lib/{kamal → dash}/secrets/adapters/aws_secrets_manager.rb +1 -1
  131. data/lib/{kamal → dash}/secrets/adapters/base.rb +2 -2
  132. data/lib/{kamal → dash}/secrets/adapters/bitwarden.rb +1 -1
  133. data/lib/{kamal → dash}/secrets/adapters/bitwarden_secrets_manager.rb +1 -1
  134. data/lib/{kamal → dash}/secrets/adapters/doppler.rb +1 -1
  135. data/lib/{kamal → dash}/secrets/adapters/enpass.rb +1 -1
  136. data/lib/{kamal → dash}/secrets/adapters/gcp_secret_manager.rb +1 -1
  137. data/lib/{kamal → dash}/secrets/adapters/last_pass.rb +1 -1
  138. data/lib/{kamal → dash}/secrets/adapters/one_password.rb +2 -2
  139. data/lib/{kamal → dash}/secrets/adapters/passbolt.rb +1 -1
  140. data/lib/{kamal → dash}/secrets/adapters/test.rb +1 -1
  141. data/lib/{kamal → dash}/secrets/adapters.rb +2 -2
  142. data/lib/{kamal → dash}/secrets/dotenv/inline_command_substitution.rb +2 -2
  143. data/lib/{kamal → dash}/secrets.rb +6 -6
  144. data/lib/{kamal → dash}/tags.rb +8 -3
  145. data/lib/{kamal → dash}/utils/sensitive.rb +1 -1
  146. data/lib/{kamal → dash}/utils.rb +15 -5
  147. data/lib/dash/version.rb +3 -0
  148. data/lib/{kamal.rb → dash.rb} +4 -4
  149. metadata +156 -154
  150. data/lib/kamal/cli/alias/command.rb +0 -10
  151. data/lib/kamal/cli/build/clone.rb +0 -59
  152. data/lib/kamal/cli/healthcheck/error.rb +0 -2
  153. data/lib/kamal/cli/templates/sample_hooks/docker-setup.sample +0 -3
  154. data/lib/kamal/cli/templates/sample_hooks/post-app-boot.sample +0 -3
  155. data/lib/kamal/cli/templates/sample_hooks/post-app-stop.sample +0 -9
  156. data/lib/kamal/cli/templates/sample_hooks/post-deploy.sample +0 -14
  157. data/lib/kamal/cli/templates/sample_hooks/post-proxy-deploy.sample +0 -3
  158. data/lib/kamal/cli/templates/sample_hooks/post-proxy-reboot.sample +0 -3
  159. data/lib/kamal/cli/templates/sample_hooks/pre-app-boot.sample +0 -3
  160. data/lib/kamal/cli/templates/sample_hooks/pre-proxy-deploy.sample +0 -3
  161. data/lib/kamal/cli/templates/sample_hooks/pre-proxy-reboot.sample +0 -3
  162. data/lib/kamal/commands/registry.rb +0 -38
  163. data/lib/kamal/commands.rb +0 -2
  164. data/lib/kamal/configuration/validator/configuration.rb +0 -6
  165. data/lib/kamal/version.rb +0 -3
  166. /data/lib/{kamal → dash}/configuration/docs/accessory.yml +0 -0
  167. /data/lib/{kamal → dash}/configuration/docs/alias.yml +0 -0
  168. /data/lib/{kamal → dash}/configuration/docs/boot.yml +0 -0
  169. /data/lib/{kamal → dash}/configuration/docs/logging.yml +0 -0
  170. /data/lib/{kamal → dash}/configuration/docs/output.yml +0 -0
  171. /data/lib/{kamal → dash}/configuration/docs/role.yml +0 -0
  172. /data/lib/{kamal → dash}/configuration/docs/servers.yml +0 -0
  173. /data/lib/{kamal → dash}/configuration/docs/ssh.yml +0 -0
  174. /data/lib/{kamal → dash}/configuration/docs/sshkit.yml +0 -0
  175. /data/lib/{kamal → dash}/sshkit_with_ext.rb +0 -0
@@ -1,4 +1,4 @@
1
- class Kamal::Cli::Main < Kamal::Cli::Base
1
+ class Dash::Cli::Main < Dash::Cli::Base
2
2
  desc "setup", "Setup all accessories, push the env, and deploy app to servers"
3
3
  option :skip_push, aliases: "-P", type: :boolean, default: false, desc: "Skip image build and push"
4
4
  option :no_cache, type: :boolean, default: false, desc: "Build without using Docker's build cache"
@@ -8,7 +8,7 @@ class Kamal::Cli::Main < Kamal::Cli::Base
8
8
  invoke_options = deploy_options
9
9
 
10
10
  say "Ensure Docker is installed...", :magenta
11
- invoke "kamal:cli:server:bootstrap", [], invoke_options
11
+ invoke "dash:cli:server:bootstrap", [], invoke_options
12
12
 
13
13
  deploy(boot_accessories: true)
14
14
  end
@@ -26,36 +26,36 @@ class Kamal::Cli::Main < Kamal::Cli::Base
26
26
  print_config_banner
27
27
 
28
28
  say "Validate configuration and secrets...", :magenta
29
- KAMAL.config.validate_secrets!(include_accessories: boot_accessories)
29
+ DASH.config.validate_secrets!(include_accessories: boot_accessories)
30
30
 
31
31
  if options[:skip_push]
32
32
  say "Pull app image...", :magenta
33
- invoke "kamal:cli:build:pull", [], invoke_options
33
+ invoke "dash:cli:build:pull", [], invoke_options
34
34
  else
35
35
  say "Build and push app image...", :magenta
36
- invoke "kamal:cli:build:deliver", [], invoke_options
36
+ invoke "dash:cli:build:deliver", [], invoke_options
37
37
  end
38
38
 
39
39
  modify(lock: true) do
40
40
  run_hook "pre-deploy", secrets: true
41
41
 
42
42
  say "Ensure kamal-proxy is running...", :magenta
43
- invoke "kamal:cli:proxy:boot", [], invoke_options
43
+ invoke "dash:cli:proxy:boot", [], invoke_options
44
44
 
45
- invoke "kamal:cli:accessory:boot", [ "all" ], invoke_options if boot_accessories
45
+ invoke "dash:cli:accessory:boot", [ "all" ], invoke_options if boot_accessories
46
46
 
47
47
  say "Detect stale containers...", :magenta
48
- invoke "kamal:cli:app:stale_containers", [], invoke_options.merge(stop: true)
48
+ invoke "dash:cli:app:stale_containers", [], invoke_options.merge(stop: true)
49
49
 
50
- invoke "kamal:cli:app:boot", [], invoke_options
50
+ invoke "dash:cli:app:boot", [], invoke_options
51
51
 
52
- if KAMAL.config.proxy.load_balancing?
52
+ if DASH.config.proxy.load_balancing?
53
53
  say "Updating loadbalancer configuration...", :magenta
54
- invoke "kamal:cli:proxy:loadbalancer", [ "deploy" ], invoke_options
54
+ invoke "dash:cli:proxy:loadbalancer", [ "deploy" ], invoke_options
55
55
  end
56
56
 
57
57
  say "Prune old containers and images...", :magenta
58
- invoke "kamal:cli:prune:all", [], invoke_options
58
+ invoke "dash:cli:prune:all", [], invoke_options
59
59
  end
60
60
  end
61
61
 
@@ -74,27 +74,27 @@ class Kamal::Cli::Main < Kamal::Cli::Base
74
74
  print_config_banner
75
75
 
76
76
  say "Validate configuration and secrets...", :magenta
77
- KAMAL.config.validate_secrets!
77
+ DASH.config.validate_secrets!
78
78
 
79
79
  if options[:skip_push]
80
80
  say "Pull app image...", :magenta
81
- invoke "kamal:cli:build:pull", [], invoke_options
81
+ invoke "dash:cli:build:pull", [], invoke_options
82
82
  else
83
83
  say "Build and push app image...", :magenta
84
- invoke "kamal:cli:build:deliver", [], invoke_options
84
+ invoke "dash:cli:build:deliver", [], invoke_options
85
85
  end
86
86
 
87
87
  modify(lock: true) do
88
88
  run_hook "pre-deploy", secrets: true
89
89
 
90
90
  say "Detect stale containers...", :magenta
91
- invoke "kamal:cli:app:stale_containers", [], invoke_options.merge(stop: true)
91
+ invoke "dash:cli:app:stale_containers", [], invoke_options.merge(stop: true)
92
92
 
93
- invoke "kamal:cli:app:boot", [], invoke_options
93
+ invoke "dash:cli:app:boot", [], invoke_options
94
94
 
95
- if KAMAL.config.proxy.load_balancing?
95
+ if DASH.config.proxy.load_balancing?
96
96
  say "Updating loadbalancer configuration...", :magenta
97
- invoke "kamal:cli:proxy:loadbalancer", [ "deploy" ], invoke_options
97
+ invoke "dash:cli:proxy:loadbalancer", [ "deploy" ], invoke_options
98
98
  end
99
99
  end
100
100
  end
@@ -112,12 +112,12 @@ class Kamal::Cli::Main < Kamal::Cli::Base
112
112
  modify(lock: true) do
113
113
  invoke_options = deploy_options
114
114
 
115
- KAMAL.config.version = version
115
+ DASH.config.version = version
116
116
 
117
117
  if container_available?(version)
118
118
  run_hook "pre-deploy", secrets: true
119
119
 
120
- invoke "kamal:cli:app:boot", [], invoke_options.merge(version: version)
120
+ invoke "dash:cli:app:boot", [], invoke_options.merge(version: version)
121
121
  rolled_back = true
122
122
  else
123
123
  say "The app version '#{version}' is not available as a container (use 'dash app containers' for available versions)", :red
@@ -131,23 +131,23 @@ class Kamal::Cli::Main < Kamal::Cli::Base
131
131
 
132
132
  desc "details", "Show details about all containers"
133
133
  def details
134
- invoke "kamal:cli:proxy:details"
135
- invoke "kamal:cli:app:details"
136
- invoke "kamal:cli:accessory:details", [ "all" ]
134
+ invoke "dash:cli:proxy:details"
135
+ invoke "dash:cli:app:details"
136
+ invoke "dash:cli:accessory:details", [ "all" ]
137
137
  end
138
138
 
139
139
  desc "audit", "Show audit log from servers"
140
140
  def audit
141
141
  quiet = options[:quiet]
142
- on(KAMAL.hosts) do |host|
143
- puts_by_host host, capture_with_info(*KAMAL.auditor.reveal), quiet: quiet
142
+ on(DASH.hosts) do |host|
143
+ puts_by_host host, capture_with_info(*DASH.auditor.reveal), quiet: quiet
144
144
  end
145
145
  end
146
146
 
147
147
  desc "config", "Show combined config (including secrets!)"
148
148
  def config
149
149
  run_locally do
150
- puts Kamal::Utils.redacted(KAMAL.config.to_h).to_yaml
150
+ puts Dash::Utils.redacted(DASH.config.to_h).to_yaml
151
151
  end
152
152
  end
153
153
 
@@ -155,9 +155,9 @@ class Kamal::Cli::Main < Kamal::Cli::Base
155
155
  def docs(section = nil)
156
156
  case section
157
157
  when NilClass
158
- puts Kamal::Configuration.validation_doc
158
+ puts Dash::Configuration.validation_doc
159
159
  else
160
- puts Kamal::Configuration.const_get(section.titlecase.to_sym).validation_doc
160
+ puts Dash::Configuration.const_get(section.titlecase.to_sym).validation_doc
161
161
  end
162
162
  rescue NameError
163
163
  puts "No documentation found for #{section}"
@@ -168,7 +168,7 @@ class Kamal::Cli::Main < Kamal::Cli::Base
168
168
  say "Running readiness checks...", :magenta
169
169
  pre_connect_if_required
170
170
 
171
- doctor = Kamal::Cli::Doctor.new
171
+ doctor = Dash::Cli::Doctor.new
172
172
  doctor.run
173
173
 
174
174
  print_doctor_report doctor.results
@@ -176,11 +176,11 @@ class Kamal::Cli::Main < Kamal::Cli::Base
176
176
  if doctor.successful?
177
177
  say doctor_summary(doctor), :green
178
178
  else
179
- raise Kamal::Cli::DoctorError, doctor_failure_message(doctor)
179
+ raise Dash::Cli::DoctorError, doctor_failure_message(doctor)
180
180
  end
181
181
  end
182
182
 
183
- desc "init", "Create config stub in config/deploy.yml and secrets stub in .kamal"
183
+ desc "init", "Create config stub in config/deploy.yml and secrets stub in .dash"
184
184
  option :bundle, type: :boolean, default: false, desc: "Add dash to the Gemfile and create a bin/dash binstub"
185
185
  def init
186
186
  require "fileutils"
@@ -193,18 +193,23 @@ class Kamal::Cli::Main < Kamal::Cli::Base
193
193
  puts "Created configuration file in config/deploy.yml"
194
194
  end
195
195
 
196
- unless (secrets_file = Pathname.new(File.expand_path(".kamal/secrets"))).exist?
196
+ # Resolved rather than hardcoded to .dash: a project still on .kamal must
197
+ # keep getting its stubs there, or init would create a second directory that
198
+ # silently wins resolution and orphans the operator's real secrets.
199
+ project_directory = Dash::ProjectDirectory.path
200
+
201
+ unless (secrets_file = Pathname.new(File.expand_path("#{project_directory}/secrets"))).exist?
197
202
  FileUtils.mkdir_p secrets_file.dirname
198
203
  FileUtils.cp_r Pathname.new(File.expand_path("templates/secrets", __dir__)), secrets_file
199
- puts "Created .kamal/secrets file"
204
+ puts "Created #{project_directory}/secrets file"
200
205
  end
201
206
 
202
- unless (hooks_dir = Pathname.new(File.expand_path(".kamal/hooks"))).exist?
207
+ unless (hooks_dir = Pathname.new(File.expand_path("#{project_directory}/hooks"))).exist?
203
208
  hooks_dir.mkpath
204
209
  Pathname.new(File.expand_path("templates/sample_hooks", __dir__)).each_child do |sample_hook|
205
210
  FileUtils.cp sample_hook, hooks_dir, preserve: true
206
211
  end
207
- puts "Created sample hooks in .kamal/hooks"
212
+ puts "Created sample hooks in #{project_directory}/hooks"
208
213
  end
209
214
 
210
215
  if options[:bundle]
@@ -226,14 +231,20 @@ class Kamal::Cli::Main < Kamal::Cli::Base
226
231
  def remove
227
232
  confirming "This will remove all containers and images. Are you sure?" do
228
233
  modify(lock: true) do
229
- invoke "kamal:cli:app:remove", [], options.without(:confirmed)
230
- invoke "kamal:cli:proxy:remove", [], options.without(:confirmed)
231
- invoke "kamal:cli:accessory:remove", [ "all" ], options
232
- invoke "kamal:cli:registry:remove", [], options.without(:confirmed).merge(skip_local: true)
234
+ invoke "dash:cli:app:remove", [], options.without(:confirmed)
235
+ invoke "dash:cli:proxy:remove", [], options.without(:confirmed)
236
+ invoke "dash:cli:accessory:remove", [ "all" ], options
237
+ invoke "dash:cli:registry:remove", [], options.without(:confirmed).merge(skip_local: true)
233
238
  end
234
239
  end
235
240
  end
236
241
 
242
+ desc "migrate", "Move this project's .kamal directory to .dash"
243
+ option :dry_run, type: :boolean, default: false, desc: "Report what would move without touching anything"
244
+ def migrate
245
+ Dash::Cli::Main::Migrate.new(dry_run: options[:dry_run]).run.each { |message, color| say message, color }
246
+ end
247
+
237
248
  desc "upgrade", "Upgrade from Kamal 1.x to 2.0"
238
249
  option :confirmed, aliases: "-y", type: :boolean, default: false, desc: "Proceed without confirmation question"
239
250
  option :rolling, type: :boolean, default: false, desc: "Upgrade one host at a time"
@@ -241,24 +252,24 @@ class Kamal::Cli::Main < Kamal::Cli::Base
241
252
  confirming "This will replace Traefik with kamal-proxy and restart all accessories" do
242
253
  modify(lock: true) do
243
254
  if options[:rolling]
244
- KAMAL.hosts.each do |host|
245
- KAMAL.with_specific_hosts(host) do
255
+ DASH.hosts.each do |host|
256
+ DASH.with_specific_hosts(host) do
246
257
  say "Upgrading #{host}...", :magenta
247
- if KAMAL.app_hosts.include?(host)
248
- invoke "kamal:cli:proxy:upgrade", [], options.merge(confirmed: true, rolling: false)
249
- reset_invocation(Kamal::Cli::Proxy)
258
+ if DASH.app_hosts.include?(host)
259
+ invoke "dash:cli:proxy:upgrade", [], options.merge(confirmed: true, rolling: false)
260
+ reset_invocation(Dash::Cli::Proxy)
250
261
  end
251
- if KAMAL.accessory_hosts.include?(host)
252
- invoke "kamal:cli:accessory:upgrade", [ "all" ], options.merge(confirmed: true, rolling: false)
253
- reset_invocation(Kamal::Cli::Accessory)
262
+ if DASH.accessory_hosts.include?(host)
263
+ invoke "dash:cli:accessory:upgrade", [ "all" ], options.merge(confirmed: true, rolling: false)
264
+ reset_invocation(Dash::Cli::Accessory)
254
265
  end
255
266
  say "Upgraded #{host}", :magenta
256
267
  end
257
268
  end
258
269
  else
259
270
  say "Upgrading all hosts...", :magenta
260
- invoke "kamal:cli:proxy:upgrade", [], options.merge(confirmed: true)
261
- invoke "kamal:cli:accessory:upgrade", [ "all" ], options.merge(confirmed: true)
271
+ invoke "dash:cli:proxy:upgrade", [], options.merge(confirmed: true)
272
+ invoke "dash:cli:accessory:upgrade", [ "all" ], options.merge(confirmed: true)
262
273
  say "Upgraded all hosts", :magenta
263
274
  end
264
275
  end
@@ -267,42 +278,42 @@ class Kamal::Cli::Main < Kamal::Cli::Base
267
278
 
268
279
  desc "version", "Show dash version"
269
280
  def version
270
- puts Kamal::VERSION
281
+ puts Dash::VERSION
271
282
  end
272
283
 
273
284
  desc "accessory", "Manage accessories (db/redis/search)"
274
- subcommand "accessory", Kamal::Cli::Accessory
285
+ subcommand "accessory", Dash::Cli::Accessory
275
286
 
276
287
  desc "app", "Manage application"
277
- subcommand "app", Kamal::Cli::App
288
+ subcommand "app", Dash::Cli::App
278
289
 
279
290
  desc "build", "Build application image"
280
- subcommand "build", Kamal::Cli::Build
291
+ subcommand "build", Dash::Cli::Build
281
292
 
282
293
  desc "lock", "Manage the deploy lock"
283
- subcommand "lock", Kamal::Cli::Lock
294
+ subcommand "lock", Dash::Cli::Lock
284
295
 
285
296
  desc "proxy", "Manage kamal-proxy"
286
- subcommand "proxy", Kamal::Cli::Proxy
297
+ subcommand "proxy", Dash::Cli::Proxy
287
298
 
288
299
  desc "prune", "Prune old application images and containers"
289
- subcommand "prune", Kamal::Cli::Prune
300
+ subcommand "prune", Dash::Cli::Prune
290
301
 
291
302
  desc "registry", "Login and -out of the image registry"
292
- subcommand "registry", Kamal::Cli::Registry
303
+ subcommand "registry", Dash::Cli::Registry
293
304
 
294
305
  desc "secrets", "Helpers for extracting secrets"
295
- subcommand "secrets", Kamal::Cli::Secrets
306
+ subcommand "secrets", Dash::Cli::Secrets
296
307
 
297
308
  desc "server", "Bootstrap servers with curl and Docker"
298
- subcommand "server", Kamal::Cli::Server
309
+ subcommand "server", Dash::Cli::Server
299
310
 
300
311
  private
301
312
  def container_available?(version)
302
313
  begin
303
- on(KAMAL.app_hosts) do
304
- KAMAL.roles_on(host).each do |role|
305
- container_id = capture_with_info(*KAMAL.app(role: role, host: host).container_id_for_version(version))
314
+ on(DASH.app_hosts) do
315
+ DASH.roles_on(host).each do |role|
316
+ container_id = capture_with_info(*DASH.app(role: role, host: host).container_id_for_version(version))
306
317
  raise "Container not found" unless container_id.present?
307
318
  end
308
319
  end
@@ -321,13 +332,13 @@ class Kamal::Cli::Main < Kamal::Cli::Base
321
332
  def deploy_options
322
333
  base_options = options.without("skip_push")
323
334
  base_options = base_options.except("no_cache") unless base_options["no_cache"]
324
- { "version" => KAMAL.config.version }.merge(base_options)
335
+ { "version" => DASH.config.version }.merge(base_options)
325
336
  end
326
337
 
327
338
  def print_doctor_report(results)
328
339
  results.group_by(&:title).each do |title, rows|
329
340
  say title
330
- rows.each { |row| say " #{row}", Kamal::Cli::Doctor::STATUS_COLORS[row.status] }
341
+ rows.each { |row| say " #{row}", Dash::Cli::Doctor::STATUS_COLORS[row.status] }
331
342
  end
332
343
  end
333
344
 
@@ -345,7 +356,7 @@ class Kamal::Cli::Main < Kamal::Cli::Base
345
356
  end
346
357
 
347
358
  def print_config_banner
348
- config = KAMAL.config
359
+ config = DASH.config
349
360
 
350
361
  say "Deploying #{config.service}#{" to #{config.destination}" if config.destination} (version #{config.abbreviated_version})", :magenta
351
362
  config.roles.each do |role|
@@ -1,4 +1,4 @@
1
- class Kamal::Cli::Proxy::Drift
1
+ class Dash::Cli::Proxy::Drift
2
2
  attr_reader :host, :sshkit
3
3
  delegate :capture_with_info, to: :sshkit
4
4
 
@@ -24,7 +24,7 @@ class Kamal::Cli::Proxy::Drift
24
24
  @expected_digest ||= if proxy.proxy_run_config
25
25
  proxy.proxy_run_config.config_digest
26
26
  else
27
- Kamal::Configuration::Proxy::Run.digest(capture_with_info(*proxy.boot_config).strip)
27
+ Dash::Configuration::Proxy::Run.digest(capture_with_info(*proxy.boot_config).strip)
28
28
  end
29
29
  end
30
30
 
@@ -34,6 +34,6 @@ class Kamal::Cli::Proxy::Drift
34
34
  end
35
35
 
36
36
  def proxy
37
- @proxy ||= KAMAL.proxy(host)
37
+ @proxy ||= DASH.proxy(host)
38
38
  end
39
39
  end
@@ -1,7 +1,7 @@
1
1
  # Ownership bookkeeping for a load balancer host that more than one dash app
2
2
  # may be deploying to. Kamal only ever sees one deploy.yml at a time, so the
3
3
  # other apps are visible solely through the files they left on the host.
4
- class Kamal::Cli::Proxy::LoadbalancerClaim
4
+ class Dash::Cli::Proxy::LoadbalancerClaim
5
5
  attr_reader :host, :sshkit
6
6
  delegate :capture_with_info, :execute, :upload!, :warn, to: :sshkit
7
7
 
@@ -55,11 +55,11 @@ class Kamal::Cli::Proxy::LoadbalancerClaim
55
55
 
56
56
  private
57
57
  def config
58
- KAMAL.loadbalancer_config
58
+ DASH.loadbalancer_config
59
59
  end
60
60
 
61
61
  def commands
62
- KAMAL.loadbalancer
62
+ DASH.loadbalancer
63
63
  end
64
64
 
65
65
  # Owner tokens are "<service-and-destination> <repository>"; the repository
@@ -5,7 +5,7 @@
5
5
  # Unlike the proxy hosts' port-holder handoff this is stop -> run: the
6
6
  # loadbalancer keeps its service state in the config volume, which the
7
7
  # replacement container re-mounts, so every app's routes survive the gap.
8
- class Kamal::Cli::Proxy::LoadbalancerReboot
8
+ class Dash::Cli::Proxy::LoadbalancerReboot
9
9
  READY_TIMEOUT = 30
10
10
 
11
11
  attr_reader :host, :sshkit
@@ -17,30 +17,30 @@ class Kamal::Cli::Proxy::LoadbalancerReboot
17
17
  end
18
18
 
19
19
  def run
20
- execute *KAMAL.auditor.record("Rebooted loadbalancer"), verbosity: :debug
21
- execute *KAMAL.registry.login
20
+ execute *DASH.auditor.record("Rebooted loadbalancer"), verbosity: :debug
21
+ execute *DASH.registry.login
22
22
 
23
- info "Stopping and removing #{KAMAL.loadbalancer.container_name} on #{host}, if running..."
24
- execute *KAMAL.loadbalancer.stop, raise_on_non_zero_exit: false
25
- execute *KAMAL.loadbalancer.remove_container
23
+ info "Stopping and removing #{DASH.loadbalancer.container_name} on #{host}, if running..."
24
+ execute *DASH.loadbalancer.stop, raise_on_non_zero_exit: false
25
+ execute *DASH.loadbalancer.remove_container
26
26
 
27
- if (lb_run = KAMAL.loadbalancer_config.run).secrets?
28
- execute *KAMAL.loadbalancer.ensure_proxy_directory
27
+ if (lb_run = DASH.loadbalancer_config.run).secrets?
28
+ execute *DASH.loadbalancer.ensure_proxy_directory
29
29
  upload! lb_run.secrets_io, lb_run.secrets_path, mode: "0600"
30
30
  else
31
- execute *KAMAL.loadbalancer.remove_proxy_secrets_file, raise_on_non_zero_exit: false
31
+ execute *DASH.loadbalancer.remove_proxy_secrets_file, raise_on_non_zero_exit: false
32
32
  end
33
33
 
34
- execute *KAMAL.loadbalancer.ensure_apps_config_directory
35
- Kamal::Cli::Proxy::LoadbalancerClaim.new(host, sshkit).claim_run_config(replace: true)
36
- execute *KAMAL.loadbalancer.run
34
+ execute *DASH.loadbalancer.ensure_apps_config_directory
35
+ Dash::Cli::Proxy::LoadbalancerClaim.new(host, sshkit).claim_run_config(replace: true)
36
+ execute *DASH.loadbalancer.run
37
37
 
38
38
  wait_until_ready
39
39
  verify_service if re_register_service
40
40
 
41
41
  # kamal-proxy keeps its service state in the config volume, which the
42
42
  # replacement container re-mounts - every app's routes survive.
43
- services = capture_with_info(*KAMAL.loadbalancer.list).strip
43
+ services = capture_with_info(*DASH.loadbalancer.list).strip
44
44
  info "Services registered on the load balancer at #{host} after reboot:\n#{services}"
45
45
  end
46
46
 
@@ -49,9 +49,9 @@ class Kamal::Cli::Proxy::LoadbalancerReboot
49
49
  deadline = Time.now + READY_TIMEOUT
50
50
 
51
51
  begin
52
- capture_with_info(*KAMAL.loadbalancer.list, verbosity: :debug)
52
+ capture_with_info(*DASH.loadbalancer.list, verbosity: :debug)
53
53
  rescue SSHKit::Command::Failed
54
- raise Kamal::Cli::BootError, "the load balancer on #{host} did not become ready within #{READY_TIMEOUT} seconds" if Time.now >= deadline
54
+ raise Dash::Cli::BootError, "the load balancer on #{host} did not become ready within #{READY_TIMEOUT} seconds" if Time.now >= deadline
55
55
  sleep 0.5
56
56
  retry
57
57
  end
@@ -67,21 +67,21 @@ class Kamal::Cli::Proxy::LoadbalancerReboot
67
67
  # --recheck-targets-on-restore re-verifies). No owner record, or a foreign
68
68
  # one, means nothing of ours to restore.
69
69
  def re_register_service
70
- owner = capture_with_info(*KAMAL.loadbalancer.read_service_owner, raise_on_non_zero_exit: false).strip
71
- return false unless owner == KAMAL.loadbalancer_config.owner_token
70
+ owner = capture_with_info(*DASH.loadbalancer.read_service_owner, raise_on_non_zero_exit: false).strip
71
+ return false unless owner == DASH.loadbalancer_config.owner_token
72
72
 
73
- info "Re-registering #{KAMAL.config.service} with the load balancer on #{host}..."
74
- execute *KAMAL.loadbalancer.deploy(targets: KAMAL.loadbalancer_config.target_hosts)
73
+ info "Re-registering #{DASH.config.service} with the load balancer on #{host}..."
74
+ execute *DASH.loadbalancer.deploy(targets: DASH.loadbalancer_config.target_hosts)
75
75
  true
76
76
  end
77
77
 
78
78
  # `list --json` returns {"services": {"<name>": ...}} - exact key
79
79
  # membership, same as the per-host proxy reboot's verification.
80
80
  def verify_service
81
- listed = JSON.parse(capture_with_info(*KAMAL.loadbalancer.list(json: true))).fetch("services", {}).keys
81
+ listed = JSON.parse(capture_with_info(*DASH.loadbalancer.list(json: true))).fetch("services", {}).keys
82
82
 
83
- unless listed.include?(KAMAL.config.service)
84
- raise Kamal::Cli::BootError, "the load balancer on #{host} is missing service #{KAMAL.config.service} after reboot"
83
+ unless listed.include?(DASH.config.service)
84
+ raise Dash::Cli::BootError, "the load balancer on #{host} is missing service #{DASH.config.service} after reboot"
85
85
  end
86
86
  end
87
87
  end
@@ -1,4 +1,4 @@
1
- class Kamal::Cli::Proxy::Reboot
1
+ class Dash::Cli::Proxy::Reboot
2
2
  READY_TIMEOUT = 30
3
3
 
4
4
  attr_reader :host, :sshkit
@@ -10,8 +10,8 @@ class Kamal::Cli::Proxy::Reboot
10
10
  end
11
11
 
12
12
  def run
13
- execute *KAMAL.auditor.record("Rebooted proxy"), verbosity: :debug
14
- execute *KAMAL.registry.login
13
+ execute *DASH.auditor.record("Rebooted proxy"), verbosity: :debug
14
+ execute *DASH.registry.login
15
15
 
16
16
  pull_image
17
17
  replace_container
@@ -21,11 +21,11 @@ class Kamal::Cli::Proxy::Reboot
21
21
 
22
22
  private
23
23
  def proxy
24
- @proxy ||= KAMAL.proxy(host)
24
+ @proxy ||= DASH.proxy(host)
25
25
  end
26
26
 
27
27
  def drift
28
- @drift ||= Kamal::Cli::Proxy::Drift.new(host, sshkit)
28
+ @drift ||= Dash::Cli::Proxy::Drift.new(host, sshkit)
29
29
  end
30
30
 
31
31
  # Pull before stopping the old container: a registry outage or rate limit
@@ -52,7 +52,7 @@ class Kamal::Cli::Proxy::Reboot
52
52
  # generation starts. This used to live inside stop_and_replace only, and
53
53
  # the port-holder paths launched their generation without it — a
54
54
  # port-holder reboot on a host without the file died with
55
- # "open .kamal/proxy/secrets.env: no such file or directory".
55
+ # "open .dash/proxy/secrets.env: no such file or directory".
56
56
  def sync_proxy_secrets
57
57
  if (run_config = proxy.proxy_run_config)&.secrets?
58
58
  upload! run_config.secrets_io, run_config.secrets_path, mode: "0600"
@@ -65,7 +65,7 @@ class Kamal::Cli::Proxy::Reboot
65
65
  # Phase 1 replacement: stop the old container, start the new one. Brief gap.
66
66
  def stop_and_replace
67
67
  info "Stopping and removing kamal-proxy on #{host}, if running..."
68
- execute *proxy.stop(timeout: KAMAL.config.drain_timeout + 10), raise_on_non_zero_exit: false
68
+ execute *proxy.stop(timeout: DASH.config.drain_timeout + 10), raise_on_non_zero_exit: false
69
69
  execute *proxy.remove_container
70
70
 
71
71
  execute *proxy.run(digest: drift.expected_digest)
@@ -93,7 +93,7 @@ class Kamal::Cli::Proxy::Reboot
93
93
  wait_until_ready(name: proxy.next_container_name)
94
94
 
95
95
  execute *proxy.disable_restart
96
- execute *proxy.drain(timeout: KAMAL.config.drain_timeout)
96
+ execute *proxy.drain(timeout: DASH.config.drain_timeout)
97
97
  execute *proxy.wait_for_exit
98
98
  execute *proxy.remove_stopped_container
99
99
  execute *proxy.promote_next_container
@@ -103,7 +103,7 @@ class Kamal::Cli::Proxy::Reboot
103
103
  # them until it is gone. One final replacement with a brief gap.
104
104
  def migrate_to_holder
105
105
  info "Migrating kamal-proxy on #{host} to the port-holder architecture (brief gap)..."
106
- execute *proxy.stop(timeout: KAMAL.config.drain_timeout + 10), raise_on_non_zero_exit: false
106
+ execute *proxy.stop(timeout: DASH.config.drain_timeout + 10), raise_on_non_zero_exit: false
107
107
  execute *proxy.remove_container
108
108
 
109
109
  execute *proxy.run_holder
@@ -124,7 +124,7 @@ class Kamal::Cli::Proxy::Reboot
124
124
  begin
125
125
  capture_with_info(*proxy.list(**{ name: name }.compact), verbosity: :debug)
126
126
  rescue SSHKit::Command::Failed
127
- raise Kamal::Cli::BootError, "kamal-proxy on #{host} did not become ready within #{READY_TIMEOUT} seconds" if Time.now >= deadline
127
+ raise Dash::Cli::BootError, "kamal-proxy on #{host} did not become ready within #{READY_TIMEOUT} seconds" if Time.now >= deadline
128
128
  sleep 0.5
129
129
  retry
130
130
  end
@@ -137,8 +137,8 @@ class Kamal::Cli::Proxy::Reboot
137
137
  def re_register_services
138
138
  registered_services = []
139
139
 
140
- KAMAL.roles_on(host).select(&:running_proxy?).each do |role|
141
- app = KAMAL.app(role: role, host: host)
140
+ DASH.roles_on(host).select(&:running_proxy?).each do |role|
141
+ app = DASH.app(role: role, host: host)
142
142
 
143
143
  version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip.presence
144
144
  next unless version
@@ -151,10 +151,10 @@ class Kamal::Cli::Proxy::Reboot
151
151
  registered_services << role.container_prefix
152
152
  end
153
153
 
154
- KAMAL.config.accessories.select(&:running_proxy?).each do |accessory_config|
154
+ DASH.config.accessories.select(&:running_proxy?).each do |accessory_config|
155
155
  next unless accessory_config.hosts.include?(host.to_s)
156
156
 
157
- accessory = KAMAL.accessory(accessory_config.name)
157
+ accessory = DASH.accessory(accessory_config.name)
158
158
  target = capture_with_info(*accessory.container_id_for(container_name: accessory_config.service_name, only_running: true), raise_on_non_zero_exit: false).strip.presence
159
159
  next unless target
160
160
 
@@ -176,7 +176,7 @@ class Kamal::Cli::Proxy::Reboot
176
176
  missing = registered_services - listed
177
177
 
178
178
  if missing.any?
179
- raise Kamal::Cli::BootError, "kamal-proxy on #{host} is missing services after reboot: #{missing.join(", ")}"
179
+ raise Dash::Cli::BootError, "kamal-proxy on #{host} is missing services after reboot: #{missing.join(", ")}"
180
180
  end
181
181
  end
182
182
  end