terraspace 0.5.8 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +2 -2
- data/.github/ISSUE_TEMPLATE/bug_report.md +4 -3
- data/.github/ISSUE_TEMPLATE/question.md +2 -2
- data/CHANGELOG.md +32 -7
- data/README.md +2 -0
- data/lib/terraspace.rb +1 -0
- data/lib/terraspace/all/grapher.rb +21 -4
- data/lib/terraspace/app.rb +36 -14
- data/lib/terraspace/app/inits.rb +13 -0
- data/lib/terraspace/booter.rb +1 -0
- data/lib/terraspace/cli.rb +13 -6
- data/lib/terraspace/cli/build/placeholder.rb +6 -1
- data/lib/terraspace/cli/commander.rb +1 -1
- data/lib/terraspace/cli/down.rb +1 -1
- data/lib/terraspace/cli/help/{cloud → tfc}/destroy.md +1 -1
- data/lib/terraspace/cli/help/{cloud → tfc}/list.md +1 -1
- data/lib/terraspace/cli/help/{cloud → tfc}/runs/list.md +3 -3
- data/lib/terraspace/cli/help/{cloud → tfc}/runs/prune.md +3 -3
- data/lib/terraspace/cli/help/{cloud → tfc}/sync.md +3 -3
- data/lib/terraspace/cli/init.rb +21 -8
- data/lib/terraspace/cli/state.rb +10 -0
- data/lib/terraspace/cli/{cloud.rb → tfc.rb} +3 -3
- data/lib/terraspace/cli/{cloud → tfc}/runs.rb +4 -4
- data/lib/terraspace/cli/up.rb +5 -3
- data/lib/terraspace/compiler/builder.rb +2 -0
- data/lib/terraspace/compiler/dirs_concern.rb +11 -1
- data/lib/terraspace/compiler/select.rb +28 -0
- data/lib/terraspace/compiler/strategy/tfvar.rb +16 -4
- data/lib/terraspace/compiler/strategy/tfvar/layer.rb +75 -52
- data/lib/terraspace/layering.rb +24 -0
- data/lib/terraspace/logger.rb +8 -1
- data/lib/terraspace/mod.rb +18 -3
- data/lib/terraspace/plugin/expander/friendly.rb +10 -0
- data/lib/terraspace/plugin/expander/interface.rb +6 -1
- data/lib/terraspace/plugin/summary/interface.rb +1 -1
- data/lib/terraspace/shell.rb +16 -1
- data/lib/terraspace/shell/error.rb +1 -1
- data/lib/terraspace/terraform/api/runs.rb +13 -2
- data/lib/terraspace/terraform/api/token.rb +2 -2
- data/lib/terraspace/terraform/api/var.rb +1 -1
- data/lib/terraspace/terraform/api/vars.rb +1 -1
- data/lib/terraspace/terraform/api/vars/base.rb +2 -0
- data/lib/terraspace/terraform/api/vars/json.rb +13 -1
- data/lib/terraspace/terraform/api/workspace.rb +10 -3
- data/lib/terraspace/terraform/args/default.rb +23 -13
- data/lib/terraspace/terraform/ihooks/after/plan.rb +17 -0
- data/lib/terraspace/terraform/ihooks/base.rb +8 -0
- data/lib/terraspace/terraform/ihooks/before/plan.rb +14 -0
- data/lib/terraspace/terraform/remote_state/fetcher.rb +1 -1
- data/lib/terraspace/terraform/runner.rb +12 -0
- data/lib/terraspace/terraform/{cloud → tfc}/runs.rb +1 -1
- data/lib/terraspace/terraform/{cloud → tfc}/runs/base.rb +1 -1
- data/lib/terraspace/terraform/{cloud → tfc}/runs/item_presenter.rb +1 -1
- data/lib/terraspace/terraform/{cloud → tfc}/runs/lister.rb +1 -1
- data/lib/terraspace/terraform/{cloud → tfc}/runs/pruner.rb +1 -1
- data/lib/terraspace/terraform/{cloud → tfc}/sync.rb +2 -2
- data/lib/terraspace/terraform/{cloud → tfc}/syncer.rb +1 -1
- data/lib/terraspace/terraform/{cloud → tfc}/workspace.rb +2 -3
- data/lib/terraspace/util/pretty.rb +2 -1
- data/lib/terraspace/version.rb +1 -1
- metadata +26 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e6515cd30855a02e17147354db57995da471812f6437611140f715726268bb6
|
4
|
+
data.tar.gz: 33a4066b1a30d091fe7881bbafccc0778f47715d6bea7671ba9f011e1f3702a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b3b7c108ac28b8cf83c4cde07ed64f4fc84d8109bc77c5b1ddaa3018e70393e9cb57cbc7fc65315e7877e55833bd434695753ed8cb71b31bb249a440c96c910
|
7
|
+
data.tar.gz: 3b85a43ae356e6c95def1ab614ef86af19e3c875752d265a5de55ada4f66b12830d514d2655841f973690b449d8fc38f610ac6b146ba943e3d37d72694e86d79
|
data/.github/ISSUE_TEMPLATE.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Please fill out one of the templates on https://github.com/boltops-tools/terraspace/issues/new/choose
|
2
2
|
|
3
|
-
If you want to ask a question please do so
|
3
|
+
If you want to ask a question please do so in the Terraspace category in the BoltOps Community forum: https://community.boltops.com
|
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/support/ 👌
|
5
|
+
To be sensitive to everyone's time, we may close issues asking questions without comment. Posting your questions in the Terraspace community forum is the best place. It also benefits others by making the questions easier to find. Here are some additional options also https://terraspace.cloud/support/ 👌
|
6
6
|
|
7
7
|
Thank you!
|
@@ -15,7 +15,8 @@ issue may be closed without comment. If you repeatedly fail to provide enough
|
|
15
15
|
details, you may be blocked from ever submitting issues to Terraspace again.
|
16
16
|
Please use your best judgment. 👍
|
17
17
|
|
18
|
-
If you are unsure this is a bug in Terraspace, please consider asking your question at
|
18
|
+
If you are unsure this is a bug in Terraspace, please consider asking your question at:
|
19
|
+
https://community.boltops.com
|
19
20
|
|
20
21
|
Thanks!
|
21
22
|
-->
|
@@ -26,8 +27,8 @@ Thanks!
|
|
26
27
|
Make sure that you've done all of these. To mark a checkbox done, replace [ ] with [x]. Or after you create the issue you can click the checkbox.
|
27
28
|
-->
|
28
29
|
|
29
|
-
- [ ] Upgrade Terraspace: Are you using the latest version of Terraspace? This allows Terraspace to fix issues fast.
|
30
|
-
- [ ] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on
|
30
|
+
- [ ] Upgrade Terraspace: Are you using the latest version of Terraspace? This allows Terraspace to fix issues fast. There's an Upgrading Guide: https://terraspace.cloud/docs/misc/upgrading/
|
31
|
+
- [ ] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.boltops.com
|
31
32
|
- [ ] Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.
|
32
33
|
|
33
34
|
## My Environment
|
@@ -7,8 +7,8 @@ assignees: ''
|
|
7
7
|
|
8
8
|
---
|
9
9
|
|
10
|
-
The Terraspace issue tracker IS NOT for usage questions! Please post your question
|
10
|
+
The Terraspace issue tracker IS NOT for usage questions! Please post your question on our dedicated forum at https://community.boltops.com
|
11
11
|
|
12
12
|
To be sensitive to everyone's time, we may close issues asking questions without comment. If you repeatedly post questions in the issues tracker, you may be blocked from ever submitting issues to Terraspace again. Please use your best judgment. 👍
|
13
13
|
|
14
|
-
Here are some additional options also https://terraspace.cloud/support/ 😁
|
14
|
+
Posting your questions in the Terraspace community forum benefits others by grouping questions in a dedicated place. Here are some additional options also https://terraspace.cloud/support/ 😁
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,31 @@
|
|
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.6.0] - 2021-03-03
|
7
|
+
- Update README.md
|
8
|
+
- [#87](https://github.com/boltops-tools/terraspace/pull/87) rename cloud to tfc command and improvements
|
9
|
+
- [#88](https://github.com/boltops-tools/terraspace/pull/88) custom layering support
|
10
|
+
- Rename `terraspace cloud` to `terraspace tfc` and tfc improvements
|
11
|
+
- Improve stdout handling, so this works: `terraspace show demo --json | jq`
|
12
|
+
- `terraspace plan --output plan.save` writes to relative cache path.
|
13
|
+
- `terraspace up --plan plan.save` copies plan.save to cache path.
|
14
|
+
- Add state command. Initial simple version.
|
15
|
+
|
16
|
+
## [0.5.12] - 2021-02-27
|
17
|
+
- [#79](https://github.com/boltops-tools/terraspace/pull/79) Fix syntax issue
|
18
|
+
- [#85](https://github.com/boltops-tools/terraspace/pull/85) Add all.include_stacks option and fix all.ignore_stacks option when building dependency graph
|
19
|
+
|
20
|
+
## [0.5.11] - 2021-02-11
|
21
|
+
- [#76](https://github.com/boltops-tools/terraspace/pull/76) dont use auto generated plan when both yes and plan options used
|
22
|
+
- fix plan path when 2 stacks of same name run at the same time
|
23
|
+
|
24
|
+
## [0.5.10] - 2020-12-11
|
25
|
+
- [#69](https://github.com/boltops-tools/terraspace/pull/69) require singleton earlier
|
26
|
+
|
27
|
+
## [0.5.9] - 2020-12-11
|
28
|
+
- [#68](https://github.com/boltops-tools/terraspace/pull/68) require singleton
|
29
|
+
- fix graphviz check for format text, improve graphviz install help message
|
30
|
+
|
6
31
|
## [0.5.8] - 2020-12-04
|
7
32
|
- [#67](https://github.com/boltops-tools/terraspace/pull/67) fix find placeholder stack so config/terraform only builds for stacks
|
8
33
|
|
@@ -93,7 +118,7 @@ This project *loosely tries* to adhere to [Semantic Versioning](http://semver.or
|
|
93
118
|
* fix build for edge case when app/modules exist but app/stacks do not
|
94
119
|
* terraspace new project: do not generate spec folder by default
|
95
120
|
* improve all output summary
|
96
|
-
* remove redundant `terraspace
|
121
|
+
* remove redundant `terraspace tfc setup`, instead use: `terraspace tfc sync`
|
97
122
|
* improve terraspace info output
|
98
123
|
* fix integration test pipeline
|
99
124
|
|
@@ -112,8 +137,8 @@ This project *loosely tries* to adhere to [Semantic Versioning](http://semver.or
|
|
112
137
|
* Terraspace log: view and tail log files
|
113
138
|
* Terraspace logs management commands: `terraspace logs truncate` and `terraspace logs remove`
|
114
139
|
* TFC/TFE: Improve support. `config.cloud.vars`, `config.cloud.workspace.attrs`
|
115
|
-
* TFC commands: terraspace
|
116
|
-
* TFC VCS also sync as part of deploy. Also separate `terraspace
|
140
|
+
* TFC commands: terraspace tfc runs list, terraspace tfc runs prune
|
141
|
+
* TFC VCS also sync as part of deploy. Also separate `terraspace tfc sync` command
|
117
142
|
* Logger improvements: configurable formatter, log to stderr by default
|
118
143
|
* Rename: `cloud.relative_root` to `cloud.working_dir_prefix`
|
119
144
|
* Run a plan to capture the diff as part of `-y` option. IE: `terraspace up demo -y`
|
@@ -146,11 +171,11 @@ This project *loosely tries* to adhere to [Semantic Versioning](http://semver.or
|
|
146
171
|
* New expander variables: TYPE_INSTANCE, INSTANCE, CACHE_ROOT. Also added strip trailing - and / behavior.
|
147
172
|
* Timeout for terraform init. The default timeout is 10m and will then print out the terraform init log.
|
148
173
|
* Terraspace 0.2.x is compatible with terraspace\_plugin_aws 0.2.x, terraspace\_plugin_google 0.2.x, and terraspace\_plugin_azurerm 0.2.x
|
149
|
-
* New commands: terraspace list, terraspace
|
174
|
+
* New commands: terraspace list, terraspace tfc list, terraspace tfc setup, terraspace tfc destroy, terraspace new shim, terraspace new git_hook
|
150
175
|
* terraspace list: list of modules and stacks
|
151
|
-
* terraspace
|
152
|
-
* terraspace
|
153
|
-
* terraspace
|
176
|
+
* terraspace tfc list: shows list of TFC workspaces
|
177
|
+
* terraspace tfc setup: setups up TFC workspace for VCS-driven workflow. This automatically happens for the TFC CLI-driven workflow.
|
178
|
+
* terraspace tfc destroy: destroys the TFC workspace associated with the stack. Can also use the `terraspace down demo --destroy-workspace` option.
|
154
179
|
* terraspace new shim: An quick way to generate a terraspace shim.
|
155
180
|
* terraspace new git_hook: An quick way to set up a git pre-push hook for the TFC VCS-driven workflow.
|
156
181
|
* terraspace down: works even if there's no app/stacks folder. A fake stack is built.
|
data/README.md
CHANGED
data/lib/terraspace.rb
CHANGED
@@ -109,13 +109,12 @@ module Terraspace::All
|
|
109
109
|
|
110
110
|
# Check if Graphiz is installed and prints a user friendly message if it is not installed.
|
111
111
|
def check_graphviz!
|
112
|
+
return if @options[:format] == 'text'
|
113
|
+
|
112
114
|
installed = system("type dot > /dev/null 2>&1") # dot is a command that is part of the graphviz package
|
113
115
|
return if installed
|
114
116
|
logger.error "ERROR: It appears that the Graphviz is not installed. Please install it to use the graph command.".color(:red)
|
115
|
-
|
116
|
-
logger.error "You can install Graphviz with homebrew:"
|
117
|
-
logger.error " brew install graphviz"
|
118
|
-
end
|
117
|
+
install_instructions
|
119
118
|
logger.info <<~EOL
|
120
119
|
Also consider:
|
121
120
|
|
@@ -125,5 +124,23 @@ module Terraspace::All
|
|
125
124
|
EOL
|
126
125
|
exit 1
|
127
126
|
end
|
127
|
+
|
128
|
+
def install_instructions
|
129
|
+
installer = if RUBY_PLATFORM =~ /darwin/
|
130
|
+
"brew"
|
131
|
+
elsif system("type yum > /dev/null 2>&1")
|
132
|
+
"yum"
|
133
|
+
elsif system("type apt-get > /dev/null 2>&1")
|
134
|
+
"apt-get"
|
135
|
+
end
|
136
|
+
|
137
|
+
return unless installer
|
138
|
+
logger.error <<~EOL
|
139
|
+
You can install Graphviz with:
|
140
|
+
|
141
|
+
#{installer} install graphviz
|
142
|
+
|
143
|
+
EOL
|
144
|
+
end
|
128
145
|
end
|
129
146
|
end
|
data/lib/terraspace/app.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
module Terraspace
|
2
2
|
class App
|
3
|
-
|
3
|
+
extend Memoist
|
4
4
|
include DslEvaluator
|
5
|
+
include Singleton
|
6
|
+
include Terraspace::Util::Logging
|
5
7
|
|
6
8
|
attr_reader :config
|
7
9
|
def initialize
|
@@ -9,15 +11,14 @@ module Terraspace
|
|
9
11
|
end
|
10
12
|
|
11
13
|
def defaults
|
12
|
-
ts_logger = Logger.new(ENV['TS_LOG_PATH'] || $stderr)
|
13
|
-
|
14
14
|
config = ActiveSupport::OrderedOptions.new
|
15
15
|
config.all = ActiveSupport::OrderedOptions.new
|
16
16
|
config.all.concurrency = 5
|
17
17
|
config.all.exit_on_fail = ActiveSupport::OrderedOptions.new
|
18
18
|
config.all.exit_on_fail.down = true
|
19
19
|
config.all.exit_on_fail.up = true
|
20
|
-
config.all.ignore_stacks =
|
20
|
+
config.all.ignore_stacks = nil
|
21
|
+
config.all.include_stacks = nil
|
21
22
|
config.allow = ActiveSupport::OrderedOptions.new
|
22
23
|
config.allow.envs = nil
|
23
24
|
config.allow.regions = nil
|
@@ -28,16 +29,6 @@ module Terraspace
|
|
28
29
|
config.build.clean_cache = nil # defaults to /full/path/to/.terraspace-cache
|
29
30
|
config.bundle = ActiveSupport::OrderedOptions.new
|
30
31
|
config.bundle.logger = ts_logger
|
31
|
-
config.cloud = ActiveSupport::OrderedOptions.new
|
32
|
-
config.cloud.auto_sync = true
|
33
|
-
config.cloud.hostname = nil
|
34
|
-
config.cloud.vars = ActiveSupport::OrderedOptions.new
|
35
|
-
config.cloud.vars.overwrite = true
|
36
|
-
config.cloud.vars.overwrite_sensitive = true
|
37
|
-
config.cloud.vars.show_message = "create"
|
38
|
-
config.cloud.working_dir_prefix = nil
|
39
|
-
config.cloud.workspace = ActiveSupport::OrderedOptions.new
|
40
|
-
config.cloud.workspace.attrs = ActiveSupport::OrderedOptions.new
|
41
32
|
config.hooks = Hooks.new
|
42
33
|
config.init = ActiveSupport::OrderedOptions.new
|
43
34
|
config.init.mode = "auto" # auto, never, always
|
@@ -46,22 +37,53 @@ module Terraspace
|
|
46
37
|
config.logger = ts_logger
|
47
38
|
config.logger.formatter = Logger::Formatter.new
|
48
39
|
config.logger.level = ENV['TS_LOG_LEVEL'] || :info
|
40
|
+
config.layering = ActiveSupport::OrderedOptions.new
|
41
|
+
config.layering.names = {}
|
42
|
+
config.layering.enable_names = ActiveSupport::OrderedOptions.new
|
43
|
+
config.layering.enable_names.cache_dir = true
|
44
|
+
config.summary = ActiveSupport::OrderedOptions.new
|
45
|
+
config.summary.prune = false
|
49
46
|
config.terraform = ActiveSupport::OrderedOptions.new
|
50
47
|
config.terraform.plugin_cache = ActiveSupport::OrderedOptions.new
|
51
48
|
config.terraform.plugin_cache.dir = ENV['TF_PLUGIN_CACHE_DIR'] || "#{Terraspace.tmp_root}/plugin_cache"
|
52
49
|
config.terraform.plugin_cache.enabled = true
|
53
50
|
config.terraform.plugin_cache.purge_on_error = true
|
54
51
|
config.test_framework = "rspec"
|
52
|
+
config.tfc = ActiveSupport::OrderedOptions.new
|
53
|
+
config.tfc.auto_sync = true
|
54
|
+
config.tfc.hostname = nil
|
55
|
+
config.tfc.vars = ActiveSupport::OrderedOptions.new
|
56
|
+
config.tfc.vars.overwrite = true
|
57
|
+
config.tfc.vars.overwrite_sensitive = true
|
58
|
+
config.tfc.vars.show_message = "create"
|
59
|
+
config.tfc.working_dir_prefix = nil
|
60
|
+
config.tfc.workspace = ActiveSupport::OrderedOptions.new
|
61
|
+
config.tfc.workspace.attrs = ActiveSupport::OrderedOptions.new
|
55
62
|
config
|
56
63
|
end
|
57
64
|
|
65
|
+
def ts_logger
|
66
|
+
Logger.new(ENV['TS_LOG_PATH'] || $stderr)
|
67
|
+
end
|
68
|
+
memoize :ts_logger
|
69
|
+
|
58
70
|
def configure
|
59
71
|
yield(@config)
|
60
72
|
end
|
61
73
|
|
62
74
|
def load_project_config
|
63
75
|
evaluate_file("#{Terraspace.root}/config/app.rb")
|
76
|
+
|
77
|
+
# deprecated config/env for config/envs
|
64
78
|
path = "#{Terraspace.root}/config/env/#{Terraspace.env}.rb"
|
79
|
+
if File.exist?(path)
|
80
|
+
# so early on in the boot process that logger.info is unavailable, use ts_logger which is available and same thing.
|
81
|
+
ts_logger.info "DEPRECATED: Please rename config/env to config/envs. IE:".color(:yellow)
|
82
|
+
ts_logger.info " mv config/env config/envs"
|
83
|
+
evaluate_file(path)
|
84
|
+
end
|
85
|
+
|
86
|
+
path = "#{Terraspace.root}/config/envs/#{Terraspace.env}.rb"
|
65
87
|
evaluate_file(path)
|
66
88
|
end
|
67
89
|
end
|
data/lib/terraspace/booter.rb
CHANGED
data/lib/terraspace/cli.rb
CHANGED
@@ -10,7 +10,7 @@ module Terraspace
|
|
10
10
|
option :format, desc: "output formats: json, text"
|
11
11
|
}
|
12
12
|
out_option = Proc.new {
|
13
|
-
option :out, aliases: :o, desc: "
|
13
|
+
option :out, aliases: :o, desc: "Write the output to path"
|
14
14
|
}
|
15
15
|
input_option = Proc.new {
|
16
16
|
option :input, type: :boolean, desc: "Ask for input for variables if not directly set."
|
@@ -36,14 +36,14 @@ module Terraspace
|
|
36
36
|
long_desc Help.text(:clean)
|
37
37
|
subcommand "clean", Clean
|
38
38
|
|
39
|
-
desc "cloud SUBCOMMAND", "cloud subcommands"
|
40
|
-
long_desc Help.text(:cloud)
|
41
|
-
subcommand "cloud", Cloud
|
42
|
-
|
43
39
|
desc "new SUBCOMMAND", "new subcommands"
|
44
40
|
long_desc Help.text(:new)
|
45
41
|
subcommand "new", New
|
46
42
|
|
43
|
+
desc "tfc SUBCOMMAND", "tfc subcommands"
|
44
|
+
long_desc Help.text(:tfc)
|
45
|
+
subcommand "tfc", Tfc
|
46
|
+
|
47
47
|
desc "build [STACK]", "Build project."
|
48
48
|
long_desc Help.text(:build)
|
49
49
|
option :quiet, type: :boolean, desc: "quiet output"
|
@@ -123,6 +123,7 @@ module Terraspace
|
|
123
123
|
instance_option.call
|
124
124
|
out_option.call
|
125
125
|
reconfigure_option.call
|
126
|
+
option :copy_to_root, type: :boolean, default: true, desc: "Copy plan file generated in the cache folder back to project root"
|
126
127
|
def plan(mod)
|
127
128
|
Commander.new("plan", options.merge(mod: mod)).run
|
128
129
|
end
|
@@ -144,7 +145,7 @@ module Terraspace
|
|
144
145
|
desc "seed STACK", "Build starer seed tfvars file."
|
145
146
|
long_desc Help.text(:seed)
|
146
147
|
option :yes, aliases: :y, type: :boolean, desc: "bypass prompts and force overwrite files"
|
147
|
-
option :where, desc: "where to create file. either under app or seed folder structure. values:
|
148
|
+
option :where, desc: "where to create file. either under app or seed folder structure. values: seed or stack"
|
148
149
|
init_option.call
|
149
150
|
instance_option.call
|
150
151
|
def seed(mod)
|
@@ -169,6 +170,12 @@ module Terraspace
|
|
169
170
|
Commander.new("show", options.merge(mod: mod)).run
|
170
171
|
end
|
171
172
|
|
173
|
+
desc "state SUBCOMMAND STACK", "Run state."
|
174
|
+
long_desc Help.text(:state)
|
175
|
+
def state(subcommand, mod)
|
176
|
+
State.new(options.merge(subcommand: subcommand, mod: mod)).run
|
177
|
+
end
|
178
|
+
|
172
179
|
desc "test", "Run test."
|
173
180
|
long_desc Help.text(:test)
|
174
181
|
def test
|
@@ -26,7 +26,12 @@ module Terraspace::CLI::Build
|
|
26
26
|
|
27
27
|
# Used by: terraspace build placeholder
|
28
28
|
def find_stack
|
29
|
-
|
29
|
+
stack_paths = Dir.glob("{app,vendor}/stacks/*")
|
30
|
+
stack_paths.select! do |path|
|
31
|
+
select = Terraspace::Compiler::Select.new(path)
|
32
|
+
select.selected?
|
33
|
+
end
|
34
|
+
mod_path = stack_paths.last
|
30
35
|
unless mod_path
|
31
36
|
logger.info "No stacks found."
|
32
37
|
exit 0
|
@@ -7,7 +7,7 @@ class Terraspace::CLI
|
|
7
7
|
|
8
8
|
def run
|
9
9
|
Terraspace::Builder.new(@options).run unless @options[:build] # Up already ran build
|
10
|
-
Init.new(@options
|
10
|
+
Init.new(@options).run
|
11
11
|
Terraspace::Terraform::Runner.new(@name, @options).run
|
12
12
|
end
|
13
13
|
end
|
data/lib/terraspace/cli/down.rb
CHANGED
@@ -14,7 +14,7 @@ class Terraspace::CLI
|
|
14
14
|
|
15
15
|
def destroy
|
16
16
|
Commander.new("destroy", @options.merge(command: "down")).run
|
17
|
-
Terraspace::Terraform::
|
17
|
+
Terraspace::Terraform::Tfc::Workspace.new(@options).destroy if @options[:destroy_workspace]
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Statuses of pending and planned are shown by default.
|
4
4
|
|
5
|
-
$ terraspace
|
5
|
+
$ terraspace tfc runs list demo
|
6
6
|
+----------------------+---------+---------------------------------+---------------------+
|
7
7
|
| Id | Status | Message | Created At |
|
8
8
|
+----------------------+---------+---------------------------------+---------------------+
|
@@ -13,7 +13,7 @@ Statuses of pending and planned are shown by default.
|
|
13
13
|
|
14
14
|
To see all most recent runs, use `--status all`.
|
15
15
|
|
16
|
-
$ terraspace
|
16
|
+
$ terraspace tfc runs list demo --status all
|
17
17
|
+----------------------+-----------+--------------------------------+---------------------+
|
18
18
|
| Id | Status | Message | Created At |
|
19
19
|
+----------------------+-----------+--------------------------------+---------------------+
|
@@ -26,7 +26,7 @@ To see all most recent runs, use `--status all`.
|
|
26
26
|
|
27
27
|
You can provide a list of statuses to the `--status` filter option.
|
28
28
|
|
29
|
-
$ terraspace
|
29
|
+
$ terraspace tfc runs list demo --status canceled discarded
|
30
30
|
+----------------------+-----------+--------------------------------+---------------------+
|
31
31
|
| Id | Status | Message | Created At |
|
32
32
|
+----------------------+-----------+--------------------------------+---------------------+
|