dash 3.2.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) 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 +16 -16
  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 +87 -87
  12. data/lib/{kamal → dash}/cli/base.rb +72 -48
  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 +26 -8
  18. data/lib/{kamal → dash}/cli/doctor/host_checks.rb +22 -22
  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 +82 -71
  27. data/lib/{kamal → dash}/cli/proxy/drift.rb +3 -3
  28. data/lib/dash/cli/proxy/legacy_rename.rb +58 -0
  29. data/lib/{kamal → dash}/cli/proxy/loadbalancer_claim.rb +3 -3
  30. data/lib/{kamal → dash}/cli/proxy/loadbalancer_reboot.rb +23 -23
  31. data/lib/{kamal → dash}/cli/proxy/reboot.rb +21 -21
  32. data/lib/{kamal → dash}/cli/proxy.rb +178 -162
  33. data/lib/{kamal → dash}/cli/prune.rb +10 -10
  34. data/lib/{kamal → dash}/cli/registry.rb +11 -11
  35. data/lib/{kamal → dash}/cli/secrets.rb +3 -3
  36. data/lib/{kamal → dash}/cli/server.rb +14 -14
  37. data/lib/{kamal → dash}/cli/templates/deploy.yml +4 -4
  38. data/lib/dash/cli/templates/sample_hooks/docker-setup.sample +3 -0
  39. data/lib/dash/cli/templates/sample_hooks/post-app-boot.sample +3 -0
  40. data/lib/dash/cli/templates/sample_hooks/post-app-stop.sample +9 -0
  41. data/lib/dash/cli/templates/sample_hooks/post-deploy.sample +14 -0
  42. data/lib/dash/cli/templates/sample_hooks/post-proxy-deploy.sample +3 -0
  43. data/lib/dash/cli/templates/sample_hooks/post-proxy-reboot.sample +3 -0
  44. data/lib/dash/cli/templates/sample_hooks/pre-app-boot.sample +3 -0
  45. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-app-stop.sample +2 -2
  46. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-build.sample +8 -8
  47. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-connect.sample +8 -8
  48. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-deploy.sample +9 -9
  49. data/lib/dash/cli/templates/sample_hooks/pre-proxy-deploy.sample +3 -0
  50. data/lib/dash/cli/templates/sample_hooks/pre-proxy-reboot.sample +3 -0
  51. data/lib/{kamal → dash}/cli/templates/secrets +6 -6
  52. data/lib/{kamal → dash}/cli.rb +2 -2
  53. data/lib/{kamal → dash}/commander/specifics.rb +2 -2
  54. data/lib/{kamal → dash}/commander.rb +32 -24
  55. data/lib/{kamal → dash}/commands/accessory/proxy.rb +2 -2
  56. data/lib/{kamal → dash}/commands/accessory.rb +2 -2
  57. data/lib/{kamal → dash}/commands/app/assets.rb +1 -1
  58. data/lib/{kamal → dash}/commands/app/containers.rb +1 -1
  59. data/lib/{kamal → dash}/commands/app/error_pages.rb +2 -2
  60. data/lib/{kamal → dash}/commands/app/execution.rb +2 -2
  61. data/lib/{kamal → dash}/commands/app/images.rb +1 -1
  62. data/lib/{kamal → dash}/commands/app/logging.rb +1 -1
  63. data/lib/{kamal → dash}/commands/app/proxy.rb +2 -2
  64. data/lib/{kamal → dash}/commands/app.rb +2 -2
  65. data/lib/{kamal → dash}/commands/auditor.rb +3 -7
  66. data/lib/{kamal → dash}/commands/base.rb +39 -3
  67. data/lib/{kamal → dash}/commands/builder/base.rb +2 -2
  68. data/lib/{kamal → dash}/commands/builder/clone.rb +3 -3
  69. data/lib/{kamal → dash}/commands/builder/cloud.rb +1 -1
  70. data/lib/{kamal → dash}/commands/builder/hybrid.rb +1 -1
  71. data/lib/{kamal → dash}/commands/builder/local.rb +1 -1
  72. data/lib/{kamal → dash}/commands/builder/pack.rb +1 -1
  73. data/lib/{kamal → dash}/commands/builder/remote.rb +1 -1
  74. data/lib/{kamal → dash}/commands/builder.rb +7 -7
  75. data/lib/dash/commands/docker.rb +89 -0
  76. data/lib/{kamal → dash}/commands/hook.rb +1 -1
  77. data/lib/{kamal → dash}/commands/loadbalancer.rb +55 -24
  78. data/lib/{kamal → dash}/commands/lock.rb +3 -3
  79. data/lib/{kamal → dash}/commands/proxy/cert_transfer.rb +6 -6
  80. data/lib/dash/commands/proxy.rb +375 -0
  81. data/lib/{kamal → dash}/commands/prune.rb +2 -2
  82. data/lib/dash/commands/registry.rb +44 -0
  83. data/lib/{kamal → dash}/commands/server.rb +1 -5
  84. data/lib/dash/commands.rb +2 -0
  85. data/lib/{kamal → dash}/configuration/accessory.rb +13 -13
  86. data/lib/{kamal → dash}/configuration/alias.rb +3 -3
  87. data/lib/{kamal → dash}/configuration/boot.rb +2 -2
  88. data/lib/{kamal → dash}/configuration/builder.rb +7 -7
  89. data/lib/{kamal → dash}/configuration/docs/accessory.yml +3 -3
  90. data/lib/{kamal → dash}/configuration/docs/builder.yml +3 -3
  91. data/lib/{kamal → dash}/configuration/docs/configuration.yml +13 -6
  92. data/lib/{kamal → dash}/configuration/docs/env.yml +10 -10
  93. data/lib/{kamal → dash}/configuration/docs/proxy.yml +68 -45
  94. data/lib/{kamal → dash}/configuration/docs/registry.yml +5 -5
  95. data/lib/{kamal → dash}/configuration/env/tag.rb +2 -2
  96. data/lib/{kamal → dash}/configuration/env.rb +5 -5
  97. data/lib/{kamal → dash}/configuration/loadbalancer.rb +5 -5
  98. data/lib/{kamal → dash}/configuration/logging.rb +3 -3
  99. data/lib/{kamal → dash}/configuration/output.rb +4 -4
  100. data/lib/{kamal → dash}/configuration/proxy/acme.rb +9 -8
  101. data/lib/{kamal → dash}/configuration/proxy/boot.rb +9 -11
  102. data/lib/{kamal → dash}/configuration/proxy/run.rb +20 -20
  103. data/lib/{kamal → dash}/configuration/proxy.rb +51 -29
  104. data/lib/{kamal → dash}/configuration/registry.rb +3 -3
  105. data/lib/{kamal → dash}/configuration/role/healthcheck.rb +3 -3
  106. data/lib/{kamal → dash}/configuration/role.rb +14 -14
  107. data/lib/{kamal → dash}/configuration/servers.rb +4 -4
  108. data/lib/{kamal → dash}/configuration/ssh.rb +2 -2
  109. data/lib/{kamal → dash}/configuration/sshkit.rb +2 -2
  110. data/lib/{kamal → dash}/configuration/validation.rb +2 -2
  111. data/lib/{kamal → dash}/configuration/validator/accessory.rb +1 -1
  112. data/lib/{kamal → dash}/configuration/validator/alias.rb +2 -2
  113. data/lib/{kamal → dash}/configuration/validator/builder.rb +1 -1
  114. data/lib/dash/configuration/validator/configuration.rb +6 -0
  115. data/lib/{kamal → dash}/configuration/validator/env.rb +2 -2
  116. data/lib/{kamal → dash}/configuration/validator/proxy.rb +31 -31
  117. data/lib/{kamal → dash}/configuration/validator/registry.rb +1 -1
  118. data/lib/{kamal → dash}/configuration/validator/role.rb +1 -1
  119. data/lib/{kamal → dash}/configuration/validator/servers.rb +1 -1
  120. data/lib/{kamal → dash}/configuration/validator.rb +4 -4
  121. data/lib/{kamal → dash}/configuration/volume.rb +2 -2
  122. data/lib/{kamal → dash}/configuration.rb +47 -37
  123. data/lib/{kamal → dash}/docker.rb +1 -1
  124. data/lib/{kamal → dash}/env_file.rb +1 -1
  125. data/lib/{kamal → dash}/git.rb +1 -1
  126. data/lib/{kamal → dash}/otel_shipper.rb +3 -3
  127. data/lib/{kamal → dash}/output/base_logger.rb +1 -1
  128. data/lib/{kamal → dash}/output/file_logger.rb +1 -1
  129. data/lib/{kamal → dash}/output/formatter.rb +1 -1
  130. data/lib/{kamal → dash}/output/otel_logger.rb +3 -3
  131. data/lib/dash/project_directory.rb +28 -0
  132. data/lib/{kamal → dash}/secrets/adapters/aws_secrets_manager.rb +1 -1
  133. data/lib/{kamal → dash}/secrets/adapters/base.rb +2 -2
  134. data/lib/{kamal → dash}/secrets/adapters/bitwarden.rb +1 -1
  135. data/lib/{kamal → dash}/secrets/adapters/bitwarden_secrets_manager.rb +1 -1
  136. data/lib/{kamal → dash}/secrets/adapters/doppler.rb +1 -1
  137. data/lib/{kamal → dash}/secrets/adapters/enpass.rb +1 -1
  138. data/lib/{kamal → dash}/secrets/adapters/gcp_secret_manager.rb +1 -1
  139. data/lib/{kamal → dash}/secrets/adapters/last_pass.rb +1 -1
  140. data/lib/{kamal → dash}/secrets/adapters/one_password.rb +2 -2
  141. data/lib/{kamal → dash}/secrets/adapters/passbolt.rb +1 -1
  142. data/lib/{kamal → dash}/secrets/adapters/test.rb +1 -1
  143. data/lib/{kamal → dash}/secrets/adapters.rb +2 -2
  144. data/lib/{kamal → dash}/secrets/dotenv/inline_command_substitution.rb +2 -2
  145. data/lib/{kamal → dash}/secrets.rb +6 -6
  146. data/lib/{kamal → dash}/tags.rb +8 -3
  147. data/lib/{kamal → dash}/utils/sensitive.rb +1 -1
  148. data/lib/{kamal → dash}/utils.rb +16 -6
  149. data/lib/dash/version.rb +3 -0
  150. data/lib/{kamal.rb → dash.rb} +4 -4
  151. metadata +157 -154
  152. data/lib/kamal/cli/alias/command.rb +0 -10
  153. data/lib/kamal/cli/build/clone.rb +0 -59
  154. data/lib/kamal/cli/healthcheck/error.rb +0 -2
  155. data/lib/kamal/cli/templates/sample_hooks/docker-setup.sample +0 -3
  156. data/lib/kamal/cli/templates/sample_hooks/post-app-boot.sample +0 -3
  157. data/lib/kamal/cli/templates/sample_hooks/post-app-stop.sample +0 -9
  158. data/lib/kamal/cli/templates/sample_hooks/post-deploy.sample +0 -14
  159. data/lib/kamal/cli/templates/sample_hooks/post-proxy-deploy.sample +0 -3
  160. data/lib/kamal/cli/templates/sample_hooks/post-proxy-reboot.sample +0 -3
  161. data/lib/kamal/cli/templates/sample_hooks/pre-app-boot.sample +0 -3
  162. data/lib/kamal/cli/templates/sample_hooks/pre-proxy-deploy.sample +0 -3
  163. data/lib/kamal/cli/templates/sample_hooks/pre-proxy-reboot.sample +0 -3
  164. data/lib/kamal/commands/docker.rb +0 -55
  165. data/lib/kamal/commands/proxy.rb +0 -266
  166. data/lib/kamal/commands/registry.rb +0 -38
  167. data/lib/kamal/commands.rb +0 -2
  168. data/lib/kamal/configuration/validator/configuration.rb +0 -6
  169. data/lib/kamal/version.rb +0 -3
  170. /data/lib/{kamal → dash}/configuration/docs/alias.yml +0 -0
  171. /data/lib/{kamal → dash}/configuration/docs/boot.yml +0 -0
  172. /data/lib/{kamal → dash}/configuration/docs/logging.yml +0 -0
  173. /data/lib/{kamal → dash}/configuration/docs/output.yml +0 -0
  174. /data/lib/{kamal → dash}/configuration/docs/role.yml +0 -0
  175. /data/lib/{kamal → dash}/configuration/docs/servers.yml +0 -0
  176. /data/lib/{kamal → dash}/configuration/docs/ssh.yml +0 -0
  177. /data/lib/{kamal → dash}/configuration/docs/sshkit.yml +0 -0
  178. /data/lib/{kamal → dash}/sshkit_with_ext.rb +0 -0
