tomo 0.19.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -6
- data/lib/tomo/cli.rb +0 -2
- 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/switch.rb +1 -5
- data/lib/tomo/cli/rules/value_switch.rb +1 -2
- 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 +5 -11
- data/lib/tomo/configuration/dsl/hosts_and_settings.rb +1 -2
- data/lib/tomo/configuration/plugin_resolver.rb +1 -1
- 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 +2 -8
- data/lib/tomo/console/menu.rb +1 -2
- data/lib/tomo/host.rb +1 -2
- data/lib/tomo/plugin/bundler/tasks.rb +2 -7
- data/lib/tomo/plugin/core/tasks.rb +3 -12
- data/lib/tomo/plugin/env/tasks.rb +2 -5
- 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/systemd/service.erb +1 -1
- 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_interpolation.rb +1 -3
- data/lib/tomo/runtime/settings_required_error.rb +1 -3
- data/lib/tomo/runtime/task_runner.rb +2 -7
- 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 +6 -13
- data/lib/tomo/ssh/connection.rb +3 -16
- 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.rb +0 -2
- data/lib/tomo/testing/Dockerfile +1 -3
- data/lib/tomo/testing/connection.rb +1 -6
- data/lib/tomo/testing/docker_image.rb +4 -17
- data/lib/tomo/testing/local.rb +1 -3
- data/lib/tomo/testing/mock_plugin_tester.rb +27 -4
- data/lib/tomo/testing/ubuntu_setup.sh +1 -2
- data/lib/tomo/version.rb +1 -1
- metadata +9 -151
- data/lib/tomo/testing/docker_plugin_tester.rb +0 -39
- data/lib/tomo/testing/plugin_tester.rb +0 -33
@@ -1,39 +0,0 @@
|
|
1
|
-
require "fileutils"
|
2
|
-
require "securerandom"
|
3
|
-
require "tmpdir"
|
4
|
-
|
5
|
-
module Tomo
|
6
|
-
module Testing
|
7
|
-
class DockerPluginTester < PluginTester
|
8
|
-
def initialize(*plugin_names, settings: {}, setup_script: nil)
|
9
|
-
@docker_image = DockerImage.new
|
10
|
-
@docker_image.setup_script = setup_script if setup_script
|
11
|
-
@docker_image.build_and_run
|
12
|
-
host = @docker_image.host
|
13
|
-
super(
|
14
|
-
*plugin_names,
|
15
|
-
settings: @docker_image.ssh_settings.merge(settings),
|
16
|
-
host: host
|
17
|
-
)
|
18
|
-
end
|
19
|
-
|
20
|
-
def run(shell_script, **kwargs)
|
21
|
-
call_helper(:run, shell_script, **kwargs)
|
22
|
-
end
|
23
|
-
|
24
|
-
def run_task(task, *args)
|
25
|
-
Testing.enabling_ssh do
|
26
|
-
super
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def teardown
|
31
|
-
docker_image.stop
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
attr_reader :docker_image
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Tomo
|
2
|
-
module Testing
|
3
|
-
class PluginTester
|
4
|
-
include LogCapturing
|
5
|
-
|
6
|
-
def initialize(*plugin_names, settings: {}, host:)
|
7
|
-
@host = host
|
8
|
-
config = Configuration.new
|
9
|
-
config.hosts << @host
|
10
|
-
config.plugins.push(*plugin_names, "testing")
|
11
|
-
config.settings[:application] = "testing"
|
12
|
-
config.settings.merge!(settings)
|
13
|
-
@runtime = config.build_runtime
|
14
|
-
end
|
15
|
-
|
16
|
-
def call_helper(helper, *args, **kwargs)
|
17
|
-
run_task("testing:call_helper", helper, args, kwargs)
|
18
|
-
host.helper_values.pop
|
19
|
-
end
|
20
|
-
|
21
|
-
def run_task(task, *args)
|
22
|
-
capturing_logger_output do
|
23
|
-
runtime.run!(task, *args, privileged: false)
|
24
|
-
nil
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
attr_reader :host, :runtime
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|