terraspace 0.4.1 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.cody/aws/bin/build.sh +2 -2
- data/.cody/azurerm/bin/build.sh +2 -2
- data/.cody/google/bin/build.sh +2 -2
- data/.github/ISSUE_TEMPLATE.md +1 -1
- data/CHANGELOG.md +30 -0
- data/README.md +59 -31
- data/lib/templates/base/arg/terraform.rb.tt +3 -0
- data/lib/templates/base/helper/%name%_helper.rb.tt +2 -0
- data/lib/templates/base/hook/%kind%.rb.tt +7 -0
- data/lib/terraspace.rb +7 -4
- data/lib/terraspace/all/base.rb +0 -1
- data/lib/terraspace/app.rb +1 -0
- data/lib/terraspace/autoloader.rb +20 -3
- data/lib/terraspace/cli.rb +2 -0
- data/lib/terraspace/cli/bundle.rb +0 -1
- data/lib/terraspace/cli/clean/base.rb +0 -1
- data/lib/terraspace/cli/clean/cache.rb +0 -1
- data/lib/terraspace/cli/cloud.rb +2 -0
- data/lib/terraspace/cli/help/logs.md +4 -4
- data/lib/terraspace/cli/help/new/arg.md +19 -0
- data/lib/terraspace/cli/help/new/helper.md +39 -0
- data/lib/terraspace/cli/help/new/hook.md +25 -0
- data/lib/terraspace/cli/help/new/test.md +34 -0
- data/lib/terraspace/cli/info.rb +12 -0
- data/lib/terraspace/cli/logs/concern.rb +1 -0
- data/lib/terraspace/cli/new.rb +22 -16
- data/lib/terraspace/cli/new/arg.rb +62 -0
- data/lib/terraspace/cli/new/helper.rb +44 -12
- data/lib/terraspace/cli/new/helpers.rb +22 -0
- data/lib/terraspace/cli/new/helpers/plugin_gem.rb +25 -0
- data/lib/terraspace/cli/new/hook.rb +70 -0
- data/lib/terraspace/cli/new/module.rb +0 -11
- data/lib/terraspace/cli/new/plugin.rb +4 -4
- data/lib/terraspace/cli/new/plugin/helper.rb +1 -1
- data/lib/terraspace/cli/new/project.rb +16 -7
- data/lib/terraspace/cli/new/sequence.rb +3 -10
- data/lib/terraspace/cli/new/source/core.rb +1 -1
- data/lib/terraspace/cli/new/stack.rb +1 -12
- data/lib/terraspace/cli/new/test.rb +50 -0
- data/lib/terraspace/cli/summary.rb +0 -1
- data/lib/terraspace/command.rb +16 -0
- data/lib/terraspace/compiler/builder.rb +2 -0
- data/lib/terraspace/compiler/dsl/mod.rb +2 -0
- data/lib/terraspace/compiler/dsl/syntax/mod.rb +2 -0
- data/lib/terraspace/compiler/dsl/syntax/mod/backend.rb +1 -1
- data/lib/terraspace/compiler/erb/context.rb +2 -0
- data/lib/terraspace/compiler/helper_extender.rb +27 -0
- data/lib/terraspace/core.rb +0 -6
- data/lib/terraspace/ext/core/module.rb +16 -0
- data/lib/terraspace/hooks/builder.rb +6 -7
- data/lib/terraspace/hooks/concern.rb +2 -2
- data/lib/terraspace/logger.rb +6 -0
- data/lib/terraspace/mod.rb +0 -1
- data/lib/terraspace/plugin.rb +8 -4
- data/lib/terraspace/plugin/config/interface.rb +2 -2
- data/lib/terraspace/plugin/helper/interface.rb +31 -0
- data/lib/terraspace/shell.rb +5 -33
- data/lib/terraspace/shell/error.rb +46 -0
- data/lib/terraspace/terraform/args/custom.rb +2 -3
- data/lib/terraspace/terraform/args/default.rb +9 -19
- data/lib/terraspace/terraform/runner.rb +6 -14
- data/lib/terraspace/terraform/runner/retryer.rb +69 -0
- data/lib/terraspace/version.rb +1 -1
- data/spec/terraspace/terraform/args/custom_spec.rb +6 -4
- data/terraspace.gemspec +4 -4
- metadata +29 -21
- data/lib/terraspace/cli/help/new/bootstrap_test.md +0 -8
- data/lib/terraspace/cli/help/new/module_test.md +0 -12
- data/lib/terraspace/cli/help/new/project_test.md +0 -8
- data/lib/terraspace/cli/new/helper/plugin_gem.rb +0 -12
- data/lib/terraspace/cli/new/test/base.rb +0 -17
- data/lib/terraspace/cli/new/test/bootstrap.rb +0 -18
- data/lib/terraspace/cli/new/test/module.rb +0 -15
- data/lib/terraspace/cli/new/test/project.rb +0 -15
@@ -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,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
|