@@ -1,4 +1,4 @@
1
- class Kamal::Cli::App < Kamal::Cli::Base
1
+ class Dash::Cli::App < Dash::Cli::Base
2
2
  desc "boot", "Boot app on servers (or reboot app if already running)"
3
3
  def boot
4
4
  modify(lock: true) do
@@ -7,17 +7,17 @@ class Kamal::Cli::App < Kamal::Cli::Base
7
7
  say "Start container with version #{version} (or reboot if already running)...", :magenta
8
8
 
9
9
  # Assets are prepared in a separate step to ensure they are on all hosts before booting
10
- on(KAMAL.app_hosts) do
11
- Kamal::Cli::App::ErrorPages.new(host, self).run
10
+ on(DASH.app_hosts) do
11
+ Dash::Cli::App::ErrorPages.new(host, self).run
12
12
 
13
- KAMAL.roles_on(host).each do |role|
14
- Kamal::Cli::App::Assets.new(host, role, self).run
15
- Kamal::Cli::App::SslCertificates.new(host, role, self).run
13
+ DASH.roles_on(host).each do |role|
14
+ Dash::Cli::App::Assets.new(host, role, self).run
15
+ Dash::Cli::App::SslCertificates.new(host, role, self).run
16
16
  end
17
17
  end
18
18
 
