tomo 1.17.0 → 1.18.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6202b071b5584a5fc5b2db693130e5160585b784822b2b220ff3685c4272f53c
4
- data.tar.gz: 6c35312e003c7c00153a7ddf8d5c2761f19b9c16aa72d8f74b271f25b5f1d69c
3
+ metadata.gz: 1df37ae46768cbf38ec93e0a12a25344daf0214e4d51ec36e94b0910cc52fe09
4
+ data.tar.gz: 3005404f4cbb57a5bf7ef3df25cb6a84e55ab4a67752dae7022399bc2f8125a5
5
5
  SHA512:
6
- metadata.gz: 3c1a3a5edc2e67bd5d1aa77231534ca36d379214a9d4fade127d81ae810cfd75137d600f8018c44d171c41a6d0d6abacbc2986cef629de661747fd2199997f4d
7
- data.tar.gz: efd002dc923b18b4aa48f98d2fa79069c1713fbc604614a68f0fe1b9bc0477de591b83a280edfe1ea2c8fcf398408394a095bd56d8fab27f58ddba7c5748d2d9
6
+ metadata.gz: 5e06977997842a6ee0594857e1ae70d6c4d1bd9f5780d62d47b33b5e6b3aca7bf68d2ab5238b0074113f21a6ecea941afa3e721ad8a68b7f0ce2b6ad5a40663f
7
+ data.tar.gz: 0e1194fcdf339e9f52744fe1de2152d86350c812c5b4ad3035a5b25b4f84eb0a87e73e5c4802813acad916af41da78819b795ad27b93a73f9289b93925283914
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Tomo
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/tomo.svg)](https://rubygems.org/gems/tomo)
4
- [![Build Status](https://mattbrictson.semaphoreci.com/badges/tomo/branches/main.svg?style=shields)](https://mattbrictson.semaphoreci.com/projects/tomo)
5
- [![Code Climate](https://codeclimate.com/github/mattbrictson/tomo/badges/gpa.svg)](https://codeclimate.com/github/mattbrictson/tomo)
3
+ [![Gem Version](https://img.shields.io/gem/v/tomo)](https://rubygems.org/gems/tomo)
4
+ [![Gem Downloads](https://img.shields.io/gem/dt/tomo)](https://www.ruby-toolbox.com/projects/tomo)
5
+ [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mattbrictson/tomo/ci.yml)](https://github.com/mattbrictson/tomo/actions/workflows/ci.yml)
6
+ [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/mattbrictson/tomo)](https://codeclimate.com/github/mattbrictson/tomo)
6
7
 
7
8
  Tomo is a friendly command-line tool for deploying Rails apps.
8
9
 
@@ -13,7 +14,7 @@ Tomo is a friendly command-line tool for deploying Rails apps.
13
14
  📚 Quality documentation<br/>
14
15
  🔬 Minimal dependencies<br/>
15
16
 
16
- [→ See how tomo compares to other Ruby deployment tools like Capistrano and Mina.](https://tomo-deploy.com/comparisons/)
17
+ [→ See how tomo compares to other Ruby deployment tools like Capistrano and Mina.](https://tomo.mattbrictson.com/comparisons/)
17
18
 
18
19
  ---
19
20
 
@@ -21,6 +22,7 @@ Tomo is a friendly command-line tool for deploying Rails apps.
21
22
  - [Usage](#usage)
22
23
  - [Extending tomo](#extending-tomo)
23
24
  - [Tutorials](#tutorials)
25
+ - [Blog posts](#blog-posts)
24
26
  - [Reference documentation](#reference-documentation)
25
27
  - [FAQ](#faq)
26
28
  - [Support](#support)
@@ -86,8 +88,8 @@ end
86
88
 
87
89
  #### Next steps
88
90
 
89
- [→ The reference docs have a complete guide to tomo configuration.](https://tomo-deploy.com/configuration/)<br>
90
- [→ Check out the **Deploying Rails From Scratch** tutorial for a step-by-step guide to using tomo with a real app.](https://tomo-deploy.com/tutorials/deploying-rails-from-scratch/)
91
+ [→ The reference docs have a complete guide to tomo configuration.](https://tomo.mattbrictson.com/configuration/)<br>
92
+ [→ Check out the **Deploying Rails From Scratch** tutorial for a step-by-step guide to using tomo with a real app.](https://tomo.mattbrictson.com/tutorials/deploying-rails-from-scratch/)
91
93
 
92
94
  ## Usage
93
95
 
@@ -111,25 +113,24 @@ Out of the box, tomo will:
111
113
  - Create all necessary deployment directories
112
114
  - Create the Rails database, load the schema, and insert seed data
113
115
 
114
- [→ Here is the default list of tasks invoked by the setup command.](https://tomo-deploy.com/configuration#setupblock)<br>
115
- [→ The `tomo setup` section of the reference docs explains supported command-line options.](https://tomo-deploy.com/commands/setup/)
116
+ [→ Here is the default list of tasks invoked by the setup command.](https://tomo.mattbrictson.com/configuration#setupblock)<br>
117
+ [→ The `tomo setup` section of the reference docs explains supported command-line options.](https://tomo.mattbrictson.com/commands/setup/)
116
118
 
117
119
  ### `tomo deploy`
118
120
 
119
121
  Whereas `tomo setup` is typically run once, you can use `tomo deploy` every time you want to deploy a new version of your app. The deploy command will sequentially run the `deploy` list of tasks specified in `.tomo/config.rb`. You can customize this list to meet the needs of your app. By default, tomo runs these tasks:
120
122
 
121
- 1. Create a release (using the [git:create_release](https://tomo-deploy.com/plugins/git#gitcreate_release) task)
122
- 2. Build the project (e.g. [bundler:install](https://tomo-deploy.com/plugins/bundler#bundlerinstall), [rails:assets_precompile](https://tomo-deploy.com/plugins/rails#railsassets_precompile))
123
- 3. Migrate data to the meet the requirements of the new release (e.g. [rails:db_migrate](https://tomo-deploy.com/plugins/rails#railsdb_migrate))
124
- 4. Make the new release the "current" one ([core:symlink_current](https://tomo-deploy.com/plugins/core#coresymlink_current))
125
- 5. Restart the app to use the new current release (e.g. [puma:restart](https://tomo-deploy.com/plugins/puma#pumarestart))
126
- 6. Perform any cleanup (e.g. [bundler:clean](https://tomo-deploy.com/plugins/bundler#bundlerclean))
123
+ 1. Create a release (using the [git:create_release](https://tomo.mattbrictson.com/plugins/git#gitcreate_release) task)
124
+ 2. Build the project (e.g. [bundler:install](https://tomo.mattbrictson.com/plugins/bundler#bundlerinstall), [rails:assets_precompile](https://tomo.mattbrictson.com/plugins/rails#railsassets_precompile))
125
+ 3. Migrate data to the meet the requirements of the new release (e.g. [rails:db_migrate](https://tomo.mattbrictson.com/plugins/rails#railsdb_migrate))
126
+ 4. Make the new release the "current" one ([core:symlink_current](https://tomo.mattbrictson.com/plugins/core#coresymlink_current))
127
+ 5. Restart the app to use the new current release (e.g. [puma:restart](https://tomo.mattbrictson.com/plugins/puma#pumarestart))
128
+ 6. Perform any cleanup (e.g. [bundler:clean](https://tomo.mattbrictson.com/plugins/bundler#bundlerclean))
127
129
 
128
130
  > 💡 **Protip:** you can abbreviate tomo commands, like `tomo d` for `tomo deploy` or `tomo s` for `tomo setup`.
129
131
 
130
- [→ Here is the default list of tasks invoked by the deploy command.](https://tomo-deploy.com/configuration#deployblock)<br>
131
- [→ The `tomo deploy` section of the reference docs explains supported command-line options, like `--dry-run`.](https://tomo-deploy.com/commands/deploy/)
132
-
132
+ [→ Here is the default list of tasks invoked by the deploy command.](https://tomo.mattbrictson.com/configuration#deployblock)<br>
133
+ [→ The `tomo deploy` section of the reference docs explains supported command-line options, like `--dry-run`.](https://tomo.mattbrictson.com/commands/deploy/)
133
134
 
134
135
  ### `tomo run [TASK]`
135
136
 
@@ -143,9 +144,7 @@ One of the built-in Rails tasks is `rails:console`, which brings up a fully-inte
143
144
 
144
145
  > 💡 **Protip:** you can shorten this as `tomo rails:console` (the `run` command is implied).
145
146
 
146
- [→ The `tomo run` section of the reference docs explains supported command-line options and has more examples.](https://tomo-deploy.com/commands/run/)
147
-
148
-
147
+ [→ The `tomo run` section of the reference docs explains supported command-line options and has more examples.](https://tomo.mattbrictson.com/commands/run/)
149
148
 
150
149
  ## Extending tomo
151
150
 
@@ -171,43 +170,47 @@ And run it!
171
170
 
172
171
  ![$ tomo run my-plugin:hello](./readme_images/tomo-run-hello.png)
173
172
 
174
- [→ The **Writing Custom Tasks** tutorial has an in-depth explanation of how plugins work.](https://tomo-deploy.com/tutorials/writing-custom-tasks/)<br>
175
- [→ The **TaskLibrary** API is tomo's DSL for building tasks.](https://tomo-deploy.com/api/TaskLibrary/)<br>
176
- [→ The **Publishing a Plugin** tutorial explains how to package your plugin as a Ruby gem to share it with the community.](https://tomo-deploy.com/tutorials/publishing-a-plugin/)
173
+ [→ The **Writing Custom Tasks** tutorial has an in-depth explanation of how plugins work.](https://tomo.mattbrictson.com/tutorials/writing-custom-tasks/)<br>
174
+ [→ The **TaskLibrary** API is tomo's DSL for building tasks.](https://tomo.mattbrictson.com/api/TaskLibrary/)<br>
175
+ [→ The **Publishing a Plugin** tutorial explains how to package your plugin as a Ruby gem to share it with the community.](https://tomo.mattbrictson.com/tutorials/publishing-a-plugin/)
177
176
 
178
177
  ## Tutorials
179
178
 
180
- - [Deploying Rails From Scratch](https://tomo-deploy.com/tutorials/deploying-rails-from-scratch/)
181
- - [Writing Custom Tasks](https://tomo-deploy.com/tutorials/writing-custom-tasks/)
182
- - [Publishing a Plugin](https://tomo-deploy.com/tutorials/publishing-a-plugin/)
179
+ - [Deploying Rails From Scratch](https://tomo.mattbrictson.com/tutorials/deploying-rails-from-scratch/)
180
+ - [Writing Custom Tasks](https://tomo.mattbrictson.com/tutorials/writing-custom-tasks/)
181
+ - [Publishing a Plugin](https://tomo.mattbrictson.com/tutorials/publishing-a-plugin/)
182
+
183
+ ## Blog posts
184
+
185
+ - [Automate Rails deployments with GitHub Actions](https://mattbrictson.com/blog/deploy-rails-with-github-actions)
183
186
 
184
187
  ## Reference documentation
185
188
 
186
- - [Configuration](https://tomo-deploy.com/configuration/)
189
+ - [Configuration](https://tomo.mattbrictson.com/configuration/)
187
190
  - Commands
188
- - [init](https://tomo-deploy.com/commands/init/)
189
- - [setup](https://tomo-deploy.com/commands/setup/)
190
- - [deploy](https://tomo-deploy.com/commands/deploy/)
191
- - [run](https://tomo-deploy.com/commands/run/)
192
- - [tasks](https://tomo-deploy.com/commands/tasks/)
191
+ - [init](https://tomo.mattbrictson.com/commands/init/)
192
+ - [setup](https://tomo.mattbrictson.com/commands/setup/)
193
+ - [deploy](https://tomo.mattbrictson.com/commands/deploy/)
194
+ - [run](https://tomo.mattbrictson.com/commands/run/)
195
+ - [tasks](https://tomo.mattbrictson.com/commands/tasks/)
193
196
  - Plugins
194
- - [core](https://tomo-deploy.com/plugins/core/)
195
- - [bundler](https://tomo-deploy.com/plugins/bundler/)
196
- - [env](https://tomo-deploy.com/plugins/env/)
197
- - [git](https://tomo-deploy.com/plugins/git/)
198
- - [nodenv](https://tomo-deploy.com/plugins/nodenv/)
199
- - [puma](https://tomo-deploy.com/plugins/puma/)
200
- - [rails](https://tomo-deploy.com/plugins/rails/)
201
- - [rbenv](https://tomo-deploy.com/plugins/rbenv/)
197
+ - [core](https://tomo.mattbrictson.com/plugins/core/)
198
+ - [bundler](https://tomo.mattbrictson.com/plugins/bundler/)
199
+ - [env](https://tomo.mattbrictson.com/plugins/env/)
200
+ - [git](https://tomo.mattbrictson.com/plugins/git/)
201
+ - [nodenv](https://tomo.mattbrictson.com/plugins/nodenv/)
202
+ - [puma](https://tomo.mattbrictson.com/plugins/puma/)
203
+ - [rails](https://tomo.mattbrictson.com/plugins/rails/)
204
+ - [rbenv](https://tomo.mattbrictson.com/plugins/rbenv/)
202
205
  - API
203
- - [Host](https://tomo-deploy.com/api/Host/)
204
- - [Logger](https://tomo-deploy.com/api/Logger/)
205
- - [Paths](https://tomo-deploy.com/api/Paths/)
206
- - [PluginDSL](https://tomo-deploy.com/api/PluginDSL/)
207
- - [Remote](https://tomo-deploy.com/api/Remote/)
208
- - [Result](https://tomo-deploy.com/api/Result/)
209
- - [TaskLibrary](https://tomo-deploy.com/api/TaskLibrary/)
210
- - [Testing::MockPluginTester](https://tomo-deploy.com/api/testing/MockPluginTester/)
206
+ - [Host](https://tomo.mattbrictson.com/api/Host/)
207
+ - [Logger](https://tomo.mattbrictson.com/api/Logger/)
208
+ - [Paths](https://tomo.mattbrictson.com/api/Paths/)
209
+ - [PluginDSL](https://tomo.mattbrictson.com/api/PluginDSL/)
210
+ - [Remote](https://tomo.mattbrictson.com/api/Remote/)
211
+ - [Result](https://tomo.mattbrictson.com/api/Result/)
212
+ - [TaskLibrary](https://tomo.mattbrictson.com/api/TaskLibrary/)
213
+ - [Testing::MockPluginTester](https://tomo.mattbrictson.com/api/testing/MockPluginTester/)
211
214
 
212
215
  ## FAQ
213
216
 
@@ -224,7 +227,7 @@ set ssh_strict_host_key_checking: true # or false
224
227
 
225
228
  Tomo relies on the host user's bash profile for various things, like setting environment variables and initializing rbenv and nodenv. This makes it impractical to deploy multiple apps to a single host using the same deploy user.
226
229
 
227
- The solution is to create multiple users on the remote host, and then configure a different user for deploying each app. That way each user can have its own distinct environment variables and you can easily configure each app differently without risking conflicts. Refer to the [tomo Rails tutorial](https://tomo-deploy.com/tutorials/deploying-rails-from-scratch/#set-up-a-deployer-user) for instructions on creating a deploy user.
230
+ The solution is to create multiple users on the remote host, and then configure a different user for deploying each app. That way each user can have its own distinct environment variables and you can easily configure each app differently without risking conflicts. Refer to the [tomo Rails tutorial](https://tomo.mattbrictson.com/tutorials/deploying-rails-from-scratch/#set-up-a-deployer-user) for instructions on creating a deploy user.
228
231
 
229
232
  E.g. app1 would be configured to deploy as:
230
233
 
@@ -45,7 +45,7 @@ module Tomo
45
45
 
46
46
  # Don't complete the =value part of long switch unless the user has
47
47
  # already typed at least up to the = sign.
48
- return true if cand.match?(/\A--.*=/) && !word.match?(/\A--.*=/)
48
+ true if cand.match?(/\A--.*=/) && !word.match?(/\A--.*=/)
49
49
  end
50
50
 
51
51
  # bash tokenizes the user's input prior to completion, and expects the
@@ -26,7 +26,7 @@ module Tomo
26
26
  attr_reader :banner_proc, :options
27
27
 
28
28
  def options_help
29
- width = options.map(&:first).map(&:length).max
29
+ width = options.map { |opt| opt.first.length }.max
30
30
  options.each_with_object([]) do |(spec, desc), help|
31
31
  help << "#{Colors.yellow(spec.ljust(width))} #{desc}"
32
32
  end.join("\n")
@@ -33,7 +33,7 @@ module Tomo
33
33
 
34
34
  Or read the full documentation for all commands at:
35
35
 
36
- #{blue('https://tomo-deploy.com/')}
36
+ #{blue('https://tomo.mattbrictson.com/')}
37
37
  BANNER
38
38
  end
39
39
 
@@ -39,7 +39,7 @@ module Tomo
39
39
 
40
40
  More documentation and examples can be found here:
41
41
 
42
- #{blue('https://tomo-deploy.com/commands/deploy')}
42
+ #{blue('https://tomo.mattbrictson.com/commands/deploy')}
43
43
  BANNER
44
44
  end
45
45
 
@@ -30,11 +30,9 @@ module Tomo
30
30
 
31
31
  app = args.first || current_dir_name || "default"
32
32
  app = app.gsub(/([^\w-]|_)+/, "_").downcase
33
- FileUtils.mkdir_p(".tomo/plugins")
34
-
35
- # TODO: use a template for this file
36
- FileUtils.touch(".tomo/plugins/#{app}.rb")
37
33
 
34
+ FileUtils.mkdir_p(".tomo/plugins")
35
+ File.write(".tomo/plugins/#{app}.rb", plugin_rb_template)
38
36
  File.write(DEFAULT_CONFIG_PATH, config_rb_template(app))
39
37
 
40
38
  logger.info(green("✔ Created #{DEFAULT_CONFIG_PATH}"))
@@ -71,10 +69,22 @@ module Tomo
71
69
  nil
72
70
  end
73
71
 
74
- def git_branch
72
+ def git_main_branch
75
73
  return unless File.file?(".git/config")
76
74
 
77
- `git rev-parse --abbrev-ref HEAD`.chomp
75
+ # If "main" or "master" is in the list of branch names, use that
76
+ branch = (%w[main master] & `git branch`.scan(/^\W*(.+)$/).flatten).first
77
+
78
+ # If not, use the current branch
79
+ if branch.nil?
80
+ branch = if `git --version`[/\d+\.\d+/].to_f >= 2.22
81
+ `git branch --show-current`.chomp
82
+ else
83
+ `git rev-parse --abbrev-ref HEAD`.chomp
84
+ end
85
+ end
86
+
87
+ branch.empty? ? nil : branch
78
88
  rescue SystemCallError
79
89
  nil
80
90
  end
@@ -119,6 +129,12 @@ module Tomo
119
129
  template = File.read(path)
120
130
  ERB.new(template, trim_mode: "-").result(binding)
121
131
  end
132
+
133
+ def plugin_rb_template
134
+ path = File.expand_path("../templates/plugin.rb.erb", __dir__)
135
+ template = File.read(path)
136
+ ERB.new(template, trim_mode: "-").result(binding)
137
+ end
122
138
  end
123
139
  end
124
140
  end
@@ -46,7 +46,7 @@ module Tomo
46
46
 
47
47
  For more documentation and examples, visit:
48
48
 
49
- #{blue('https://tomo-deploy.com/commands/run')}
49
+ #{blue('https://tomo.mattbrictson.com/commands/run')}
50
50
  BANNER
51
51
  end
52
52
 
@@ -24,7 +24,7 @@ module Tomo
24
24
 
25
25
  More documentation and examples can be found here:
26
26
 
27
- #{blue('https://tomo-deploy.com/commands/setup')}
27
+ #{blue('https://tomo.mattbrictson.com/commands/setup')}
28
28
  BANNER
29
29
  end
30
30
 
@@ -35,7 +35,7 @@ module Tomo
35
35
  #{highlighted_lines}
36
36
  #{Colors.red([self.class, message].join(': '))}
37
37
 
38
- Visit #{Colors.blue('https://tomo-deploy.com/configuration')} for syntax reference.
38
+ Visit #{Colors.blue('https://tomo.mattbrictson.com/configuration')} for syntax reference.
39
39
  #{trace_hint}
40
40
  ERROR
41
41
  end
data/lib/tomo/host.rb CHANGED
@@ -10,7 +10,7 @@ module Tomo
10
10
  user, address = host.match(PATTERN).captures
11
11
  raise ArgumentError, "host cannot be blank" if address.empty?
12
12
 
13
- new(**{ user: user, address: address }.merge(kwargs))
13
+ new(user: user, address: address, **kwargs)
14
14
  end
15
15
 
16
16
  def initialize(address:, port: nil, log_prefix: nil, roles: nil, user: nil, privileged_user: "root")
@@ -5,6 +5,7 @@ module Tomo::Plugin::Bundler
5
5
  CONFIG_SETTINGS = %i[
6
6
  bundler_deployment
7
7
  bundler_gemfile
8
+ bundler_ignore_messages
8
9
  bundler_jobs
9
10
  bundler_path
10
11
  bundler_retry
@@ -8,13 +8,14 @@ module Tomo::Plugin
8
8
  tasks Tomo::Plugin::Bundler::Tasks
9
9
  helpers Tomo::Plugin::Bundler::Helpers
10
10
 
11
- defaults bundler_config_path: ".bundle/config",
12
- bundler_deployment: true,
13
- bundler_gemfile: nil,
14
- bundler_jobs: nil,
15
- bundler_path: "%{shared_path}/bundle",
16
- bundler_retry: "3",
17
- bundler_version: nil,
18
- bundler_without: %w[development test]
11
+ defaults bundler_config_path: ".bundle/config",
12
+ bundler_deployment: true,
13
+ bundler_gemfile: nil,
14
+ bundler_ignore_messages: true,
15
+ bundler_jobs: nil,
16
+ bundler_path: "%{shared_path}/bundle",
17
+ bundler_retry: "3",
18
+ bundler_version: nil,
19
+ bundler_without: %w[development test]
19
20
  end
20
21
  end
@@ -3,7 +3,7 @@ require "shellwords"
3
3
  module Tomo::Plugin::Core
4
4
  module Helpers
5
5
  def capture(*command, **run_opts)
6
- result = run(*command, **{ silent: true }.merge(run_opts))
6
+ result = run(*command, silent: true, **run_opts)
7
7
  result.stdout
8
8
  end
9
9
 
@@ -18,7 +18,8 @@ module Tomo::Plugin::Core
18
18
  message = "Writing #{text.bytesize} bytes to #{to}"
19
19
  run(
20
20
  "echo -n #{text.shellescape} #{append ? '>>' : '>'} #{to.shellescape}",
21
- **{ echo: message }.merge(run_opts)
21
+ echo: message,
22
+ **run_opts
22
23
  )
23
24
  end
24
25
 
@@ -43,7 +44,7 @@ module Tomo::Plugin::Core
43
44
  end
44
45
 
45
46
  def command_available?(command_name, **run_opts)
46
- run?("which", command_name, **{ silent: true }.merge(run_opts))
47
+ run?("which", command_name, silent: true, **run_opts)
47
48
  end
48
49
 
49
50
  def file?(file, **run_opts)
@@ -129,7 +129,7 @@ module Tomo::Plugin::Env
129
129
  user@host. To deploy multiple applications to the same host, use a separate
130
130
  deployer user per app. Refer to the tomo FAQ for details:
131
131
 
132
- https://tomo-deploy.com/#faq
132
+ https://tomo.mattbrictson.com/#faq
133
133
 
134
134
  You may be receiving this message in error if you recently renamed or
135
135
  reconfigured your application. In this case, remove the references to the
@@ -81,7 +81,7 @@ module Tomo::Plugin::Puma
81
81
 
82
82
  def setup_directories
83
83
  files = [service.path, socket.path].compact
84
- dirs = files.map(&:dirname).map(&:to_s)
84
+ dirs = files.map { |f| f.dirname.to_s }
85
85
  remote.mkdir_p dirs.uniq
86
86
  end
87
87
 
data/lib/tomo/remote.rb CHANGED
@@ -21,7 +21,7 @@ module Tomo
21
21
 
22
22
  def attach(*command, default_chdir: nil, **command_opts)
23
23
  full_command = shell_builder.build(*command, default_chdir: default_chdir)
24
- ssh.ssh_exec(Script.new(full_command, **{ pty: true }.merge(command_opts)))
24
+ ssh.ssh_exec(Script.new(full_command, pty: true, **command_opts))
25
25
  end
26
26
 
27
27
  def run(*command, attach: false, default_chdir: nil, **command_opts)
@@ -17,10 +17,10 @@ module Tomo
17
17
  @promises = []
18
18
  end
19
19
 
20
- def post(*args, &block)
20
+ def post(...)
21
21
  return if failure?
22
22
 
23
- promises << future_on(executor, *args, &block)
23
+ promises << future_on(executor, ...)
24
24
  .on_rejection_using(executor) do |reason|
25
25
  self.failure = reason
26
26
  end
@@ -22,7 +22,7 @@ module Tomo
22
22
  indent = threads > 1 ? " = " : ""
23
23
  if threads > 1 && step.applicable_tasks.length > 1
24
24
  desc << "#{indent}IN SEQUENCE:"
25
- indent.sub!(/=/, " ")
25
+ indent.sub!("=", " ")
26
26
  end
27
27
  desc << step.explain.gsub(/^/, indent)
28
28
  end
@@ -10,7 +10,7 @@ module Tomo
10
10
 
11
11
  More configuration documentation and examples can be found here:
12
12
 
13
- #{blue('https://tomo-deploy.com/configuration')}
13
+ #{blue('https://tomo.mattbrictson.com/configuration')}
14
14
  ERROR
15
15
  end
16
16
  end
@@ -39,7 +39,7 @@ module Tomo
39
39
  end
40
40
 
41
41
  def dump_settings(hash)
42
- key_len = hash.keys.map(&:to_s).map(&:length).max
42
+ key_len = hash.keys.map { |k| k.to_s.length }.max
43
43
  dump = "Settings: {\n"
44
44
  hash.to_a.sort_by(&:first).each do |key, value|
45
45
  justified_key = "#{key}:".ljust(key_len + 1)
@@ -67,7 +67,7 @@ module Tomo
67
67
  def shell_join(*command)
68
68
  return command.first.to_s if command.length == 1
69
69
 
70
- command.flatten.compact.map(&:to_s).map(&:shellescape).join(" ")
70
+ command.flatten.compact.map { |arg| arg.to_s.shellescape }.join(" ")
71
71
  end
72
72
 
73
73
  def cd_chdir
@@ -22,7 +22,7 @@ set nodenv_node_version: <%= node_version&.inspect || "nil # FIXME" %>
22
22
  <% end -%>
23
23
  set nodenv_install_yarn: <%= yarn_version ? "true" : "false" %>
24
24
  set git_url: <%= git_origin_url&.inspect || "nil # FIXME" %>
25
- set git_branch: <%= git_branch&.inspect || "nil # FIXME" %>
25
+ set git_branch: <%= git_main_branch&.inspect || "nil # FIXME" %>
26
26
  set git_exclusions: %w[
27
27
  .tomo/
28
28
  spec/
@@ -0,0 +1 @@
1
+ # https://tomo.mattbrictson.com/tutorials/writing-custom-tasks/
data/lib/tomo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tomo
2
- VERSION = "1.17.0".freeze
2
+ VERSION = "1.18.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0
4
+ version: 1.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-13 00:00:00.000000000 Z
11
+ date: 2023-11-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Tomo is a feature-rich deployment tool that contains everything you need
14
14
  to deploy a basic Rails app out of the box. It has an opinionated, production-tested
@@ -145,6 +145,7 @@ files:
145
145
  - lib/tomo/task_api.rb
146
146
  - lib/tomo/task_library.rb
147
147
  - lib/tomo/templates/config.rb.erb
148
+ - lib/tomo/templates/plugin.rb.erb
148
149
  - lib/tomo/testing.rb
149
150
  - lib/tomo/testing/Dockerfile
150
151
  - lib/tomo/testing/cli_extensions.rb
@@ -172,7 +173,7 @@ metadata:
172
173
  changelog_uri: https://github.com/mattbrictson/tomo/releases
173
174
  source_code_uri: https://github.com/mattbrictson/tomo
174
175
  homepage_uri: https://github.com/mattbrictson/tomo
175
- documentation_uri: https://tomo-deploy.com/
176
+ documentation_uri: https://tomo.mattbrictson.com/
176
177
  rubygems_mfa_required: 'true'
177
178
  post_install_message:
178
179
  rdoc_options: []
@@ -189,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
190
  - !ruby/object:Gem::Version
190
191
  version: '0'
191
192
  requirements: []
192
- rubygems_version: 3.4.13
193
+ rubygems_version: 3.4.21
193
194
  signing_key:
194
195
  specification_version: 4
195
196
  summary: A friendly CLI for deploying Rails apps ✨