terraspace 0.4.2 → 0.5.2
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 +31 -0
- data/README.md +4 -3
- 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 +16 -1
- data/lib/terraspace/bundle.rb +6 -0
- data/lib/terraspace/cli.rb +1 -0
- data/lib/terraspace/cli/bundle.rb +0 -1
- data/lib/terraspace/cli/check_setup.rb +5 -0
- 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/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/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 +50 -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/runner.rb +5 -13
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6a2a88fa818f4181306424fffdba0416c2df409e464b632ea941e761b8ed275
|
4
|
+
data.tar.gz: eaf2ce61be5ff4b72f01e6f4ca9da7eb4ee573f42e5865319a90630659544c2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6b38903334e7855e19517ec79059dd9887d85aa44819ed811af0deedaae8fbed5d8502546e675302c786604a7c110313a27b312a5489cff26071a9c784e8bd0
|
7
|
+
data.tar.gz: f117135d46f25c238e89a459666ade7fe4ef944726abae05fe9af4e6101e42198d5f91d39e06f42bfbb20f987f172ac4b677d08e3bf66c84272c0746751fdcfe
|
data/.cody/aws/bin/build.sh
CHANGED
@@ -10,6 +10,6 @@ export PATH=~/bin:$PATH # ~/bin/terraspace wrapper
|
|
10
10
|
set -x
|
11
11
|
terraspace new project infra --examples
|
12
12
|
cd infra
|
13
|
-
terraspace new
|
14
|
-
|
13
|
+
terraspace new test demo --type stack
|
14
|
+
cd app/stacks/demo
|
15
15
|
terraspace test
|
data/.cody/azurerm/bin/build.sh
CHANGED
@@ -17,6 +17,6 @@ export ARM_TENANT_ID=$(cat ~/.azure/app-client.json | jq -r '.tenant_id')
|
|
17
17
|
set -x
|
18
18
|
terraspace new project infra --examples --plugin azurerm
|
19
19
|
cd infra
|
20
|
-
terraspace new
|
21
|
-
|
20
|
+
terraspace new test demo --type stack
|
21
|
+
cd app/stacks/demo
|
22
22
|
terraspace test
|
data/.cody/google/bin/build.sh
CHANGED
@@ -14,6 +14,6 @@ export GOOGLE_PROJECT=$(cat $GOOGLE_APPLICATION_CREDENTIALS | jq -r '.project_id
|
|
14
14
|
set -x
|
15
15
|
terraspace new project infra --examples --plugin google
|
16
16
|
cd infra
|
17
|
-
terraspace new
|
18
|
-
|
17
|
+
terraspace new test demo --type stack
|
18
|
+
cd app/stacks/demo
|
19
19
|
terraspace test
|
data/.github/ISSUE_TEMPLATE.md
CHANGED
@@ -2,6 +2,6 @@ Please fill out one of the templates on https://github.com/boltops-tools/terrasp
|
|
2
2
|
|
3
3
|
If you want to ask a question please do so on sites like StackOverflow.
|
4
4
|
|
5
|
-
To be sensitive to everyone's time, we may close issues asking questions without comment. Here are some additional options also https://terraspace.cloud/
|
5
|
+
To be sensitive to everyone's time, we may close issues asking questions without comment. Here are some additional options also https://terraspace.cloud/support/ 👌
|
6
6
|
|
7
7
|
Thank you!
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,37 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.5.2] - 2020-11-27
|
7
|
+
- [#59](https://github.com/boltops-tools/terraspace/pull/59) only run bundler/setup within terraspace project and check standalone install
|
8
|
+
- fix terraspace help
|
9
|
+
- fix terraspace setup check when terraform is not installed
|
10
|
+
|
11
|
+
## [0.5.1] - 2020-11-17
|
12
|
+
- [#56](https://github.com/boltops-tools/terraspace/pull/56) fix arg and hook generators
|
13
|
+
- fix ci build
|
14
|
+
|
15
|
+
## [0.5.0] - 2020-11-15
|
16
|
+
- [#55](https://github.com/boltops-tools/terraspace/pull/55) custom helpers support
|
17
|
+
- plugin helpers support: aws_secret, aws_ssm, google_secret, etc
|
18
|
+
- introduce stack-level test concept and change project-level test concept
|
19
|
+
- generators: standardize and unifiy new test
|
20
|
+
- new generators: arg, hook, helper
|
21
|
+
- clean up Terraspace check project
|
22
|
+
- setup up autoloader and bundler/setup earlier. removes need for shim
|
23
|
+
- test generator plugin autodetection
|
24
|
+
- remove internal run_generator_hook_script
|
25
|
+
- stack-level args customization support
|
26
|
+
- improve test output noise-level
|
27
|
+
- new setting: config.terraform.plugin_cache.purge_on_error
|
28
|
+
- quiet option for project generator
|
29
|
+
|
30
|
+
## [0.4.4]
|
31
|
+
- #50 retry logic for shared cache error
|
32
|
+
- #51 fix cloud sync: call build first
|
33
|
+
|
34
|
+
## [0.4.3]
|
35
|
+
* #49 add info --path option
|
36
|
+
|
6
37
|
## [0.4.2]
|
7
38
|
* #48 add logs pid option
|
8
39
|
* default to input false, encourage set tfvars
|
data/README.md
CHANGED
@@ -105,10 +105,11 @@ To install modules:
|
|
105
105
|
|
106
106
|
* [Config Structure](https://terraspace.cloud/docs/config/): A common config structure that gets materializes with the deployed module. Configs can be dynamically controlled to keep your code DRY. You can override the settings if needed, like for using existing backends. See: [Existing Backends](https://terraspace.cloud/docs/state/existing/).
|
107
107
|
* [Generators](https://terraspace.cloud/docs/generators/): Built-in generators to quickly create the starter module. Focus on code instead of boilerplate structure.
|
108
|
-
* [Tfvars](https://terraspace.cloud/docs/tfvars/) & [Layering](https://terraspace.cloud/docs/tfvars/layering/)
|
108
|
+
* [Multiple Environments](https://terraspace.cloud/docs/patterns/multiple-envs/): [Tfvars](https://terraspace.cloud/docs/tfvars/) & [Layering](https://terraspace.cloud/docs/tfvars/layering/) allow you to the same code with different tfvars to create multiple environments. Terraspace conventionally loads tfvars from the `tfvars` folder. Rich layering support allows you to build different environments like dev and prod with the same code. Examples are in [Full Layering](https://terraspace.cloud/docs/tfvars/full-layering/).
|
109
109
|
* [Deploy Multiple Stacks](https://terraspace.cloud/docs/intro/deploy-all/): The ability to deploy multiple stacks with a single command. Terraspace calculates the [dependency graph](https://terraspace.cloud/docs/dependencies/) and deploys stacks in the right order. You can also target specific stacks and deploy [subgraphs](https://terraspace.cloud/docs/dependencies/subgraphs/).
|
110
|
-
* [
|
111
|
-
* [
|
110
|
+
* [Secrets Support](https://terraspace.cloud/docs/helpers/aws/secrets/): Terraspace has built-in secrets support for [AWS Secrets Manager](https://terraspace.cloud/docs/helpers/aws/secrets/), [AWS SSM Parameter Store](https://terraspace.cloud/docs/helpers/aws/ssm/), [Azure Key Vault](https://terraspace.cloud/docs/helpers/azure/secrets/), [Google Secrets Manager](https://terraspace.cloud/docs/helpers/google/secrets/). Easily set variables from Cloud secrets providers.
|
111
|
+
* [Terrafile](https://terraspace.cloud/docs/terrafile/): Terraspace makes it easy to use Terraform modules sourced from your own git repositories, other git repositories, or the Terraform Registry. The git repos can be private or public. This is an incredibly powerful feature of Terraspace because it opens up a world of modules for you to use. Use any module you want.
|
112
|
+
* [Configurable CLI](https://terraspace.cloud/docs/config/args/): Configurable [CLI Hooks](https://terraspace.cloud/docs/config/hooks/) and [CLI Args](https://terraspace.cloud/docs/config/args/) allow you to adjust the underlying terraform command.
|
112
113
|
* [Testing](https://terraspace.cloud/docs/testing/): A testing framework that allows you to create test harnesses, deploy real-resources, and have higher confidence that your code works.
|
113
114
|
* [Terraform Cloud and Terraform Enterprise Support](https://terraspace.cloud/docs/cloud/): TFC and TFE are both supported. Terraspace adds additional conveniences to make working with Terraform Cloud Workspaces easier.
|
114
115
|
|
data/lib/terraspace.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
$stdout.sync = true unless ENV["TS_STDOUT_SYNC"] == "0"
|
2
2
|
|
3
3
|
$:.unshift(File.expand_path("../", __FILE__))
|
4
|
+
|
5
|
+
require "terraspace/autoloader"
|
6
|
+
Terraspace::Autoloader.setup
|
7
|
+
|
4
8
|
require "active_support/concern"
|
5
9
|
require "active_support/core_ext/class"
|
6
10
|
require "active_support/core_ext/hash"
|
@@ -18,16 +22,15 @@ require "set"
|
|
18
22
|
require "terraspace/ext"
|
19
23
|
require "terraspace/version"
|
20
24
|
|
21
|
-
require "terraspace/autoloader"
|
22
|
-
Terraspace::Autoloader.setup
|
23
|
-
|
24
25
|
DslEvaluator.backtrace_reject = "lib/terraspace"
|
25
26
|
|
26
27
|
module Terraspace
|
27
28
|
extend Core # for Terraspace.root
|
28
29
|
class Error < StandardError; end
|
29
|
-
|
30
|
+
|
30
31
|
class BucketNotFoundError < Error; end
|
32
|
+
class InitRequiredError < Error; end
|
33
|
+
class SharedCacheError < Error; end
|
31
34
|
end
|
32
35
|
|
33
36
|
Terraspace::Booter.boot
|
data/lib/terraspace/all/base.rb
CHANGED
data/lib/terraspace/app.rb
CHANGED
@@ -47,6 +47,7 @@ module Terraspace
|
|
47
47
|
config.terraform.plugin_cache = ActiveSupport::OrderedOptions.new
|
48
48
|
config.terraform.plugin_cache.dir = ENV['TF_PLUGIN_CACHE_DIR'] || "#{Terraspace.tmp_root}/plugin_cache"
|
49
49
|
config.terraform.plugin_cache.enabled = true
|
50
|
+
config.terraform.plugin_cache.purge_on_error = true
|
50
51
|
config.test_framework = "rspec"
|
51
52
|
config
|
52
53
|
end
|
@@ -3,6 +3,11 @@ Terraspace::Bundle.setup
|
|
3
3
|
require "zeitwerk"
|
4
4
|
|
5
5
|
module Terraspace
|
6
|
+
# These modules are namespaces for user-defined custom helpers
|
7
|
+
module Module; end
|
8
|
+
module Project; end
|
9
|
+
module Stack; end
|
10
|
+
|
6
11
|
class Autoloader
|
7
12
|
class Inflector < Zeitwerk::Inflector
|
8
13
|
def camelize(basename, _abspath)
|
@@ -16,10 +21,20 @@ module Terraspace
|
|
16
21
|
loader = Zeitwerk::Loader.new
|
17
22
|
loader.inflector = Inflector.new
|
18
23
|
loader.push_dir(File.dirname(__dir__)) # lib
|
24
|
+
loader.push_dir(project_helpers, namespace: Terraspace::Project) if File.exist?(project_helpers)
|
19
25
|
loader.log! if ENV["TS_AUTOLOAD_LOG"]
|
20
|
-
loader.ignore("#{__dir__}/
|
26
|
+
loader.ignore("#{__dir__}/ext.rb")
|
21
27
|
loader.setup
|
22
28
|
end
|
29
|
+
|
30
|
+
def project_helpers
|
31
|
+
"#{ts_root}/config/helpers"
|
32
|
+
end
|
33
|
+
|
34
|
+
# Duplicate definition because autoloader logic runs very early and doesnt have access to core methods yet
|
35
|
+
def ts_root
|
36
|
+
ENV['TS_ROOT'] || Dir.pwd
|
37
|
+
end
|
23
38
|
end
|
24
39
|
end
|
25
40
|
end
|
data/lib/terraspace/bundle.rb
CHANGED
@@ -8,6 +8,7 @@ module Terraspace
|
|
8
8
|
#
|
9
9
|
def setup
|
10
10
|
return unless gemfile?
|
11
|
+
return unless terraspace_project?
|
11
12
|
Kernel.require "bundler/setup"
|
12
13
|
Bundler.setup # Same as Bundler.setup(:default)
|
13
14
|
rescue LoadError => e
|
@@ -16,12 +17,17 @@ module Terraspace
|
|
16
17
|
|
17
18
|
def require
|
18
19
|
return unless gemfile?
|
20
|
+
return unless terraspace_project?
|
19
21
|
Kernel.require "bundler/setup"
|
20
22
|
Bundler.require(*bundler_groups)
|
21
23
|
rescue LoadError => e
|
22
24
|
handle_error(e)
|
23
25
|
end
|
24
26
|
|
27
|
+
def terraspace_project?
|
28
|
+
File.exist?("config/app.rb")
|
29
|
+
end
|
30
|
+
|
25
31
|
def handle_error(e)
|
26
32
|
puts e.message
|
27
33
|
return if e.message.include?("already activated")
|
data/lib/terraspace/cli.rb
CHANGED
@@ -39,6 +39,11 @@ class Terraspace::CLI
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def ok?
|
42
|
+
unless terraform_bin
|
43
|
+
puts "Terraform not installed. Unable to detect a terraform command. Please double check that terraform is installed."
|
44
|
+
exit 1
|
45
|
+
end
|
46
|
+
|
42
47
|
version = terraform_version_message.sub(/.*v/,'') # => 0.12.24
|
43
48
|
unless version.match(/\d+\.\d+\.\d+/) # just parse did not find the version number
|
44
49
|
puts "WARN: Unable to get the terraform version".color(:yellow)
|
data/lib/terraspace/cli/cloud.rb
CHANGED
@@ -16,6 +16,7 @@ class Terraspace::CLI
|
|
16
16
|
|
17
17
|
desc "destroy STACK", "Destroy workspace by specifying the stack"
|
18
18
|
long_desc Help.text("cloud:destroy")
|
19
|
+
yes_option.call
|
19
20
|
def destroy(mod)
|
20
21
|
Workspace.new(options.merge(mod: mod)).destroy
|
21
22
|
end
|
@@ -24,6 +25,7 @@ class Terraspace::CLI
|
|
24
25
|
long_desc Help.text("cloud:sync")
|
25
26
|
yes_option.call
|
26
27
|
def sync(*stacks)
|
28
|
+
Terraspace::CLI::Build::Placeholder.new(options).build
|
27
29
|
Syncer.new(options.merge(stacks: stacks, override_auto_sync: true)).run
|
28
30
|
end
|
29
31
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
## Examples
|
2
|
+
|
3
|
+
Project-level arg:
|
4
|
+
|
5
|
+
$ terraspace new arg --type project
|
6
|
+
create config/args
|
7
|
+
create config/args/terraform.rb
|
8
|
+
|
9
|
+
Stack-level arg:
|
10
|
+
|
11
|
+
$ terraspace new arg demo --type stack
|
12
|
+
create app/stacks/demo/config/args
|
13
|
+
create app/stacks/demo/config/args/terraform.rb
|
14
|
+
|
15
|
+
Module-level arg:
|
16
|
+
|
17
|
+
$ terraspace new arg example --type module
|
18
|
+
create app/modules/example/config/args
|
19
|
+
create app/modules/example/config/args/terraform.rb
|
@@ -0,0 +1,39 @@
|
|
1
|
+
## Project Examples
|
2
|
+
|
3
|
+
Conventionally name the helper custom.
|
4
|
+
|
5
|
+
$ terraspace new helper custom --type project
|
6
|
+
create config/helpers
|
7
|
+
create config/helpers/custom_helper.rb
|
8
|
+
|
9
|
+
## Stack Examples
|
10
|
+
|
11
|
+
Conventionally name the helper to be the same as the stack name.
|
12
|
+
|
13
|
+
$ terraspace new helper demo --type stack
|
14
|
+
create app/stacks/demo/config/helpers
|
15
|
+
create app/stacks/demo/config/helpers/demo_helper.rb
|
16
|
+
$
|
17
|
+
|
18
|
+
Explictly name helper method. IE: custom here.
|
19
|
+
|
20
|
+
$ terraspace new helper demo --type stack --name custom
|
21
|
+
create app/stacks/demo/config/helpers
|
22
|
+
create app/stacks/demo/config/helpers/custom_helper.rb
|
23
|
+
$
|
24
|
+
|
25
|
+
## Module Examples
|
26
|
+
|
27
|
+
Conventionally name the helper to be the same as the module name.
|
28
|
+
|
29
|
+
$ terraspace new helper example --type module
|
30
|
+
create app/module/example/config/helpers
|
31
|
+
create app/module/example/config/helpers/example_helper.rb
|
32
|
+
$
|
33
|
+
|
34
|
+
Explictly name helper method. IE: custom here.
|
35
|
+
|
36
|
+
$ terraspace new helper example --type module --name custom
|
37
|
+
create app/module/example/config/helpers
|
38
|
+
create app/module/example/config/helpers/custom_helper.rb
|
39
|
+
$
|
@@ -0,0 +1,25 @@
|
|
1
|
+
## Examples
|
2
|
+
|
3
|
+
Project-level hook:
|
4
|
+
|
5
|
+
$ terraspace new hook --type project
|
6
|
+
create config/hooks
|
7
|
+
create config/hooks/terraform.rb
|
8
|
+
|
9
|
+
Stack-level hook:
|
10
|
+
|
11
|
+
$ terraspace new hook demo --type stack
|
12
|
+
create app/stacks/demo/config/hooks
|
13
|
+
create app/stacks/demo/config/hooks/terraform.rb
|
14
|
+
|
15
|
+
Stack-level hook with kind option:
|
16
|
+
|
17
|
+
$ terraspace new hook demo --type stack --kind terraspace
|
18
|
+
exist app/stacks/demo/config/hooks
|
19
|
+
create app/stacks/demo/config/hooks/terraspace.rb
|
20
|
+
|
21
|
+
Module-level hook:
|
22
|
+
|
23
|
+
$ terraspace new hook example --type module
|
24
|
+
create app/modules/example/config/hooks
|
25
|
+
create app/modules/example/config/hooks/terraform.rb
|
@@ -0,0 +1,34 @@
|
|
1
|
+
## Stack Examples
|
2
|
+
|
3
|
+
$ terraspace new test demo --type stack
|
4
|
+
=> Creating stack test: example
|
5
|
+
exist app/stacks/example
|
6
|
+
create app/stacks/example/test/.rspec
|
7
|
+
create app/stacks/example/test/Gemfile
|
8
|
+
create app/stacks/example/test/spec/fixtures/stack/main.tf
|
9
|
+
create app/stacks/example/test/spec/fixtures/stack/outputs.tf
|
10
|
+
create app/stacks/example/test/spec/main_spec.rb
|
11
|
+
create app/stacks/example/test/spec/spec_helper.rb
|
12
|
+
$
|
13
|
+
|
14
|
+
## Module Examples
|
15
|
+
|
16
|
+
$ terraspace new test example --type module
|
17
|
+
=> Creating module test: example
|
18
|
+
exist app/modules/example
|
19
|
+
create app/modules/example/test/.rspec
|
20
|
+
create app/modules/example/test/Gemfile
|
21
|
+
create app/modules/example/test/spec/fixtures/stack/main.tf
|
22
|
+
create app/modules/example/test/spec/fixtures/stack/outputs.tf
|
23
|
+
create app/modules/example/test/spec/main_spec.rb
|
24
|
+
create app/modules/example/test/spec/spec_helper.rb
|
25
|
+
$
|
26
|
+
|
27
|
+
## Project Examples
|
28
|
+
|
29
|
+
$ terraspace new test my --type project
|
30
|
+
=> Creating test bootstrap structure
|
31
|
+
exist
|
32
|
+
create .rspec
|
33
|
+
create spec/spec_helper.rb
|
34
|
+
$
|
data/lib/terraspace/cli/info.rb
CHANGED
@@ -3,6 +3,14 @@ class Terraspace::CLI
|
|
3
3
|
extend Memoist
|
4
4
|
|
5
5
|
def run
|
6
|
+
if @options[:path]
|
7
|
+
show_path
|
8
|
+
else
|
9
|
+
show_all
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def show_all
|
6
14
|
presenter = CliFormat::Presenter.new(@options)
|
7
15
|
presenter.header = %w[Name Value]
|
8
16
|
info.each do |k,v|
|
@@ -11,6 +19,10 @@ class Terraspace::CLI
|
|
11
19
|
presenter.show
|
12
20
|
end
|
13
21
|
|
22
|
+
def show_path
|
23
|
+
puts info[:cache_dir]
|
24
|
+
end
|
25
|
+
|
14
26
|
def info
|
15
27
|
@mod.to_info
|
16
28
|
end
|