tomo 1.18.0 → 1.18.2

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: c340ddcd3ab2385834e3611bd577a7858cbd3f61136c19d8797d552eb15f6a4b
4
- data.tar.gz: ab367d0bb86bd69f92255a4550f839f0bba0efbee83d67b9fd18e7117ca83973
3
+ metadata.gz: 5e009fc663164b91e6dd0ad03333d704014775100f9b0aa222f691f6048f2b72
4
+ data.tar.gz: bb0943cdba7ef40ab5e2ab826826cf189e1ceec7f3ecaf6f55307117bb95d85d
5
5
  SHA512:
6
- metadata.gz: 7659312aa674e8c3bdb26c18fc9dbbf5369a0530873eb07db16584b68dd2dd995af71bb0fe742532a4b16310554d77ff9c3a4a2c986e254c408f22834c6a6eeb
7
- data.tar.gz: a4052c634e67510b0467b10d4f053e7993d593eb8a449abb8e660fdb8a39b794c473726f05d221515d24ba76b1d7fdf9b8baeb99dde7d8a00c6cecd0fff85f29
6
+ metadata.gz: 636abb08a843308c021677869941769fb4cf0f52143a54b7d8cb9132ae99c5b46a26731b9af196715f36f8b1b7cc513278feb1edfdc8f3d686a71b06b1abf547
7
+ data.tar.gz: 4f63cb3204cc73a707194daaffc9365e52e33bc5abb3131546177f86563783c3b4f08e24c9f1f65a8da4e686ba6fc92387560708b21ff18076f0228e814948f6
data/README.md CHANGED
@@ -14,7 +14,7 @@ Tomo is a friendly command-line tool for deploying Rails apps.
14
14
  📚 Quality documentation<br/>
15
15
  🔬 Minimal dependencies<br/>
16
16
 
17
- [→ 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/)
18
18
 
19
19
  ---
20
20
 