19
19
  # Primary hosts and roles are returned first, so they can open the barrier
20
- barrier = Kamal::Cli::Healthcheck::Barrier.new
20
+ barrier = Dash::Cli::Healthcheck::Barrier.new
21
21
  cli = self
22
22
 
23
23
  boot_groups = host_boot_groups
@@ -26,8 +26,8 @@ class Kamal::Cli::App < Kamal::Cli::Base
26
26
  host_list = Array(hosts).join(",")
27
27
  run_hook "pre-app-boot", hosts: host_list
28
28
 
29
- on_roles(KAMAL.roles, hosts: hosts, parallel: KAMAL.config.parallel_roles?, rolling: true) do |host, role|
30
- Kamal::Cli::App::Boot.new(host, role, self, version, barrier, cli).run
29
+ on_roles(DASH.roles, hosts: hosts, parallel: DASH.config.parallel_roles?, rolling: true) do |host, role|
30
+ Dash::Cli::App::Boot.new(host, role, self, version, barrier, cli).run
31
31
  end
32
32
 
33
33
  run_hook "post-app-boot", hosts: host_list
@@ -35,13 +35,13 @@ class Kamal::Cli::App < Kamal::Cli::Base
35
35
  # `wait` paces one group against the next, so the last group has nothing to pace
