tomo 1.19.0 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/tomo +1 -0
- data/lib/tomo/cli/command.rb +2 -0
- data/lib/tomo/cli/common_options.rb +2 -0
- data/lib/tomo/cli/completions.rb +2 -0
- data/lib/tomo/cli/deploy_options.rb +2 -0
- data/lib/tomo/cli/error.rb +2 -0
- data/lib/tomo/cli/interrupted_error.rb +2 -0
- data/lib/tomo/cli/options.rb +2 -0
- data/lib/tomo/cli/parser.rb +2 -0
- data/lib/tomo/cli/project_options.rb +2 -0
- data/lib/tomo/cli/rules/argument.rb +2 -0
- data/lib/tomo/cli/rules/switch.rb +2 -0
- data/lib/tomo/cli/rules/value_switch.rb +2 -0
- data/lib/tomo/cli/rules.rb +2 -0
- data/lib/tomo/cli/rules_evaluator.rb +2 -0
- data/lib/tomo/cli/state.rb +2 -0
- data/lib/tomo/cli/usage.rb +2 -0
- data/lib/tomo/cli.rb +2 -0
- data/lib/tomo/colors.rb +2 -0
- data/lib/tomo/commands/completion_script.rb +2 -0
- data/lib/tomo/commands/default.rb +2 -0
- data/lib/tomo/commands/deploy.rb +2 -0
- data/lib/tomo/commands/help.rb +2 -0
- data/lib/tomo/commands/init.rb +2 -0
- data/lib/tomo/commands/run.rb +2 -0
- data/lib/tomo/commands/setup.rb +2 -0
- data/lib/tomo/commands/tasks.rb +2 -0
- data/lib/tomo/commands/version.rb +2 -0
- data/lib/tomo/commands.rb +2 -0
- data/lib/tomo/configuration/dsl/batch_block.rb +2 -0
- data/lib/tomo/configuration/dsl/config_file.rb +2 -0
- data/lib/tomo/configuration/dsl/environment_block.rb +2 -0
- data/lib/tomo/configuration/dsl/error_formatter.rb +3 -1
- data/lib/tomo/configuration/dsl/hosts_and_settings.rb +2 -0
- data/lib/tomo/configuration/dsl/tasks_block.rb +2 -0
- data/lib/tomo/configuration/dsl.rb +2 -0
- data/lib/tomo/configuration/environment.rb +2 -0
- data/lib/tomo/configuration/glob.rb +2 -0
- data/lib/tomo/configuration/plugin_file_not_found_error.rb +2 -0
- data/lib/tomo/configuration/plugins_registry/file_resolver.rb +2 -0
- data/lib/tomo/configuration/plugins_registry/gem_resolver.rb +3 -1
- data/lib/tomo/configuration/plugins_registry.rb +2 -0
- data/lib/tomo/configuration/project_not_found_error.rb +2 -0
- data/lib/tomo/configuration/role_based_task_filter.rb +2 -0
- data/lib/tomo/configuration/unknown_environment_error.rb +4 -2
- data/lib/tomo/configuration/unknown_plugin_error.rb +4 -2
- data/lib/tomo/configuration/unspecified_environment_error.rb +2 -0
- data/lib/tomo/configuration.rb +2 -0
- data/lib/tomo/console/key_reader.rb +4 -2
- data/lib/tomo/console/menu.rb +6 -4
- data/lib/tomo/console/non_interactive_error.rb +4 -2
- data/lib/tomo/console.rb +2 -0
- data/lib/tomo/error/suggestions.rb +2 -0
- data/lib/tomo/error.rb +2 -0
- data/lib/tomo/host.rb +2 -0
- data/lib/tomo/logger/tagged_io.rb +2 -0
- data/lib/tomo/logger.rb +2 -0
- data/lib/tomo/path.rb +2 -0
- data/lib/tomo/paths.rb +2 -0
- data/lib/tomo/plugin/bundler/helpers.rb +2 -0
- data/lib/tomo/plugin/bundler/tasks.rb +2 -0
- data/lib/tomo/plugin/bundler.rb +2 -0
- data/lib/tomo/plugin/core/helpers.rb +2 -0
- data/lib/tomo/plugin/core/tasks.rb +2 -0
- data/lib/tomo/plugin/core.rb +2 -0
- data/lib/tomo/plugin/env/tasks.rb +2 -0
- data/lib/tomo/plugin/env.rb +2 -0
- data/lib/tomo/plugin/git/helpers.rb +2 -0
- data/lib/tomo/plugin/git/tasks.rb +2 -0
- data/lib/tomo/plugin/git.rb +2 -0
- data/lib/tomo/plugin/nodenv/tasks.rb +2 -0
- data/lib/tomo/plugin/nodenv.rb +2 -0
- data/lib/tomo/plugin/puma/tasks.rb +2 -0
- data/lib/tomo/plugin/puma.rb +2 -0
- data/lib/tomo/plugin/rails/helpers.rb +2 -0
- data/lib/tomo/plugin/rails/tasks.rb +2 -0
- data/lib/tomo/plugin/rails.rb +2 -0
- data/lib/tomo/plugin/rbenv/tasks.rb +2 -0
- data/lib/tomo/plugin/rbenv.rb +2 -0
- data/lib/tomo/plugin/testing.rb +2 -0
- data/lib/tomo/plugin.rb +2 -0
- data/lib/tomo/plugin_dsl.rb +2 -0
- data/lib/tomo/remote.rb +2 -0
- data/lib/tomo/result.rb +3 -1
- data/lib/tomo/runtime/concurrent_ruby_load_error.rb +2 -0
- data/lib/tomo/runtime/concurrent_ruby_thread_pool.rb +2 -0
- data/lib/tomo/runtime/context.rb +2 -0
- data/lib/tomo/runtime/current.rb +2 -0
- data/lib/tomo/runtime/execution_plan.rb +2 -0
- data/lib/tomo/runtime/explanation.rb +3 -1
- data/lib/tomo/runtime/host_execution_step.rb +2 -0
- data/lib/tomo/runtime/inline_thread_pool.rb +2 -0
- data/lib/tomo/runtime/no_tasks_error.rb +2 -0
- data/lib/tomo/runtime/privileged_task.rb +2 -0
- data/lib/tomo/runtime/settings_interpolation.rb +3 -1
- data/lib/tomo/runtime/settings_required_error.rb +3 -1
- data/lib/tomo/runtime/task_aborted_error.rb +2 -0
- data/lib/tomo/runtime/task_runner.rb +2 -0
- data/lib/tomo/runtime/template_not_found_error.rb +2 -0
- data/lib/tomo/runtime/unknown_task_error.rb +3 -1
- data/lib/tomo/runtime.rb +2 -0
- data/lib/tomo/script.rb +2 -0
- data/lib/tomo/shell_builder.rb +2 -0
- data/lib/tomo/ssh/child_process.rb +2 -0
- data/lib/tomo/ssh/connection.rb +2 -0
- data/lib/tomo/ssh/connection_error.rb +2 -0
- data/lib/tomo/ssh/connection_validator.rb +2 -0
- data/lib/tomo/ssh/error.rb +2 -0
- data/lib/tomo/ssh/executable_error.rb +2 -0
- data/lib/tomo/ssh/options.rb +4 -2
- data/lib/tomo/ssh/permission_error.rb +2 -0
- data/lib/tomo/ssh/script_error.rb +2 -0
- data/lib/tomo/ssh/unknown_error.rb +2 -0
- data/lib/tomo/ssh/unsupported_version_error.rb +2 -0
- data/lib/tomo/ssh.rb +2 -0
- data/lib/tomo/task_api.rb +2 -0
- data/lib/tomo/task_library.rb +2 -0
- data/lib/tomo/testing/Dockerfile +1 -1
- data/lib/tomo/testing/cli_extensions.rb +2 -0
- data/lib/tomo/testing/cli_tester.rb +2 -0
- data/lib/tomo/testing/connection.rb +2 -0
- data/lib/tomo/testing/docker_image.rb +4 -2
- data/lib/tomo/testing/host_extensions.rb +3 -1
- data/lib/tomo/testing/local.rb +2 -0
- data/lib/tomo/testing/log_capturing.rb +2 -0
- data/lib/tomo/testing/mock_plugin_tester.rb +2 -0
- data/lib/tomo/testing/mocked_exec_error.rb +2 -0
- data/lib/tomo/testing/mocked_exit_error.rb +2 -0
- data/lib/tomo/testing/remote_extensions.rb +2 -0
- data/lib/tomo/testing/ssh_extensions.rb +2 -0
- data/lib/tomo/testing/systemctl.rb +1 -0
- data/lib/tomo/testing/ubuntu_setup.sh +3 -1
- data/lib/tomo/testing.rb +2 -0
- data/lib/tomo/version.rb +3 -1
- data/lib/tomo.rb +3 -1
- metadata +3 -3
data/lib/tomo/plugin/rbenv.rb
CHANGED
data/lib/tomo/plugin/testing.rb
CHANGED
data/lib/tomo/plugin.rb
CHANGED
data/lib/tomo/plugin_dsl.rb
CHANGED
data/lib/tomo/remote.rb
CHANGED
data/lib/tomo/result.rb
CHANGED
data/lib/tomo/runtime/context.rb
CHANGED
data/lib/tomo/runtime/current.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Runtime
|
3
5
|
class Explanation
|
@@ -22,7 +24,7 @@ module Tomo
|
|
22
24
|
indent = threads > 1 ? " = " : ""
|
23
25
|
if threads > 1 && step.applicable_tasks.length > 1
|
24
26
|
desc << "#{indent}IN SEQUENCE:"
|
25
|
-
indent.sub
|
27
|
+
indent = indent.sub("=", " ")
|
26
28
|
end
|
27
29
|
desc << step.explain.gsub(/^/, indent)
|
28
30
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Runtime
|
3
5
|
class SettingsInterpolation
|
@@ -40,7 +42,7 @@ module Tomo
|
|
40
42
|
|
41
43
|
def dump_settings(hash)
|
42
44
|
key_len = hash.keys.map { |k| k.to_s.length }.max
|
43
|
-
dump = "Settings: {\n"
|
45
|
+
dump = +"Settings: {\n"
|
44
46
|
hash.to_a.sort_by(&:first).each do |key, value|
|
45
47
|
justified_key = "#{key}:".ljust(key_len + 1)
|
46
48
|
dump << " #{justified_key} #{value.inspect},\n"
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Runtime
|
3
5
|
class SettingsRequiredError < Tomo::Error
|
@@ -24,7 +26,7 @@ module Tomo
|
|
24
26
|
return "a value for the #{yellow(settings.first.to_s)} setting." if settings.length == 1
|
25
27
|
|
26
28
|
sentence = "values for these settings:\n\n "
|
27
|
-
sentence
|
29
|
+
sentence + settings.map { |s| yellow(s.to_s) }.join("\n ")
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
class Runtime
|
3
5
|
class UnknownTaskError < Error
|
@@ -10,7 +12,7 @@ module Tomo
|
|
10
12
|
ERROR
|
11
13
|
|
12
14
|
sugg = spelling_suggestion || missing_plugin_suggestion
|
13
|
-
error
|
15
|
+
error += sugg if sugg
|
14
16
|
error
|
15
17
|
end
|
16
18
|
|
data/lib/tomo/runtime.rb
CHANGED
data/lib/tomo/script.rb
CHANGED
data/lib/tomo/shell_builder.rb
CHANGED
data/lib/tomo/ssh/connection.rb
CHANGED
data/lib/tomo/ssh/error.rb
CHANGED
data/lib/tomo/ssh/options.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
module SSH
|
3
5
|
class Options
|
4
6
|
DEFAULTS = {
|
5
7
|
ssh_connect_timeout: 5,
|
6
|
-
ssh_executable: "ssh"
|
8
|
+
ssh_executable: "ssh",
|
7
9
|
ssh_extra_opts: %w[-o PasswordAuthentication=no].map(&:freeze),
|
8
10
|
ssh_forward_agent: true,
|
9
11
|
ssh_reuse_connections: true,
|
10
|
-
ssh_strict_host_key_checking: "accept-new"
|
12
|
+
ssh_strict_host_key_checking: "accept-new"
|
11
13
|
}.freeze
|
12
14
|
|
13
15
|
attr_reader :executable
|
data/lib/tomo/ssh.rb
CHANGED
data/lib/tomo/task_api.rb
CHANGED
data/lib/tomo/task_library.rb
CHANGED
data/lib/tomo/testing/Dockerfile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "fileutils"
|
2
4
|
require "open3"
|
3
5
|
require "securerandom"
|
@@ -69,8 +71,8 @@ module Tomo
|
|
69
71
|
attr_reader :container_id, :image_id, :private_key_path
|
70
72
|
|
71
73
|
def pull_base_image_if_needed
|
72
|
-
images = Local.capture('docker images --format "{{.ID}}" ubuntu:
|
73
|
-
Local.capture("docker pull ubuntu:
|
74
|
+
images = Local.capture('docker images --format "{{.ID}}" ubuntu:24.04')
|
75
|
+
Local.capture("docker pull ubuntu:24.04") if images.strip.empty?
|
74
76
|
end
|
75
77
|
|
76
78
|
def set_up_private_key
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
module Testing
|
3
5
|
module HostExtensions
|
@@ -14,7 +16,7 @@ module Tomo
|
|
14
16
|
def mock(script, stdout: "", stderr: "", exit_status: 0)
|
15
17
|
mocks << [
|
16
18
|
script.is_a?(Regexp) ? script : /\A#{Regexp.quote(script)}\z/,
|
17
|
-
Result.new(stdout
|
19
|
+
Result.new(stdout: String.new(stdout), stderr: String.new(stderr), exit_status:)
|
18
20
|
]
|
19
21
|
end
|
20
22
|
|
data/lib/tomo/testing/local.rb
CHANGED
@@ -4,6 +4,9 @@ set -e
|
|
4
4
|
|
5
5
|
export DEBIAN_FRONTEND=noninteractive
|
6
6
|
|
7
|
+
apt-get -y update
|
8
|
+
apt-get -y install adduser
|
9
|
+
|
7
10
|
# Create `deployer` user
|
8
11
|
adduser --disabled-password deployer < /dev/null
|
9
12
|
mkdir -p /home/deployer/.ssh
|
@@ -16,7 +19,6 @@ mkdir -p /var/lib/systemd/linger
|
|
16
19
|
touch /var/lib/systemd/linger/deployer
|
17
20
|
|
18
21
|
# Packages needed for ruby, etc.
|
19
|
-
apt-get -y update
|
20
22
|
apt-get -y install autoconf \
|
21
23
|
bison \
|
22
24
|
build-essential \
|
data/lib/tomo/testing.rb
CHANGED
data/lib/tomo/version.rb
CHANGED
data/lib/tomo.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tomo
|
2
4
|
autoload :CLI, "tomo/cli"
|
3
5
|
autoload :Colors, "tomo/colors"
|
@@ -21,7 +23,7 @@ module Tomo
|
|
21
23
|
autoload :TaskLibrary, "tomo/task_library"
|
22
24
|
autoload :VERSION, "tomo/version"
|
23
25
|
|
24
|
-
DEFAULT_CONFIG_PATH = ".tomo/config.rb"
|
26
|
+
DEFAULT_CONFIG_PATH = ".tomo/config.rb"
|
25
27
|
|
26
28
|
class << self
|
27
29
|
attr_accessor :logger
|
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.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brictson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-01 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
|
@@ -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.5.
|
193
|
+
rubygems_version: 3.5.18
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: A friendly CLI for deploying Rails apps ✨
|