@@ -22,6 +22,7 @@ Tomo is a friendly command-line tool for deploying Rails apps.
22
22
  - [Usage](#usage)
23
23
  - [Extending tomo](#extending-tomo)
24
24
  - [Tutorials](#tutorials)
25
+ - [Blog posts](#blog-posts)
25
26
  - [Reference documentation](#reference-documentation)
26
27
  - [FAQ](#faq)
27
28
  - [Support](#support)
@@ -87,8 +88,8 @@ end
87
88
 
88
89
  #### Next steps
89
90
 
90
- [→ The reference docs have a complete guide to tomo configuration.](https://tomo-deploy.com/configuration/)<br>
91
- [→ 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/)
92
93
 
93
94
  ## Usage
94
95
 
@@ -112,25 +113,24 @@ Out of the box, tomo will:
112
113
  - Create all necessary deployment directories
113
114
  - Create the Rails database, load the schema, and insert seed data
114
115
 
115
- [→ Here is the default list of tasks invoked by the setup command.](https://tomo-deploy.com/configuration#setupblock)<br>
116
- [→ 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/)
117
118
 
118
119
  ### `tomo deploy`
119
120
 
120
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:
121
122
 
122
- 1. Create a release (using the [git:create_release](https://tomo-deploy.com/plugins/git#gitcreate_release) task)
123
- 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))
124
- 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))
125
- 4. Make the new release the "current" one ([core:symlink_current](https://tomo-deploy.com/plugins/core#coresymlink_current))
126
- 5. Restart the app to use the new current release (e.g. [puma:restart](https://tomo-deploy.com/plugins/puma#pumarestart))
127
- 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))
128
129
 
129
130
  > 💡 **Protip:** you can abbreviate tomo commands, like `tomo d` for `tomo deploy` or `tomo s` for `tomo setup`.
130
131
 
131
- [→ Here is the default list of tasks invoked by the deploy command.](https://tomo-deploy.com/configuration#deployblock)<br>
132
- [→ The `tomo deploy` section of the reference docs explains supported command-line options, like `--dry-run`.](https://tomo-deploy.com/commands/deploy/)
133
-
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/)
134
134
 
135
135
  ### `tomo run [TASK]`
136
136
 
@@ -144,9 +144,7 @@ One of the built-in Rails tasks is `rails:console`, which brings up a fully-inte
144
144
 
145
145
  > 💡 **Protip:** you can shorten this as `tomo rails:console` (the `run` command is implied).
146
146
 
147
- [→ The `tomo run` section of the reference docs explains supported command-line options and has more examples.](https://tomo-deploy.com/commands/run/)
148
-
149
-
147
+ [→ The `tomo run` section of the reference docs explains supported command-line options and has more examples.](https://tomo.mattbrictson.com/commands/run/)
150
148
 
151
149
  ## Extending tomo
152
150
 
@@ -172,43 +170,47 @@ And run it!
172
170
 
173
171
  ![$ tomo run my-plugin:hello](./readme_images/tomo-run-hello.png)
174
172
 
175
- [→ The **Writing Custom Tasks** tutorial has an in-depth explanation of how plugins work.](https://tomo-deploy.com/tutorials/writing-custom-tasks/)<br>
176
- [→ The **TaskLibrary** API is tomo's DSL for building tasks.](https://tomo-deploy.com/api/TaskLibrary/)<br>
177
- [→ 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/)
178
176
 
179
177
  ## Tutorials
180
178
 
181
- - [Deploying Rails From Scratch](https://tomo-deploy.com/tutorials/deploying-rails-from-scratch/)
182
- - [Writing Custom Tasks](https://tomo-deploy.com/tutorials/writing-custom-tasks/)
183
- - [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)
184
186
 
185
187
  ## Reference documentation
186
188
 
187
- - [Configuration](https://tomo-deploy.com/configuration/)
189
+ - [Configuration](https://tomo.mattbrictson.com/configuration/)
188
190
  - Commands
189
- - [init](https://tomo-deploy.com/commands/init/)
190
- - [setup](https://tomo-deploy.com/commands/setup/)
191
- - [deploy](https://tomo-deploy.com/commands/deploy/)
192
- - [run](https://tomo-deploy.com/commands/run/)
193
- - [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/)
194
196
  - Plugins
195
- - [core](https://tomo-deploy.com/plugins/core/)
196
- - [bundler](https://tomo-deploy.com/plugins/bundler/)
197
- - [env](https://tomo-deploy.com/plugins/env/)
198
- - [git](https://tomo-deploy.com/plugins/git/)
199
- - [nodenv](https://tomo-deploy.com/plugins/nodenv/)
200
- - [puma](https://tomo-deploy.com/plugins/puma/)
201
- - [rails](https://tomo-deploy.com/plugins/rails/)
202
- - [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/)
203
205
  - API
204
- - [Host](https://tomo-deploy.com/api/Host/)
205
- - [Logger](https://tomo-deploy.com/api/Logger/)
206
- - [Paths](https://tomo-deploy.com/api/Paths/)
207
- - [PluginDSL](https://tomo-deploy.com/api/PluginDSL/)
208
- - [Remote](https://tomo-deploy.com/api/Remote/)
209
- - [Result](https://tomo-deploy.com/api/Result/)
210
- - [TaskLibrary](https://tomo-deploy.com/api/TaskLibrary/)
211
- - [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/)
212
214
 
213
215
  ## FAQ
214
216
 
@@ -225,7 +227,7 @@ set ssh_strict_host_key_checking: true # or false
225
227
 
226
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.
227
229
 
228
- 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.
229
231
 
230
232
  E.g. app1 would be configured to deploy as:
231
233
 
data/lib/tomo/cli.rb CHANGED
@@ -1,5 +1,3 @@
1
- require "abbrev"
2
-
3
1
  module Tomo
4
2
  class CLI
5
3
  autoload :Command, "tomo/cli/command"
@@ -63,7 +61,7 @@ module Tomo
63
61
  commands = COMMANDS.merge(COMMAND_ALIASES)
64
62
 
65
63
  command_name = argv.first unless Completions.active? && argv.length == 1
66
- command_name = Abbrev.abbrev(commands.keys)[command_name]
64
+ command_name = expand_abbrev(commands.keys, command_name)
67
65
  argv.shift if command_name
68
66
 
69
67
  command_name = "run" if command_name.nil? && task_format?(argv.first)
@@ -71,6 +69,13 @@ module Tomo
71
69
  [command, command_name]
72
70
  end
73
71
 
72
+ def expand_abbrev(names, abbrev)
73
+ return nil if abbrev.to_s.empty?
74
+
75
+ matches = names.select { |name| name.start_with?(abbrev) }
76
+ matches.first if matches.one?
77
+ end
78
+
74
79
  def task_format?(arg)
75
80
  arg.to_s.match?(/\A\S+:\S*\z/)
76
81
  end
@@ -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
 
@@ -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/error.rb CHANGED
@@ -6,7 +6,7 @@ module Tomo
6
6
 
7
7
  def self.raise_with(message=nil, attributes)
8
8
  err = new(message)
9
- attributes.each { |attr, value| err.public_send("#{attr}=", value) }
9
+ attributes.each { |attr, value| err.public_send(:"#{attr}=", value) }
10
10
  raise err
11
11
  end
12
12
 
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")
@@ -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
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)
@@ -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
@@ -1 +1 @@
1
- # https://tomo-deploy.com/tutorials/writing-custom-tasks/
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.18.0".freeze
2
+ VERSION = "1.18.2".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.18.0
4
+ version: 1.18.2
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-08-15 00:00:00.000000000 Z
11
+ date: 2023-12-26 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
@@ -173,7 +173,7 @@ metadata:
173
173
  changelog_uri: https://github.com/mattbrictson/tomo/releases
174
174
  source_code_uri: https://github.com/mattbrictson/tomo
175
175
  homepage_uri: https://github.com/mattbrictson/tomo
176
- documentation_uri: https://tomo-deploy.com/
176
+ documentation_uri: https://tomo.mattbrictson.com/
177
177
  rubygems_mfa_required: 'true'
178
178
  post_install_message:
179
179
  rdoc_options: []
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
192
  requirements: []
193
- rubygems_version: 3.4.18
193
+ rubygems_version: 3.5.3
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: A friendly CLI for deploying Rails apps ✨