terraspace 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/README.md +57 -30
  4. data/lib/templates/base/arg/terraform.rb.tt +3 -0
  5. data/lib/templates/base/helper/%name%_helper.rb.tt +2 -0
  6. data/lib/templates/base/hook/%kind%.rb.tt +7 -0
  7. data/lib/terraspace.rb +7 -4
  8. data/lib/terraspace/all/base.rb +0 -1
  9. data/lib/terraspace/app.rb +1 -0
  10. data/lib/terraspace/autoloader.rb +20 -3
  11. data/lib/terraspace/cli.rb +2 -0
  12. data/lib/terraspace/cli/all.rb +1 -1
  13. data/lib/terraspace/cli/bundle.rb +0 -1
  14. data/lib/terraspace/cli/clean/base.rb +0 -1
  15. data/lib/terraspace/cli/clean/cache.rb +0 -1
  16. data/lib/terraspace/cli/cloud.rb +2 -0
  17. data/lib/terraspace/cli/help/all/init.md +33 -0
  18. data/lib/terraspace/cli/help/logs.md +4 -4
  19. data/lib/terraspace/cli/help/new/arg.md +19 -0
  20. data/lib/terraspace/cli/help/new/helper.md +39 -0
  21. data/lib/terraspace/cli/help/new/hook.md +25 -0
  22. data/lib/terraspace/cli/help/new/test.md +34 -0
  23. data/lib/terraspace/cli/info.rb +12 -0
  24. data/lib/terraspace/cli/list.rb +2 -1
  25. data/lib/terraspace/cli/logs/concern.rb +1 -0
  26. data/lib/terraspace/cli/new.rb +22 -16
  27. data/lib/terraspace/cli/new/arg.rb +62 -0
  28. data/lib/terraspace/cli/new/helper.rb +44 -12
  29. data/lib/terraspace/cli/new/helpers.rb +22 -0
  30. data/lib/terraspace/cli/new/helpers/plugin_gem.rb +25 -0
  31. data/lib/terraspace/cli/new/hook.rb +70 -0
  32. data/lib/terraspace/cli/new/module.rb +0 -11
  33. data/lib/terraspace/cli/new/plugin.rb +4 -4
  34. data/lib/terraspace/cli/new/plugin/helper.rb +1 -1
  35. data/lib/terraspace/cli/new/project.rb +16 -7
  36. data/lib/terraspace/cli/new/sequence.rb +3 -10
  37. data/lib/terraspace/cli/new/source/core.rb +1 -1
  38. data/lib/terraspace/cli/new/stack.rb +1 -12
  39. data/lib/terraspace/cli/new/test.rb +50 -0
  40. data/lib/terraspace/cli/summary.rb +0 -1
  41. data/lib/terraspace/command.rb +16 -0
  42. data/lib/terraspace/compiler/builder.rb +2 -0
  43. data/lib/terraspace/compiler/dsl/mod.rb +2 -0
  44. data/lib/terraspace/compiler/dsl/syntax/mod.rb +2 -0
  45. data/lib/terraspace/compiler/dsl/syntax/mod/backend.rb +1 -1
  46. data/lib/terraspace/compiler/erb/context.rb +2 -0
  47. data/lib/terraspace/compiler/helper_extender.rb +27 -0
  48. data/lib/terraspace/core.rb +0 -6
  49. data/lib/terraspace/ext/core/module.rb +16 -0
  50. data/lib/terraspace/hooks/builder.rb +6 -7
  51. data/lib/terraspace/hooks/concern.rb +2 -2
  52. data/lib/terraspace/logger.rb +6 -0
  53. data/lib/terraspace/mod.rb +0 -1
  54. data/lib/terraspace/plugin.rb +8 -4
  55. data/lib/terraspace/plugin/config/interface.rb +2 -2
  56. data/lib/terraspace/plugin/helper/interface.rb +31 -0
  57. data/lib/terraspace/shell.rb +5 -33
  58. data/lib/terraspace/shell/error.rb +46 -0
  59. data/lib/terraspace/terraform/args/custom.rb +2 -3
  60. data/lib/terraspace/terraform/args/default.rb +9 -19
  61. data/lib/terraspace/terraform/runner.rb +6 -14
  62. data/lib/terraspace/terraform/runner/retryer.rb +69 -0
  63. data/lib/terraspace/version.rb +1 -1
  64. data/spec/terraspace/terraform/args/custom_spec.rb +6 -4
  65. data/terraspace.gemspec +4 -4
  66. metadata +30 -21
  67. data/lib/terraspace/cli/help/new/bootstrap_test.md +0 -8
  68. data/lib/terraspace/cli/help/new/module_test.md +0 -12
  69. data/lib/terraspace/cli/help/new/project_test.md +0 -8
  70. data/lib/terraspace/cli/new/helper/plugin_gem.rb +0 -12
  71. data/lib/terraspace/cli/new/test/base.rb +0 -17
  72. data/lib/terraspace/cli/new/test/bootstrap.rb +0 -18
  73. data/lib/terraspace/cli/new/test/module.rb +0 -15
  74. data/lib/terraspace/cli/new/test/project.rb +0 -15