36
36
  # against. Without a `limit` there is only ever one group, and waiting at all
37
37
  # would be a fixed delay on every deploy buying no staggering.
38
- sleep KAMAL.config.boot.wait if KAMAL.config.boot.wait && index < boot_groups.size - 1
38
+ sleep DASH.config.boot.wait if DASH.config.boot.wait && index < boot_groups.size - 1
39
39
  end
40
40
 
41
41
  # Tag once the app booted on all hosts
42
- on(KAMAL.app_hosts) do |host|
43
- execute *KAMAL.auditor.record("Tagging #{KAMAL.config.absolute_image} as the latest image"), verbosity: :debug
44
- execute *KAMAL.app.tag_latest_image
42
+ on(DASH.app_hosts) do |host|
43
+ execute *DASH.auditor.record("Tagging #{DASH.config.absolute_image} as the latest image"), verbosity: :debug
44
+ execute *DASH.app.tag_latest_image
45
45
  end
46
46
  end
47
47
  end
@@ -52,15 +52,15 @@ class Kamal::Cli::App < Kamal::Cli::Base
52
52
  modify(lock: true) do
53
53
  cli = self
54
54
 
55
- on_roles(KAMAL.roles, hosts: KAMAL.app_hosts, parallel: KAMAL.config.parallel_roles?, rolling: true) do |host, role|
56
- app = KAMAL.app(role: role, host: host)
57
- execute *KAMAL.auditor.record("Started app version #{KAMAL.config.version}"), verbosity: :debug
55
+ on_roles(DASH.roles, hosts: DASH.app_hosts, parallel: DASH.config.parallel_roles?, rolling: true) do |host, role|
56
+ app = DASH.app(role: role, host: host)
57
+ execute *DASH.auditor.record("Started app version #{DASH.config.version}"), verbosity: :debug
58
58
  execute *app.start, raise_on_non_zero_exit: false
59
59
 
60
60
  if role.running_proxy?
61
61
  version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip
62
62
  endpoint = capture_with_info(*app.container_id_for_version(version)).strip
63
- raise Kamal::Cli::BootError, "Failed to get endpoint for #{role} on #{host}, did the container boot?" if endpoint.empty?
63
+ raise Dash::Cli::BootError, "Failed to get endpoint for #{role} on #{host}, did the container boot?" if endpoint.empty?
64
64
 
65
65
  cli.run_hook "pre-proxy-deploy", hosts: host.to_s, role: role.name
66
66
  execute *app.deploy(target: endpoint)
@@ -73,9 +73,9 @@ class Kamal::Cli::App < Kamal::Cli::Base
73
73
  desc "stop", "Stop app container on servers"
74
74
  def stop
75
75
  modify(lock: true) do
76
- on_roles(KAMAL.roles, hosts: KAMAL.app_hosts, parallel: KAMAL.config.parallel_roles?) do |host, role|
77
- app = KAMAL.app(role: role, host: host)
78
- execute *KAMAL.auditor.record("Stopped app", role: role), verbosity: :debug
76
+ on_roles(DASH.roles, hosts: DASH.app_hosts, parallel: DASH.config.parallel_roles?) do |host, role|
77
+ app = DASH.app(role: role, host: host)
78
+ execute *DASH.auditor.record("Stopped app", role: role), verbosity: :debug
79
79
 
80
80
  if role.running_proxy?
81
81
  version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip
@@ -94,8 +94,8 @@ class Kamal::Cli::App < Kamal::Cli::Base
94
94
  desc "details", "Show details about app containers"
95
95
  def details
96
96
  quiet = options[:quiet]
97
- on_roles(KAMAL.roles, hosts: KAMAL.app_hosts) do |host, role|
98
- puts_by_host host, capture_with_info(*KAMAL.app(role: role, host: host).info), quiet: quiet
97
+ on_roles(DASH.roles, hosts: DASH.app_hosts) do |host, role|
98
+ puts_by_host host, capture_with_info(*DASH.app(role: role, host: host).info), quiet: quiet
99
99
  end
100
100
  end
101
101
 
@@ -123,7 +123,7 @@ class Kamal::Cli::App < Kamal::Cli::Base
123
123
  with_raw_output(raw) do
124
124
  pre_connect_if_required
