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 +4 -4
- data/README.md +52 -49
- data/lib/tomo/cli/completions.rb +1 -1
- data/lib/tomo/cli/usage.rb +1 -1
- data/lib/tomo/commands/default.rb +1 -1
- data/lib/tomo/commands/deploy.rb +1 -1
- data/lib/tomo/commands/init.rb +22 -6
- data/lib/tomo/commands/run.rb +1 -1
- data/lib/tomo/commands/setup.rb +1 -1
- data/lib/tomo/configuration/dsl/error_formatter.rb +1 -1
- data/lib/tomo/host.rb +1 -1
- data/lib/tomo/plugin/bundler/tasks.rb +1 -0
- data/lib/tomo/plugin/bundler.rb +9 -8
- data/lib/tomo/plugin/core/helpers.rb +4 -3
- data/lib/tomo/plugin/env/tasks.rb +1 -1
- data/lib/tomo/plugin/puma/tasks.rb +1 -1
- data/lib/tomo/remote.rb +1 -1
- data/lib/tomo/runtime/concurrent_ruby_thread_pool.rb +2 -2
- data/lib/tomo/runtime/explanation.rb +1 -1
- data/lib/tomo/runtime/no_tasks_error.rb +1 -1
- data/lib/tomo/runtime/settings_interpolation.rb +1 -1
- data/lib/tomo/shell_builder.rb +1 -1
- data/lib/tomo/templates/config.rb.erb +1 -1
- data/lib/tomo/templates/plugin.rb.erb +1 -0
- data/lib/tomo/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1df37ae46768cbf38ec93e0a12a25344daf0214e4d51ec36e94b0910cc52fe09
|
4
|
+
data.tar.gz: 3005404f4cbb57a5bf7ef3df25cb6a84e55ab4a67752dae7022399bc2f8125a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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://
|
4
|
-
[![
|
5
|
-
[![
|
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
|
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
|
90
|
-
[→ Check out the **Deploying Rails From Scratch** tutorial for a step-by-step guide to using tomo with a real app.](https://tomo
|
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
|
115
|
-
[→ The `tomo setup` section of the reference docs explains supported command-line options.](https://tomo
|
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
|
122
|
-
2. Build the project (e.g. [bundler:install](https://tomo
|
123
|
-
3. Migrate data to the meet the requirements of the new release (e.g. [rails:db_migrate](https://tomo
|
124
|
-
4. Make the new release the "current" one ([core:symlink_current](https://tomo
|
125
|
-
5. Restart the app to use the new current release (e.g. [puma:restart](https://tomo
|
126
|
-
6. Perform any cleanup (e.g. [bundler:clean](https://tomo
|
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
|
131
|
-
[→ The `tomo deploy` section of the reference docs explains supported command-line options, like `--dry-run`.](https://tomo
|
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
|
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
|
175
|
-
[→ The **TaskLibrary** API is tomo's DSL for building tasks.](https://tomo
|
176
|
-
[→ The **Publishing a Plugin** tutorial explains how to package your plugin as a Ruby gem to share it with the community.](https://tomo
|
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
|
181
|
-
- [Writing Custom Tasks](https://tomo
|
182
|
-
- [Publishing a Plugin](https://tomo
|
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
|
189
|
+
- [Configuration](https://tomo.mattbrictson.com/configuration/)
|
187
190
|
- Commands
|
188
|
-
- [init](https://tomo
|
189
|
-
- [setup](https://tomo
|
190
|
-
- [deploy](https://tomo
|
191
|
-
- [run](https://tomo
|
192
|
-
- [tasks](https://tomo
|
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
|
195
|
-
- [bundler](https://tomo
|
196
|
-
- [env](https://tomo
|
197
|
-
- [git](https://tomo
|
198
|
-
- [nodenv](https://tomo
|
199
|
-
- [puma](https://tomo
|
200
|
-
- [rails](https://tomo
|
201
|
-
- [rbenv](https://tomo
|
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
|
204
|
-
- [Logger](https://tomo
|
205
|
-
- [Paths](https://tomo
|
206
|
-
- [PluginDSL](https://tomo
|
207
|
-
- [Remote](https://tomo
|
208
|
-
- [Result](https://tomo
|
209
|
-
- [TaskLibrary](https://tomo
|
210
|
-
- [Testing::MockPluginTester](https://tomo
|
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
|
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
|
|
data/lib/tomo/cli/completions.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/tomo/cli/usage.rb
CHANGED
@@ -26,7 +26,7 @@ module Tomo
|
|
26
26
|
attr_reader :banner_proc, :options
|
27
27
|
|
28
28
|
def options_help
|
29
|
-
width = options.map
|
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")
|
data/lib/tomo/commands/deploy.rb
CHANGED
data/lib/tomo/commands/init.rb
CHANGED
@@ -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
|
72
|
+
def git_main_branch
|
75
73
|
return unless File.file?(".git/config")
|
76
74
|
|
77
|
-
|
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
|
data/lib/tomo/commands/run.rb
CHANGED
data/lib/tomo/commands/setup.rb
CHANGED
@@ -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
|
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(
|
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")
|
data/lib/tomo/plugin/bundler.rb
CHANGED
@@ -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:
|
12
|
-
bundler_deployment:
|
13
|
-
bundler_gemfile:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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,
|
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
|
-
|
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,
|
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
|
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,
|
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(
|
20
|
+
def post(...)
|
21
21
|
return if failure?
|
22
22
|
|
23
|
-
promises << future_on(executor,
|
23
|
+
promises << future_on(executor, ...)
|
24
24
|
.on_rejection_using(executor) do |reason|
|
25
25
|
self.failure = reason
|
26
26
|
end
|
@@ -39,7 +39,7 @@ module Tomo
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def dump_settings(hash)
|
42
|
-
key_len = hash.keys.map
|
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)
|
data/lib/tomo/shell_builder.rb
CHANGED
@@ -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
|
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: <%=
|
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
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.
|
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-
|
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
|
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.
|
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 ✨
|