@@ -1,8 +0,0 @@
1
- ## Example
2
-
3
- $ terraspace new bootstrap_test
4
- => Creating test bootstrap structure
5
- exist
6
- create .rspec
7
- create spec/spec_helper.rb
8
- $
@@ -1,12 +0,0 @@
1
- ## Example
2
-
3
- $ terraspace new module_test example
4
- => Creating module test: example
5
- exist app/modules/example
6
- create app/modules/example/test/.rspec
7
- create app/modules/example/test/Gemfile
8
- create app/modules/example/test/spec/fixtures/stack/main.tf
9
- create app/modules/example/test/spec/fixtures/stack/outputs.tf
10
- create app/modules/example/test/spec/main_spec.rb
11
- create app/modules/example/test/spec/spec_helper.rb
12
- $
@@ -1,8 +0,0 @@
1
- ## Example
2
-
3
- $ terraspace new project_test demo
4
- => Creating project test: demo
5
- exist
6
- create spec/fixtures/tfvars/demo.tfvars
7
- create spec/stacks/demo/main_spec.rb
8
- $
@@ -1,12 +0,0 @@
1
- module Terraspace::CLI::New::Helper
2
- module PluginGem
3
- private
4
- def plugin_gem_name
5
- if @options[:plugin_gem]
6
- @options[:plugin_gem]
7
- else
8
- "terraspace_plugin_#{@options[:plugin]}"
9
- end
10
- end
11
- end
12
- end
@@ -1,17 +0,0 @@
1
- module Terraspace::CLI::New::Test
2
- class Base < Thor::Group
3
- include Thor::Actions
4
- include Terraspace::CLI::New::Helper
5
-
6
- # Reuse options form Sequence. Tried separting them out and it's not worth it.
7
- # It introduced too much duplication.
8
- Terraspace::CLI::New::Sequence.base_options.each { |args| class_option(*args) }
9
- Terraspace::CLI::New::Sequence.component_options.each { |args| class_option(*args) }
10
-
11
- private
12
- def test_template_source(template, type)
13
- source = Terraspace::CLI::New::Source::Test.new(self, @options)
14
- source.set_source_paths(template, type)
15
- end
16
- end
17
- end
@@ -1,18 +0,0 @@
1
- module Terraspace::CLI::New::Test
2
- class Bootstrap < Base
3
- def self.options
4
- [
5
- [:dir, default: ".", desc: "directory to write to"],
6
- ]
7
- end
8
-
9
- options.each { |args| class_option(*args) }
10
-
11
- def create
12
- return if @options[:test] == false
13
- puts "=> Creating test bootstrap structure"
14
- test_template_source(@options[:lang], "bootstrap")
15
- directory ".", options[:dir]
16
- end
17
- end
18
- end
@@ -1,15 +0,0 @@
1
- module Terraspace::CLI::New::Test
2
- class Module < Base
3
- argument :name
4
-
5
- def create
6
- return if @options[:test] == false
7
- test_template_source(@options[:lang], "module")
8
-
9
- puts "=> Creating module test: #{name}"
10
- dest = "app/modules/#{name}"
11
- dest = "#{@options[:project_name]}/#{dest}" if @options[:project_name]
12
- directory ".", dest
13
- end
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- module Terraspace::CLI::New::Test
2
- class Project < Base
3
- argument :name
4
-
5
- def create
6
- return if @options[:test] == false
7
- test_template_source(@options[:lang], "project")
8
-
9
- puts "=> Creating project test: #{name}"
10
- dest = "."
11
- dest = "#{@options[:project_name]}/#{dest}" if @options[:project_name]
12
- directory ".", dest
13
- end
14
- end
15
- end