tomo 1.0.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -6
  3. data/lib/tomo/cli.rb +0 -2
  4. data/lib/tomo/cli/common_options.rb +4 -12
  5. data/lib/tomo/cli/deploy_options.rb +2 -7
  6. data/lib/tomo/cli/parser.rb +1 -6
  7. data/lib/tomo/cli/project_options.rb +1 -3
  8. data/lib/tomo/cli/rules.rb +4 -22
  9. data/lib/tomo/cli/rules/switch.rb +1 -5
  10. data/lib/tomo/cli/rules/value_switch.rb +1 -2
  11. data/lib/tomo/cli/rules_evaluator.rb +3 -13
  12. data/lib/tomo/cli/usage.rb +1 -3
  13. data/lib/tomo/commands/default.rb +1 -3
  14. data/lib/tomo/commands/init.rb +24 -1
  15. data/lib/tomo/commands/run.rb +1 -3
  16. data/lib/tomo/configuration.rb +5 -11
  17. data/lib/tomo/configuration/dsl/hosts_and_settings.rb +1 -2
  18. data/lib/tomo/configuration/plugin_resolver.rb +1 -1
  19. data/lib/tomo/configuration/plugins_registry.rb +1 -2
  20. data/lib/tomo/configuration/plugins_registry/gem_resolver.rb +1 -1
  21. data/lib/tomo/configuration/unknown_environment_error.rb +1 -4
  22. data/lib/tomo/console.rb +6 -11
  23. data/lib/tomo/console/menu.rb +1 -2
  24. data/lib/tomo/host.rb +1 -2
  25. data/lib/tomo/plugin/bundler/tasks.rb +2 -7
  26. data/lib/tomo/plugin/core/tasks.rb +3 -12
  27. data/lib/tomo/plugin/env/tasks.rb +32 -10
  28. data/lib/tomo/plugin/git.rb +1 -4
  29. data/lib/tomo/plugin/git/tasks.rb +4 -14
  30. data/lib/tomo/plugin/nodenv/tasks.rb +1 -3
  31. data/lib/tomo/plugin/puma.rb +0 -3
  32. data/lib/tomo/plugin/puma/systemd/service.erb +1 -1
  33. data/lib/tomo/plugin/puma/tasks.rb +6 -15
  34. data/lib/tomo/plugin/rails/helpers.rb +1 -1
  35. data/lib/tomo/plugin/rails/tasks.rb +6 -4
  36. data/lib/tomo/plugin/testing.rb +1 -3
  37. data/lib/tomo/remote.rb +1 -3
  38. data/lib/tomo/runtime.rb +3 -6
  39. data/lib/tomo/runtime/concurrent_ruby_thread_pool.rb +1 -4
  40. data/lib/tomo/runtime/execution_plan.rb +1 -4
  41. data/lib/tomo/runtime/explanation.rb +1 -7
  42. data/lib/tomo/runtime/settings_required_error.rb +1 -3
  43. data/lib/tomo/runtime/task_runner.rb +1 -5
  44. data/lib/tomo/runtime/unknown_task_error.rb +1 -4
  45. data/lib/tomo/script.rb +1 -5
  46. data/lib/tomo/shell_builder.rb +5 -10
  47. data/lib/tomo/ssh/child_process.rb +2 -7
  48. data/lib/tomo/ssh/connection.rb +3 -16
  49. data/lib/tomo/ssh/connection_validator.rb +1 -4
  50. data/lib/tomo/ssh/executable_error.rb +1 -2
  51. data/lib/tomo/ssh/options.rb +2 -5
  52. data/lib/tomo/task_api.rb +4 -15
  53. data/lib/tomo/templates/config.rb.erb +7 -1
  54. data/lib/tomo/testing.rb +0 -2
  55. data/lib/tomo/testing/Dockerfile +1 -3
  56. data/lib/tomo/testing/connection.rb +1 -6
  57. data/lib/tomo/testing/docker_image.rb +4 -17
  58. data/lib/tomo/testing/local.rb +1 -3
  59. data/lib/tomo/testing/mock_plugin_tester.rb +27 -4
  60. data/lib/tomo/testing/ubuntu_setup.sh +1 -2
  61. data/lib/tomo/version.rb +1 -1
  62. metadata +8 -150
  63. data/lib/tomo/testing/docker_plugin_tester.rb +0 -39
  64. 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