terraspace 0.4.1 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.cody/aws/bin/build.sh +2 -2
  3. data/.cody/azurerm/bin/build.sh +2 -2
  4. data/.cody/google/bin/build.sh +2 -2
  5. data/.github/ISSUE_TEMPLATE.md +1 -1
  6. data/CHANGELOG.md +30 -0
  7. data/README.md +59 -31
  8. data/lib/templates/base/arg/terraform.rb.tt +3 -0
  9. data/lib/templates/base/helper/%name%_helper.rb.tt +2 -0
  10. data/lib/templates/base/hook/%kind%.rb.tt +7 -0
  11. data/lib/terraspace.rb +7 -4
  12. data/lib/terraspace/all/base.rb +0 -1
  13. data/lib/terraspace/app.rb +1 -0
  14. data/lib/terraspace/autoloader.rb +20 -3
  15. data/lib/terraspace/cli.rb +2 -0
  16. data/lib/terraspace/cli/bundle.rb +0 -1
  17. data/lib/terraspace/cli/clean/base.rb +0 -1
  18. data/lib/terraspace/cli/clean/cache.rb +0 -1
  19. data/lib/terraspace/cli/cloud.rb +2 -0
  20. data/lib/terraspace/cli/help/logs.md +4 -4
  21. data/lib/terraspace/cli/help/new/arg.md +19 -0
  22. data/lib/terraspace/cli/help/new/helper.md +39 -0
  23. data/lib/terraspace/cli/help/new/hook.md +25 -0
  24. data/lib/terraspace/cli/help/new/test.md +34 -0
  25. data/lib/terraspace/cli/info.rb +12 -0
  26. data/lib/terraspace/cli/logs/concern.rb +1 -0
  27. data/lib/terraspace/cli/new.rb +22 -16
  28. data/lib/terraspace/cli/new/arg.rb +62 -0
  29. data/lib/terraspace/cli/new/helper.rb +44 -12
  30. data/lib/terraspace/cli/new/helpers.rb +22 -0
  31. data/lib/terraspace/cli/new/helpers/plugin_gem.rb +25 -0
  32. data/lib/terraspace/cli/new/hook.rb +70 -0
  33. data/lib/terraspace/cli/new/module.rb +0 -11
  34. data/lib/terraspace/cli/new/plugin.rb +4 -4
  35. data/lib/terraspace/cli/new/plugin/helper.rb +1 -1
  36. data/lib/terraspace/cli/new/project.rb +16 -7
  37. data/lib/terraspace/cli/new/sequence.rb +3 -10
  38. data/lib/terraspace/cli/new/source/core.rb +1 -1
  39. data/lib/terraspace/cli/new/stack.rb +1 -12
  40. data/lib/terraspace/cli/new/test.rb +50 -0
  41. data/lib/terraspace/cli/summary.rb +0 -1
  42. data/lib/terraspace/command.rb +16 -0
  43. data/lib/terraspace/compiler/builder.rb +2 -0
  44. data/lib/terraspace/compiler/dsl/mod.rb +2 -0
  45. data/lib/terraspace/compiler/dsl/syntax/mod.rb +2 -0
  46. data/lib/terraspace/compiler/dsl/syntax/mod/backend.rb +1 -1
  47. data/lib/terraspace/compiler/erb/context.rb +2 -0
  48. data/lib/terraspace/compiler/helper_extender.rb +27 -0
  49. data/lib/terraspace/core.rb +0 -6
  50. data/lib/terraspace/ext/core/module.rb +16 -0
  51. data/lib/terraspace/hooks/builder.rb +6 -7
  52. data/lib/terraspace/hooks/concern.rb +2 -2
  53. data/lib/terraspace/logger.rb +6 -0
  54. data/lib/terraspace/mod.rb +0 -1
  55. data/lib/terraspace/plugin.rb +8 -4
  56. data/lib/terraspace/plugin/config/interface.rb +2 -2
  57. data/lib/terraspace/plugin/helper/interface.rb +31 -0
  58. data/lib/terraspace/shell.rb +5 -33
  59. data/lib/terraspace/shell/error.rb +46 -0
  60. data/lib/terraspace/terraform/args/custom.rb +2 -3
  61. data/lib/terraspace/terraform/args/default.rb +9 -19
  62. data/lib/terraspace/terraform/runner.rb +6 -14
  63. data/lib/terraspace/terraform/runner/retryer.rb +69 -0
  64. data/lib/terraspace/version.rb +1 -1
  65. data/spec/terraspace/terraform/args/custom_spec.rb +6 -4
  66. data/terraspace.gemspec +4 -4
  67. metadata +29 -21
  68. data/lib/terraspace/cli/help/new/bootstrap_test.md +0 -8
  69. data/lib/terraspace/cli/help/new/module_test.md +0 -12
  70. data/lib/terraspace/cli/help/new/project_test.md +0 -8
  71. data/lib/terraspace/cli/new/helper/plugin_gem.rb +0 -12
  72. data/lib/terraspace/cli/new/test/base.rb +0 -17
  73. data/lib/terraspace/cli/new/test/bootstrap.rb +0 -18
  74. data/lib/terraspace/cli/new/test/module.rb +0 -15
  75. 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