125
125
 
126
- cmd = Kamal::Utils.join_commands(cmd)
126
+ cmd = Dash::Utils.join_commands(cmd)
127
127
  env = options[:env]
128
128
  detach = options[:detach]
129
129
  quiet = options[:quiet]
@@ -131,17 +131,17 @@ class Kamal::Cli::App < Kamal::Cli::Base
131
131
  when options[:interactive] && options[:reuse]
132
132
  say "Get current version of running container...", :magenta unless options[:version]
133
133
  using_version(options[:version] || current_running_version) do |version|
134
- say "Launching interactive command with version #{version} via SSH from existing container on #{KAMAL.primary_host}...", :magenta
135
- run_locally { exec KAMAL.app(role: KAMAL.primary_role, host: KAMAL.primary_host).execute_in_existing_container_over_ssh(cmd, env: env) }
134
+ say "Launching interactive command with version #{version} via SSH from existing container on #{DASH.primary_host}...", :magenta
135
+ run_locally { exec DASH.app(role: DASH.primary_role, host: DASH.primary_host).execute_in_existing_container_over_ssh(cmd, env: env) }
136
136
  end
137
137
 
138
138
  when options[:interactive]
139
139
  say "Get most recent version available as an image...", :magenta unless options[:version]
140
140
  using_version(version_or_latest) do |version|
141
- say "Launching interactive command with version #{version} via SSH from new container on #{KAMAL.primary_host}...", :magenta
142
- on(KAMAL.primary_host) { execute *KAMAL.registry.login }
141
+ say "Launching interactive command with version #{version} via SSH from new container on #{DASH.primary_host}...", :magenta
142
+ on(DASH.primary_host) { execute *DASH.registry.login }
143
143
  run_locally do
144
- exec KAMAL.app(role: KAMAL.primary_role, host: KAMAL.primary_host).execute_in_new_container_over_ssh(cmd, env: env)
144
+ exec DASH.app(role: DASH.primary_role, host: DASH.primary_host).execute_in_new_container_over_ssh(cmd, env: env)
145
145
  end
146
146
  end
147
147
 
@@ -150,9 +150,9 @@ class Kamal::Cli::App < Kamal::Cli::Base
150
150
  using_version(options[:version] || current_running_version) do |version|
151
151
  say "Launching command with version #{version} from existing container...", :magenta
152
152
 
153
- on_roles(KAMAL.roles, hosts: KAMAL.app_hosts) do |host, role|
154
- execute *KAMAL.auditor.record("Executed cmd '#{cmd}' on app version #{version}", role: role), verbosity: :debug
155
- puts_by_host host, capture_with_info(*KAMAL.app(role: role, host: host).execute_in_existing_container(cmd, env: env), strip: !raw), quiet: quiet, raw: raw
153
+ on_roles(DASH.roles, hosts: DASH.app_hosts) do |host, role|
154
+ execute *DASH.auditor.record("Executed cmd '#{cmd}' on app version #{version}", role: role), verbosity: :debug
155
+ puts_by_host host, capture_with_info(*DASH.app(role: role, host: host).execute_in_existing_container(cmd, env: env), strip: !raw), quiet: quiet, raw: raw
156
156
  end
157
157
  end
158
158
 
@@ -160,11 +160,11 @@ class Kamal::Cli::App < Kamal::Cli::Base
160
160
  say "Get most recent version available as an image...", :magenta unless options[:version]
161
161
  using_version(version_or_latest) do |version|
162
162
  say "Launching command with version #{version} from new container...", :magenta
163
- on(KAMAL.app_hosts) { execute *KAMAL.registry.login }
163
+ on(DASH.app_hosts) { execute *DASH.registry.login }
164
164
 
165
- on_roles(KAMAL.roles, hosts: KAMAL.app_hosts) do |host, role|
166
- execute *KAMAL.auditor.record("Executed cmd '#{cmd}' on app version #{version}"), verbosity: :debug
167
- puts_by_host host, capture_with_info(*KAMAL.app(role: role, host: host).execute_in_new_container(cmd, env: env, detach: detach), strip: !raw), quiet: quiet, raw: raw
165
+ on_roles(DASH.roles, hosts: DASH.app_hosts) do |host, role|
166
+ execute *DASH.auditor.record("Executed cmd '#{cmd}' on app version #{version}"), verbosity: :debug
167
+ puts_by_host host, capture_with_info(*DASH.app(role: role, host: host).execute_in_new_container(cmd, env: env, detach: detach), strip: !raw), quiet: quiet, raw: raw
168
168
  end
169
169
  end
170
170
  end
@@ -174,7 +174,7 @@ class Kamal::Cli::App < Kamal::Cli::Base
174
174
  desc "containers", "Show app containers on servers"
175
175
  def containers
176
176
  quiet = options[:quiet]
177
- on(KAMAL.app_hosts) { |host| puts_by_host host, capture_with_info(*KAMAL.app.list_containers), quiet: quiet }
177
+ on(DASH.app_hosts) { |host| puts_by_host host, capture_with_info(*DASH.app.list_containers), quiet: quiet }
178
178
  end
