tomo 1.1.0 → 1.3.1
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.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/tomo/cli.rb +1 -3
- data/lib/tomo/cli/common_options.rb +4 -12
- data/lib/tomo/cli/deploy_options.rb +2 -7
- data/lib/tomo/cli/parser.rb +1 -6
- data/lib/tomo/cli/project_options.rb +1 -3
- data/lib/tomo/cli/rules.rb +4 -22
- data/lib/tomo/cli/rules/argument.rb +2 -2
- data/lib/tomo/cli/rules/switch.rb +1 -5
- data/lib/tomo/cli/rules/value_switch.rb +2 -3
- data/lib/tomo/cli/rules_evaluator.rb +3 -13
- data/lib/tomo/cli/usage.rb +1 -3
- data/lib/tomo/commands/default.rb +1 -3
- data/lib/tomo/commands/init.rb +24 -1
- data/lib/tomo/commands/run.rb +1 -3
- data/lib/tomo/configuration.rb +6 -12
- data/lib/tomo/configuration/dsl/error_formatter.rb +1 -1
- data/lib/tomo/configuration/dsl/hosts_and_settings.rb +1 -2
- data/lib/tomo/configuration/plugins_registry.rb +1 -2
- data/lib/tomo/configuration/plugins_registry/gem_resolver.rb +1 -1
- data/lib/tomo/configuration/unknown_environment_error.rb +1 -4
- data/lib/tomo/console.rb +6 -11
- data/lib/tomo/console/menu.rb +1 -2
- data/lib/tomo/host.rb +1 -2
- data/lib/tomo/paths.rb +1 -1
- data/lib/tomo/plugin/bundler/tasks.rb +2 -7
- data/lib/tomo/plugin/core/helpers.rb +1 -1
- data/lib/tomo/plugin/core/tasks.rb +3 -12
- data/lib/tomo/plugin/env/tasks.rb +32 -10
- data/lib/tomo/plugin/git.rb +1 -4
- data/lib/tomo/plugin/git/tasks.rb +4 -14
- data/lib/tomo/plugin/nodenv/tasks.rb +1 -3
- data/lib/tomo/plugin/puma.rb +0 -3
- data/lib/tomo/plugin/puma/tasks.rb +6 -15
- data/lib/tomo/plugin/rails/helpers.rb +1 -1
- data/lib/tomo/plugin/rails/tasks.rb +6 -4
- data/lib/tomo/plugin/testing.rb +1 -3
- data/lib/tomo/remote.rb +1 -3
- data/lib/tomo/runtime.rb +3 -6
- data/lib/tomo/runtime/concurrent_ruby_thread_pool.rb +1 -4
- data/lib/tomo/runtime/execution_plan.rb +1 -4
- data/lib/tomo/runtime/explanation.rb +1 -7
- data/lib/tomo/runtime/settings_required_error.rb +1 -3
- data/lib/tomo/runtime/task_runner.rb +1 -5
- data/lib/tomo/runtime/unknown_task_error.rb +1 -4
- data/lib/tomo/script.rb +1 -5
- data/lib/tomo/shell_builder.rb +5 -10
- data/lib/tomo/ssh/child_process.rb +2 -7
- data/lib/tomo/ssh/connection.rb +5 -18
- data/lib/tomo/ssh/connection_validator.rb +1 -4
- data/lib/tomo/ssh/executable_error.rb +1 -2
- data/lib/tomo/ssh/options.rb +2 -5
- data/lib/tomo/task_api.rb +4 -15
- data/lib/tomo/templates/config.rb.erb +7 -1
- data/lib/tomo/testing/cli_extensions.rb +1 -1
- data/lib/tomo/testing/connection.rb +1 -6
- data/lib/tomo/testing/docker_image.rb +2 -8
- data/lib/tomo/testing/local.rb +1 -3
- data/lib/tomo/testing/ubuntu_setup.sh +1 -2
- data/lib/tomo/version.rb +1 -1
- metadata +8 -135
- data/lib/tomo/configuration/plugin_resolver.rb +0 -63
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f92e6f11a186cd036164b26a2fad74f9afe3d9eec791c46c75c6aaf3040eabe7
|
4
|
+
data.tar.gz: 528ad7dcf0c63df6b887d29bd396475c02df4aef06fb2bae74ea1830a6818127
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f751e1f2bf4684b886016d67e22fd909219e4e1787585614daa1b323562940c0042d56fa16ea99c602e70cbede58d3828dcfd51e0618e790175fd500567e4a6
|
7
|
+
data.tar.gz: 4e6b438a4b13ccc464591b2d43e980f2f0dd5b221e48106c335aa27c17729ba02f36553ac72f1170e0dcc22ad6aea5663faeb82dae70ce437a7f09af08cb4630
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/tomo)
|
4
4
|
[](https://travis-ci.org/mattbrictson/tomo)
|
5
|
-
[](https://app.circleci.com/pipelines/github/mattbrictson/tomo?branch=
|
5
|
+
[](https://app.circleci.com/pipelines/github/mattbrictson/tomo?branch=main)
|
6
6
|
[](https://codeclimate.com/github/mattbrictson/tomo)
|
7
7
|
|
8
8
|
Tomo is a friendly command-line tool for deploying Rails apps. It is a new alternative to Capistrano, Mina, and Shipit that aims for simplicity and developer happiness.
|
@@ -64,7 +64,7 @@ host "user@hostname.or.ip.address"
|
|
64
64
|
set application: "my-rails-app"
|
65
65
|
set deploy_to: "/var/www/%{application}"
|
66
66
|
set git_url: "git@github.com:my-username/my-rails-app.git"
|
67
|
-
set git_branch: "
|
67
|
+
set git_branch: "main"
|
68
68
|
# ...
|
69
69
|
|
70
70
|
setup do
|
@@ -225,7 +225,7 @@ Next run `tomo setup` for _both_ apps; this will set everything up for both user
|
|
225
225
|
|
226
226
|
## Support
|
227
227
|
|
228
|
-
This project is a labor of love and I can only spend a few hours a week maintaining it, at most. If you'd like to help by submitting a pull request, or if you've discovered a bug that needs my attention, please let me know. Check out [CONTRIBUTING.md](https://github.com/mattbrictson/tomo/blob/
|
228
|
+
This project is a labor of love and I can only spend a few hours a week maintaining it, at most. If you'd like to help by submitting a pull request, or if you've discovered a bug that needs my attention, please let me know. Check out [CONTRIBUTING.md](https://github.com/mattbrictson/tomo/blob/main/CONTRIBUTING.md) to get started. Happy hacking! —Matt
|
229
229
|
|
230
230
|
## License
|
231
231
|
|
@@ -233,8 +233,8 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
233
233
|
|
234
234
|
## Code of conduct
|
235
235
|
|
236
|
-
Everyone interacting in the Tomo project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mattbrictson/tomo/blob/
|
236
|
+
Everyone interacting in the Tomo project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mattbrictson/tomo/blob/main/CODE_OF_CONDUCT.md).
|
237
237
|
|
238
238
|
## Contribution guide
|
239
239
|
|
240
|
-
Interested in filing a bug report, feature request, or opening a PR? Excellent! Please read the short [CONTRIBUTING.md](https://github.com/mattbrictson/tomo/blob/
|
240
|
+
Interested in filing a bug report, feature request, or opening a PR? Excellent! Please read the short [CONTRIBUTING.md](https://github.com/mattbrictson/tomo/blob/main/CONTRIBUTING.md) guidelines before you dive in.
|
data/lib/tomo/cli.rb
CHANGED
@@ -20,7 +20,7 @@ module Tomo
|
|
20
20
|
class << self
|
21
21
|
attr_accessor :show_backtrace
|
22
22
|
|
23
|
-
def exit(status=true)
|
23
|
+
def exit(status=true) # rubocop:disable Style/OptionalBooleanParameter
|
24
24
|
Process.exit(status)
|
25
25
|
end
|
26
26
|
end
|
@@ -55,7 +55,6 @@ module Tomo
|
|
55
55
|
argv << "" if argv.shift == "--complete"
|
56
56
|
end
|
57
57
|
|
58
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
59
58
|
def lookup_command(argv)
|
60
59
|
command_name = argv.first unless Completions.active? && argv.length == 1
|
61
60
|
command_name = Abbrev.abbrev(COMMANDS.keys)[command_name]
|
@@ -65,7 +64,6 @@ module Tomo
|
|
65
64
|
command = COMMANDS[command_name] || Tomo::Commands::Default
|
66
65
|
[command, command_name]
|
67
66
|
end
|
68
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
69
67
|
|
70
68
|
def task_format?(arg)
|
71
69
|
arg.to_s.match?(/\A\S+:\S*\z/)
|
@@ -1,22 +1,15 @@
|
|
1
1
|
module Tomo
|
2
2
|
class CLI
|
3
3
|
module CommonOptions
|
4
|
-
# rubocop:disable Metrics/MethodLength
|
5
|
-
def self.included(mod)
|
4
|
+
def self.included(mod) # rubocop:disable Metrics/MethodLength
|
6
5
|
mod.class_eval do
|
7
|
-
option :color,
|
8
|
-
"--[no-]color",
|
9
|
-
"Enable/disable color output" do |color|
|
6
|
+
option :color, "--[no-]color", "Enable/disable color output" do |color|
|
10
7
|
Colors.enabled = color
|
11
8
|
end
|
12
|
-
option :debug,
|
13
|
-
"--[no-]debug",
|
14
|
-
"Enable/disable verbose debug logging" do |debug|
|
9
|
+
option :debug, "--[no-]debug", "Enable/disable verbose debug logging" do |debug|
|
15
10
|
Tomo.debug = debug
|
16
11
|
end
|
17
|
-
option :trace,
|
18
|
-
"--[no-]trace",
|
19
|
-
"Display full backtrace on error" do |trace|
|
12
|
+
option :trace, "--[no-]trace", "Display full backtrace on error" do |trace|
|
20
13
|
CLI.show_backtrace = trace
|
21
14
|
end
|
22
15
|
option :help, "-h, --help", "Print this documentation" do |_help|
|
@@ -27,7 +20,6 @@ module Tomo
|
|
27
20
|
after_parse :dump_runtime_info
|
28
21
|
end
|
29
22
|
end
|
30
|
-
# rubocop:enable Metrics/MethodLength
|
31
23
|
|
32
24
|
private
|
33
25
|
|
@@ -1,8 +1,7 @@
|
|
1
1
|
module Tomo
|
2
2
|
class CLI
|
3
3
|
module DeployOptions
|
4
|
-
# rubocop:disable Metrics/MethodLength
|
5
|
-
def self.included(mod)
|
4
|
+
def self.included(mod) # rubocop:disable Metrics/MethodLength
|
6
5
|
mod.class_eval do
|
7
6
|
option :environment,
|
8
7
|
"-e, --environment ENVIRONMENT",
|
@@ -23,7 +22,6 @@ module Tomo
|
|
23
22
|
after_parse :prompt_for_environment
|
24
23
|
end
|
25
24
|
end
|
26
|
-
# rubocop:enable Metrics/MethodLength
|
27
25
|
|
28
26
|
private
|
29
27
|
|
@@ -49,10 +47,7 @@ module Tomo
|
|
49
47
|
return if envs.empty?
|
50
48
|
return unless Console.interactive?
|
51
49
|
|
52
|
-
options[:environment] = Console.menu(
|
53
|
-
"Choose an environment:",
|
54
|
-
choices: envs
|
55
|
-
)
|
50
|
+
options[:environment] = Console.menu("Choose an environment:", choices: envs)
|
56
51
|
end
|
57
52
|
end
|
58
53
|
end
|
data/lib/tomo/cli/parser.rb
CHANGED
@@ -46,12 +46,7 @@ module Tomo
|
|
46
46
|
attr_reader :rules, :usage, :after_parse_methods
|
47
47
|
|
48
48
|
def evaluate(argv, state, literal:)
|
49
|
-
RulesEvaluator.evaluate(
|
50
|
-
rules: rules.to_a,
|
51
|
-
argv: argv,
|
52
|
-
state: state,
|
53
|
-
literal: literal
|
54
|
-
)
|
49
|
+
RulesEvaluator.evaluate(rules: rules.to_a, argv: argv, state: state, literal: literal)
|
55
50
|
end
|
56
51
|
|
57
52
|
def check_required_rules(state)
|
@@ -3,9 +3,7 @@ module Tomo
|
|
3
3
|
module ProjectOptions
|
4
4
|
def self.included(mod)
|
5
5
|
mod.class_eval do
|
6
|
-
option :project,
|
7
|
-
"-c, --config PATH",
|
8
|
-
"Location of project config (default: #{DEFAULT_CONFIG_PATH})"
|
6
|
+
option :project, "-c, --config PATH", "Location of project config (default: #{DEFAULT_CONFIG_PATH})"
|
9
7
|
end
|
10
8
|
end
|
11
9
|
|
data/lib/tomo/cli/rules.rb
CHANGED
@@ -51,21 +51,11 @@ module Tomo
|
|
51
51
|
attr_reader :rules
|
52
52
|
|
53
53
|
def optional_arg_rule(spec, values_proc)
|
54
|
-
Rules::Argument.new(
|
55
|
-
spec,
|
56
|
-
values_proc: values_proc,
|
57
|
-
required: false,
|
58
|
-
multiple: false
|
59
|
-
)
|
54
|
+
Rules::Argument.new(spec, values_proc: values_proc, required: false, multiple: false)
|
60
55
|
end
|
61
56
|
|
62
57
|
def required_arg_rule(spec, values_proc)
|
63
|
-
Rules::Argument.new(
|
64
|
-
spec,
|
65
|
-
values_proc: values_proc,
|
66
|
-
required: true,
|
67
|
-
multiple: false
|
68
|
-
)
|
58
|
+
Rules::Argument.new(spec, values_proc: values_proc, required: true, multiple: false)
|
69
59
|
end
|
70
60
|
|
71
61
|
def mutiple_optional_args_rule(spec, values_proc)
|
@@ -73,10 +63,7 @@ module Tomo
|
|
73
63
|
end
|
74
64
|
|
75
65
|
def on_off_switch_rule(key, name, _values_proc, callback_proc)
|
76
|
-
Rules::Switch.new(key,
|
77
|
-
"--#{name}",
|
78
|
-
"--no-#{name}",
|
79
|
-
callback_proc: callback_proc) do |arg|
|
66
|
+
Rules::Switch.new(key, "--#{name}", "--no-#{name}", callback_proc: callback_proc) do |arg|
|
80
67
|
arg == "--#{name}"
|
81
68
|
end
|
82
69
|
end
|
@@ -86,12 +73,7 @@ module Tomo
|
|
86
73
|
end
|
87
74
|
|
88
75
|
def value_switch_rule(key, *switches, values_proc, callback_proc)
|
89
|
-
Rules::ValueSwitch.new(
|
90
|
-
key,
|
91
|
-
*switches,
|
92
|
-
values_proc: values_proc,
|
93
|
-
callback_proc: callback_proc
|
94
|
-
)
|
76
|
+
Rules::ValueSwitch.new(key, *switches, values_proc: values_proc, callback_proc: callback_proc)
|
95
77
|
end
|
96
78
|
end
|
97
79
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Tomo::CLI::Rules
|
2
2
|
class Argument
|
3
|
-
def initialize(label, multiple: false, required: false
|
3
|
+
def initialize(label, values_proc:, multiple: false, required: false)
|
4
4
|
@label = label
|
5
5
|
@multiple = multiple
|
6
6
|
@required = required
|
@@ -15,7 +15,7 @@ class Tomo::CLI::Rules
|
|
15
15
|
state.parsed_arg(arg)
|
16
16
|
end
|
17
17
|
|
18
|
-
def candidates(literal: false
|
18
|
+
def candidates(state:, literal: false)
|
19
19
|
values(state).reject { |val| literal && val.start_with?("-") }
|
20
20
|
end
|
21
21
|
|
@@ -1,10 +1,6 @@
|
|
1
1
|
class Tomo::CLI::Rules
|
2
2
|
class Switch
|
3
|
-
def initialize(key,
|
4
|
-
*switches,
|
5
|
-
required: false,
|
6
|
-
callback_proc:,
|
7
|
-
&convert_proc)
|
3
|
+
def initialize(key, *switches, callback_proc:, required: false, &convert_proc)
|
8
4
|
@key = key
|
9
5
|
@switches = switches
|
10
6
|
@callback_proc = callback_proc
|
@@ -28,7 +28,7 @@ class Tomo::CLI::Rules
|
|
28
28
|
state.parsed_option(key, value)
|
29
29
|
end
|
30
30
|
|
31
|
-
def candidates(switch=nil, literal: false
|
31
|
+
def candidates(switch=nil, state:, literal: false)
|
32
32
|
return [] if literal
|
33
33
|
|
34
34
|
vals = values(state)
|
@@ -51,8 +51,7 @@ class Tomo::CLI::Rules
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def raise_missing_value(switch)
|
54
|
-
raise Tomo::CLI::Error,
|
55
|
-
"Please specify a value for the #{yellow(switch)} option."
|
54
|
+
raise Tomo::CLI::Error, "Please specify a value for the #{yellow(switch)} option."
|
56
55
|
end
|
57
56
|
end
|
58
57
|
end
|
@@ -41,11 +41,7 @@ module Tomo
|
|
41
41
|
def complete_if_needed(matched_rules, *matched_args)
|
42
42
|
return unless Completions.active?
|
43
43
|
|
44
|
-
completions.print_completions_and_exit(
|
45
|
-
matched_rules,
|
46
|
-
*matched_args,
|
47
|
-
state: state
|
48
|
-
)
|
44
|
+
completions.print_completions_and_exit(matched_rules, *matched_args, state: state)
|
49
45
|
end
|
50
46
|
|
51
47
|
def remaining_rules
|
@@ -56,15 +52,9 @@ module Tomo
|
|
56
52
|
|
57
53
|
def raise_unrecognized_args
|
58
54
|
problem_arg = argv.first
|
59
|
-
type =
|
60
|
-
"arg"
|
61
|
-
else
|
62
|
-
"option"
|
63
|
-
end
|
55
|
+
type = literal || !problem_arg.start_with?("-") ? "arg" : "option"
|
64
56
|
|
65
|
-
raise CLI::Error,
|
66
|
-
"#{Colors.yellow(problem_arg)} is not a recognized #{type} "\
|
67
|
-
"for this tomo command."
|
57
|
+
raise CLI::Error, "#{Colors.yellow(problem_arg)} is not a recognized #{type} for this tomo command."
|
68
58
|
end
|
69
59
|
end
|
70
60
|
end
|
data/lib/tomo/cli/usage.rb
CHANGED
@@ -42,9 +42,7 @@ module Tomo
|
|
42
42
|
# do anything, so if we got this far, something has gone wrong.
|
43
43
|
|
44
44
|
if options.any?
|
45
|
-
raise CLI::Error,
|
46
|
-
"Options must be specified after the command: " +
|
47
|
-
yellow("tomo #{args.first} [options]")
|
45
|
+
raise CLI::Error, "Options must be specified after the command: " + yellow("tomo #{args.first} [options]")
|
48
46
|
end
|
49
47
|
|
50
48
|
raise_unrecognized_command(args.first)
|
data/lib/tomo/commands/init.rb
CHANGED
@@ -70,6 +70,14 @@ module Tomo
|
|
70
70
|
nil
|
71
71
|
end
|
72
72
|
|
73
|
+
def git_branch
|
74
|
+
return unless File.file?(".git/config")
|
75
|
+
|
76
|
+
`git rev-parse --abbrev-ref HEAD`.chomp
|
77
|
+
rescue SystemCallError
|
78
|
+
nil
|
79
|
+
end
|
80
|
+
|
73
81
|
def node_version
|
74
82
|
`node --version`.chomp.sub(/^v/i, "")
|
75
83
|
rescue SystemCallError
|
@@ -82,10 +90,25 @@ module Tomo
|
|
82
90
|
nil
|
83
91
|
end
|
84
92
|
|
93
|
+
def rubocop?
|
94
|
+
File.exist?(".rubocop.yml")
|
95
|
+
end
|
96
|
+
|
97
|
+
def erb_2_2_or_later?
|
98
|
+
erb_version = Gem::Version.new(ERB.version[/\d[\d.]+/])
|
99
|
+
Gem::Requirement.new(">= 2.2").satisfied_by?(erb_version)
|
100
|
+
end
|
101
|
+
|
85
102
|
def config_rb_template(app)
|
86
103
|
path = File.expand_path("../templates/config.rb.erb", __dir__)
|
87
104
|
template = IO.read(path)
|
88
|
-
|
105
|
+
|
106
|
+
# TODO: remove once we drop Ruby 2.5 support?
|
107
|
+
if erb_2_2_or_later?
|
108
|
+
ERB.new(template, trim_mode: "-").result(binding)
|
109
|
+
else
|
110
|
+
ERB.new(template, nil, "-").result(binding)
|
111
|
+
end
|
89
112
|
end
|
90
113
|
end
|
91
114
|
end
|
data/lib/tomo/commands/run.rb
CHANGED
@@ -3,9 +3,7 @@ module Tomo
|
|
3
3
|
class Run < CLI::Command
|
4
4
|
include CLI::DeployOptions
|
5
5
|
|
6
|
-
option :privileged,
|
7
|
-
"--[no-]privileged",
|
8
|
-
"Run the task using a privileged user (e.g. root)"
|
6
|
+
option :privileged, "--[no-]privileged", "Run the task using a privileged user (e.g. root)"
|
9
7
|
|
10
8
|
include CLI::ProjectOptions
|
11
9
|
include CLI::CommonOptions
|
data/lib/tomo/configuration.rb
CHANGED
@@ -3,16 +3,13 @@ module Tomo
|
|
3
3
|
autoload :DSL, "tomo/configuration/dsl"
|
4
4
|
autoload :Environment, "tomo/configuration/environment"
|
5
5
|
autoload :Glob, "tomo/configuration/glob"
|
6
|
-
autoload :PluginFileNotFoundError,
|
7
|
-
"tomo/configuration/plugin_file_not_found_error"
|
6
|
+
autoload :PluginFileNotFoundError, "tomo/configuration/plugin_file_not_found_error"
|
8
7
|
autoload :PluginsRegistry, "tomo/configuration/plugins_registry"
|
9
8
|
autoload :ProjectNotFoundError, "tomo/configuration/project_not_found_error"
|
10
9
|
autoload :RoleBasedTaskFilter, "tomo/configuration/role_based_task_filter"
|
11
|
-
autoload :UnknownEnvironmentError,
|
12
|
-
"tomo/configuration/unknown_environment_error"
|
10
|
+
autoload :UnknownEnvironmentError, "tomo/configuration/unknown_environment_error"
|
13
11
|
autoload :UnknownPluginError, "tomo/configuration/unknown_plugin_error"
|
14
|
-
autoload :UnspecifiedEnvironmentError,
|
15
|
-
"tomo/configuration/unspecified_environment_error"
|
12
|
+
autoload :UnspecifiedEnvironmentError, "tomo/configuration/unspecified_environment_error"
|
16
13
|
|
17
14
|
def self.from_config_rb(path=DEFAULT_CONFIG_PATH)
|
18
15
|
ProjectNotFoundError.raise_with(path: path) unless File.file?(path)
|
@@ -27,8 +24,7 @@ module Tomo
|
|
27
24
|
raise DSL::ErrorFormatter.decorate(e, path, config_rb&.lines)
|
28
25
|
end
|
29
26
|
|
30
|
-
attr_accessor :environments, :deploy_tasks, :setup_tasks, :hosts, :plugins,
|
31
|
-
:settings, :task_filter, :path
|
27
|
+
attr_accessor :environments, :deploy_tasks, :setup_tasks, :hosts, :plugins, :settings, :task_filter, :path
|
32
28
|
|
33
29
|
def initialize
|
34
30
|
@environments = {}
|
@@ -94,7 +90,7 @@ module Tomo
|
|
94
90
|
plugins_registry = PluginsRegistry.new
|
95
91
|
|
96
92
|
(["core"] + plugins.uniq).each do |plug|
|
97
|
-
if
|
93
|
+
if plug.start_with?(".", "/")
|
98
94
|
plug = File.expand_path(plug, File.dirname(path)) unless path.nil?
|
99
95
|
plugins_registry.load_plugin_from_path(plug)
|
100
96
|
else
|
@@ -116,9 +112,7 @@ module Tomo
|
|
116
112
|
end
|
117
113
|
|
118
114
|
def raise_unknown_environment(environ)
|
119
|
-
UnknownEnvironmentError.raise_with(
|
120
|
-
name: environ, known_environments: environments.keys
|
121
|
-
)
|
115
|
+
UnknownEnvironmentError.raise_with(name: environ, known_environments: environments.keys)
|
122
116
|
end
|
123
117
|
end
|
124
118
|
end
|
@@ -7,8 +7,7 @@ module Tomo
|
|
7
7
|
self
|
8
8
|
end
|
9
9
|
|
10
|
-
def host(address, port: 22, roles: [],
|
11
|
-
log_prefix: nil, privileged_user: "root")
|
10
|
+
def host(address, port: 22, roles: [], log_prefix: nil, privileged_user: "root")
|
12
11
|
@config.hosts << Host.parse(
|
13
12
|
address,
|
14
13
|
privileged_user: privileged_user,
|
@@ -1,8 +1,7 @@
|
|
1
1
|
module Tomo
|
2
2
|
class Configuration
|
3
3
|
class PluginsRegistry
|
4
|
-
autoload :FileResolver,
|
5
|
-
"tomo/configuration/plugins_registry/file_resolver"
|
4
|
+
autoload :FileResolver, "tomo/configuration/plugins_registry/file_resolver"
|
6
5
|
autoload :GemResolver, "tomo/configuration/plugins_registry/gem_resolver"
|
7
6
|
|
8
7
|
attr_reader :helper_modules, :settings
|