179
179
 
180
180
  desc "stale_containers", "Detect app stale containers"
@@ -184,8 +184,8 @@ class Kamal::Cli::App < Kamal::Cli::Base
184
184
  stop = options[:stop]
185
185
 
186
186
  with_lock_if_stopping do
187
- on_roles(KAMAL.roles, hosts: KAMAL.app_hosts) do |host, role|
188
- app = KAMAL.app(role: role, host: host)
187
+ on_roles(DASH.roles, hosts: DASH.app_hosts) do |host, role|
188
+ app = DASH.app(role: role, host: host)
189
189
  versions = capture_with_info(*app.list_versions, raise_on_non_zero_exit: false).split("\n")
190
190
  versions -= [ capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip ]
191
191
 
@@ -204,7 +204,7 @@ class Kamal::Cli::App < Kamal::Cli::Base
204
204
  desc "images", "Show app images on servers"
205
205
  def images
206
206
  quiet = options[:quiet]
207
- on(KAMAL.app_hosts) { |host| puts_by_host host, capture_with_info(*KAMAL.app.list_images), quiet: quiet }
207
+ on(DASH.app_hosts) { |host| puts_by_host host, capture_with_info(*DASH.app.list_images), quiet: quiet }
208
208
  end
209
209
 
210
210
  desc "logs", "Show log lines from app on servers (use --help to show options)"
@@ -229,21 +229,21 @@ class Kamal::Cli::App < Kamal::Cli::Base
229
229
  lines = options[:lines].presence || ((since || grep) ? nil : 10) # Default to 10 lines if since or grep isn't set
230
230
 
231
231
  run_locally do
232
- info "Following logs on #{KAMAL.primary_host}..."
232
+ info "Following logs on #{DASH.primary_host}..."
233
233
 
234
- KAMAL.specific_roles ||= [ KAMAL.primary_role.name ]
235
- role = KAMAL.roles_on(KAMAL.primary_host).first
234
+ DASH.specific_roles ||= [ DASH.primary_role.name ]
235
+ role = DASH.roles_on(DASH.primary_host).first
236
236
 
237
- app = KAMAL.app(role: role, host: host)
238
- info app.follow_logs(host: KAMAL.primary_host, container_id: container_id, timestamps: timestamps, lines: lines, grep: grep, grep_options: grep_options)
239
- exec app.follow_logs(host: KAMAL.primary_host, container_id: container_id, timestamps: timestamps, lines: lines, grep: grep, grep_options: grep_options)
237
+ app = DASH.app(role: role, host: host)
238
+ info app.follow_logs(host: DASH.primary_host, container_id: container_id, timestamps: timestamps, lines: lines, grep: grep, grep_options: grep_options)
239
+ exec app.follow_logs(host: DASH.primary_host, container_id: container_id, timestamps: timestamps, lines: lines, grep: grep, grep_options: grep_options)
240
240
  end
241
241
  else
242
242
  lines = options[:lines].presence || ((since || grep) ? nil : 100) # Default to 100 lines if since or grep isn't set
243
243
 
244
- on_roles(KAMAL.roles, hosts: KAMAL.app_hosts) do |host, role|
244
+ on_roles(DASH.roles, hosts: DASH.app_hosts) do |host, role|
245
245
  begin
246
- puts_by_host host, capture_with_info(*KAMAL.app(role: role, host: host).logs(container_id: container_id, timestamps: timestamps, since: since, lines: lines, grep: grep, grep_options: grep_options)), quiet: quiet
246
+ puts_by_host host, capture_with_info(*DASH.app(role: role, host: host).logs(container_id: container_id, timestamps: timestamps, since: since, lines: lines, grep: grep, grep_options: grep_options)), quiet: quiet
247
247
  rescue SSHKit::Command::Failed
248
248
  puts_by_host host, "Nothing found", quiet: quiet
249
249
  end
@@ -264,8 +264,8 @@ class Kamal::Cli::App < Kamal::Cli::Base
264
264
  desc "live", "Set the app to live mode"
265
265
  def live
266
266
  modify(lock: true) do
267
- on_roles(KAMAL.roles, hosts: KAMAL.proxy_hosts) do |host, role|
268
- execute *KAMAL.app(role: role, host: host).live if role.running_proxy?
267
+ on_roles(DASH.roles, hosts: DASH.proxy_hosts) do |host, role|
268
+ execute *DASH.app(role: role, host: host).live if role.running_proxy?
269
269
  end
270
270
  end
271
271
  end
@@ -274,16 +274,16 @@ class Kamal::Cli::App < Kamal::Cli::Base
274
274
  option :drain_timeout, type: :numeric, desc: "How long to allow in-flight requests to complete (defaults to drain_timeout from config)"
275
275
  option :message, type: :string, desc: "Message to display to clients while stopped"
276
276
  def maintenance
277
- maintenance_options = { drain_timeout: options[:drain_timeout] || KAMAL.config.drain_timeout, message: options[:message] }
277
+ maintenance_options = { drain_timeout: options[:drain_timeout] || DASH.config.drain_timeout, message: options[:message] }
278
278
 
279
279
  modify(lock: true) do
280
- on_roles(KAMAL.roles, hosts: KAMAL.proxy_hosts) do |host, role|
281
- execute *KAMAL.app(role: role, host: host).maintenance(**maintenance_options) if role.running_proxy?
280
+ on_roles(DASH.roles, hosts: DASH.proxy_hosts) do |host, role|
281
+ execute *DASH.app(role: role, host: host).maintenance(**maintenance_options) if role.running_proxy?
282
282
  end
283
283
  end
284
284
  end
285
285
 
286
- desc "rollout <deploy|set|stop>", "Manage a canary rollout of a new version through kamal-proxy"
286
+ desc "rollout <deploy|set|stop>", "Manage a canary rollout of a new version through dash-proxy"
287
287
  option :percent, type: :numeric, desc: "Percentage of traffic to send to the rollout target"
288
288
  option :list, type: :array, desc: "Send requests whose kamal-rollout cookie matches these values to the rollout target"
289
289
  def rollout(action)
@@ -298,9 +298,9 @@ class Kamal::Cli::App < Kamal::Cli::Base
298
298
  desc "remove_container [VERSION]", "Remove app container with given version from servers", hide: true
299
299
  def remove_container(version)
300
300
  modify(lock: true) do
301
- on_roles(KAMAL.roles, hosts: KAMAL.app_hosts) do |host, role|
302
- execute *KAMAL.auditor.record("Removed app container with version #{version}", role: role), verbosity: :debug
303
- execute *KAMAL.app(role: role, host: host).remove_container(version: version)
301
+ on_roles(DASH.roles, hosts: DASH.app_hosts) do |host, role|
302
+ execute *DASH.auditor.record("Removed app container with version #{version}", role: role), verbosity: :debug
303
+ execute *DASH.app(role: role, host: host).remove_container(version: version)
304
304
  end
305
305
  end
306
306
  end
@@ -308,9 +308,9 @@ class Kamal::Cli::App < Kamal::Cli::Base
308
308
  desc "remove_containers", "Remove all app containers from servers", hide: true
309
309
  def remove_containers
310
310
  modify(lock: true) do
311
- on_roles(KAMAL.roles, hosts: KAMAL.app_hosts) do |host, role|
312
- execute *KAMAL.auditor.record("Removed all app containers", role: role), verbosity: :debug
313
- execute *KAMAL.app(role: role, host: host).remove_containers
311
+ on_roles(DASH.roles, hosts: DASH.app_hosts) do |host, role|
312
+ execute *DASH.auditor.record("Removed all app containers", role: role), verbosity: :debug
313
+ execute *DASH.app(role: role, host: host).remove_containers
314
314
  end
315
315
  end
316
316
  end
@@ -319,8 +319,8 @@ class Kamal::Cli::App < Kamal::Cli::Base
319
319
  def remove_images
320
320
  modify(lock: true) do
321
321
  on(hosts_removing_all_roles) do
322
- execute *KAMAL.auditor.record("Removed all app images"), verbosity: :debug
323
- execute *KAMAL.app.remove_images
322
+ execute *DASH.auditor.record("Removed all app images"), verbosity: :debug
323
+ execute *DASH.app.remove_images
324
324
  end
325
325
  end
326
326
  end
@@ -329,9 +329,9 @@ class Kamal::Cli::App < Kamal::Cli::Base
329
329
  def remove_app_directories
330
330
  modify(lock: true) do
331
331
  on(hosts_removing_all_roles) do |host|
332
- execute *KAMAL.server.remove_app_directory, raise_on_non_zero_exit: false
333
- execute *KAMAL.auditor.record("Removed #{KAMAL.config.app_directory}"), verbosity: :debug
334
- execute *KAMAL.app.remove_proxy_app_directory, raise_on_non_zero_exit: false
332
+ execute *DASH.server.remove_app_directory, raise_on_non_zero_exit: false
333
+ execute *DASH.auditor.record("Removed #{DASH.config.app_directory}"), verbosity: :debug
334
+ execute *DASH.app.remove_proxy_app_directory, raise_on_non_zero_exit: false
335
335
  end
336
336
  end
337
337
  end
@@ -339,9 +339,9 @@ class Kamal::Cli::App < Kamal::Cli::Base
339
339
  desc "version", "Show app version currently running on servers"
340
340
  def version
341
341
  quiet = options[:quiet]
342
- on(KAMAL.app_hosts) do |host|
343
- role = KAMAL.roles_on(host).first
344
- puts_by_host host, capture_with_info(*KAMAL.app(role: role, host: host).current_running_version).strip, quiet: quiet
342
+ on(DASH.app_hosts) do |host|
343
+ role = DASH.roles_on(host).first
344
+ puts_by_host host, capture_with_info(*DASH.app(role: role, host: host).current_running_version).strip, quiet: quiet
345
345
  end
346
346
  end
347
347
 
@@ -352,14 +352,14 @@ class Kamal::Cli::App < Kamal::Cli::Base
352
352
  using_version(version_or_latest) do |version|
353
353
  say "Start rollout target with version #{version} alongside the live version...", :magenta
354
354
 
355
- on(KAMAL.proxy_hosts) do
356
- KAMAL.roles_on(host).each do |role|
357
- Kamal::Cli::App::Assets.new(host, role, self).run if role.running_proxy?
355
+ on(DASH.proxy_hosts) do
356
+ DASH.roles_on(host).each do |role|
357
+ Dash::Cli::App::Assets.new(host, role, self).run if role.running_proxy?
358
358
  end
359
359
  end
360
360
 
361
- on_roles(KAMAL.roles, hosts: KAMAL.proxy_hosts, parallel: KAMAL.config.parallel_roles?, rolling: true) do |host, role|
362
- Kamal::Cli::App::RolloutBoot.new(host, role, self, version).run if role.running_proxy?
361
+ on_roles(DASH.roles, hosts: DASH.proxy_hosts, parallel: DASH.config.parallel_roles?, rolling: true) do |host, role|
362
+ Dash::Cli::App::RolloutBoot.new(host, role, self, version).run if role.running_proxy?
363
363
  end
364
364
  end
365
365
  end
@@ -373,49 +373,49 @@ class Kamal::Cli::App < Kamal::Cli::Base
373
373
  end
374
374
 
375
375
  modify(lock: true) do
376
- on_roles(KAMAL.roles, hosts: KAMAL.proxy_hosts) do |host, role|
377
- execute *KAMAL.app(role: role, host: host).rollout_set(percent: percent, list: list) if role.running_proxy?
376
+ on_roles(DASH.roles, hosts: DASH.proxy_hosts) do |host, role|
377
+ execute *DASH.app(role: role, host: host).rollout_set(percent: percent, list: list) if role.running_proxy?
378
378
  end
379
379
  end
380
380
  end
381
381
 
382
382
  def stop_rollout
383
383
  modify(lock: true) do
384
- on_roles(KAMAL.roles, hosts: KAMAL.proxy_hosts) do |host, role|
385
- execute *KAMAL.app(role: role, host: host).rollout_stop if role.running_proxy?
384
+ on_roles(DASH.roles, hosts: DASH.proxy_hosts) do |host, role|
385
+ execute *DASH.app(role: role, host: host).rollout_stop if role.running_proxy?
386
386
  end
387
387
  end
388
388
  end
389
389
 
390
390
  def hosts_removing_all_roles
391
- KAMAL.app_hosts.select { |host| KAMAL.roles_on(host).map(&:name).sort == KAMAL.config.host_roles(host.to_s).map(&:name).sort }
391
+ DASH.app_hosts.select { |host| DASH.roles_on(host).map(&:name).sort == DASH.config.host_roles(host.to_s).map(&:name).sort }
392
392
  end
393
393
 
394
394
  def using_version(new_version)
395
395
  if new_version
396
396
  begin
397
- old_version = KAMAL.config.version
398
- KAMAL.config.version = new_version
397
+ old_version = DASH.config.version
398
+ DASH.config.version = new_version
399
399
  yield new_version
400
400
  ensure
401
- KAMAL.config.version = old_version
401
+ DASH.config.version = old_version
402
402
  end
403
403
  else
404
- yield KAMAL.config.version
404
+ yield DASH.config.version
405
405
  end
406
406
  end
407
407
 
408
- def current_running_version(host: KAMAL.primary_host)
408
+ def current_running_version(host: DASH.primary_host)
409
409
  version = nil
410
410
  on(host) do
411
- role = KAMAL.roles_on(host).first
412
- version = capture_with_info(*KAMAL.app(role: role, host: host).current_running_version).strip
411
+ role = DASH.roles_on(host).first
412
+ version = capture_with_info(*DASH.app(role: role, host: host).current_running_version).strip
413
413
  end
414
414
  version.presence
415
415
  end
416
416
 
417
417
  def version_or_latest
418
- options[:version] || KAMAL.config.latest_tag
418
+ options[:version] || DASH.config.latest_tag
419
419
  end
420
420
 
421
421
  def with_lock_if_stopping
@@ -427,8 +427,8 @@ class Kamal::Cli::App < Kamal::Cli::Base
427
427
  end
428
428
 
429
429
  def host_boot_groups
430
- hosts = KAMAL.app_hosts
431
- limit = KAMAL.config.boot.limit_for(hosts)
430
+ hosts = DASH.app_hosts
431
+ limit = DASH.config.boot.limit_for(hosts)
432
432
 
433
433
  limit ? hosts.each_slice(limit).to_a : [ hosts ]
434
434
  end