terraspace 0.5.6 → 0.5.11
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 +17 -0
- data/lib/terraspace.rb +1 -0
- data/lib/terraspace/all/grapher.rb +21 -4
- data/lib/terraspace/cli/build/placeholder.rb +4 -4
- data/lib/terraspace/{completer.rb → cli/completer.rb} +66 -72
- data/lib/terraspace/{completer → cli/completer}/script.rb +2 -2
- data/lib/terraspace/{completer → cli/completer}/script.sh +0 -0
- data/lib/terraspace/cli/up.rb +5 -3
- data/lib/terraspace/mod.rb +1 -1
- data/lib/terraspace/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ab8d16e8890ccbd14785cdc20245e47a126593337d0330bfecbb902336a32d8
|
4
|
+
data.tar.gz: 51f9b735befd7ea059ff6541414e3f80631a9bc5b511fc69f4e1f489e6f9a72e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3d6fca3b2b9b2fcdabd48d6b093e7a3dcfafe4f53a482dc7fffb3a001bca89a743b294b12ccc92e2cb7010799e0d147e402406afaa93de48149d94fd9c894f3
|
7
|
+
data.tar.gz: 5a36c2d3d9f847989f639829be9fae0b5b1a9a6e48f636478b1560a94a45fca2ff74db5800ebaa8ed97977c2b5e83a72a99292f8737c6737ebabd1ba748bd026
|
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,23 @@
|
|
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.11] - 2021-02-11
|
7
|
+
- [#76](https://github.com/boltops-tools/terraspace/pull/76) dont use auto generated plan when both yes and plan options used
|
8
|
+
- fix plan path when 2 stacks of same name run at the same time
|
9
|
+
|
10
|
+
## [0.5.10] - 2020-12-11
|
11
|
+
- [#69](https://github.com/boltops-tools/terraspace/pull/69) require singleton earlier
|
12
|
+
|
13
|
+
## [0.5.9] - 2020-12-11
|
14
|
+
- [#68](https://github.com/boltops-tools/terraspace/pull/68) require singleton
|
15
|
+
- fix graphviz check for format text, improve graphviz install help message
|
16
|
+
|
17
|
+
## [0.5.8] - 2020-12-04
|
18
|
+
- [#67](https://github.com/boltops-tools/terraspace/pull/67) fix find placeholder stack so config/terraform only builds for stacks
|
19
|
+
|
20
|
+
## [0.5.7] - 2020-12-02
|
21
|
+
- [#64](https://github.com/boltops-tools/terraspace/pull/64) fix completion_script
|
22
|
+
|
6
23
|
## [0.5.6] - 2020-11-30
|
7
24
|
- [#61](https://github.com/boltops-tools/terraspace/pull/61) allow envs and regions check feature
|
8
25
|
- fix terraspace build before hook
|
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
|
@@ -18,17 +18,17 @@ module Terraspace::CLI::Build
|
|
18
18
|
mod = @options[:mod]
|
19
19
|
if !mod or %w[placeholder].include?(mod)
|
20
20
|
logger.info "Building one of the modules to get backend.tf info"
|
21
|
-
mod =
|
21
|
+
mod = find_stack
|
22
22
|
end
|
23
23
|
Terraspace::Builder.new(@options.merge(mod: mod, init: false)).run # generate and init
|
24
24
|
Terraspace::Mod.new(mod, @options) # mod metadata
|
25
25
|
end
|
26
26
|
|
27
27
|
# Used by: terraspace build placeholder
|
28
|
-
def
|
29
|
-
mod_path = Dir.glob("{app,vendor}/
|
28
|
+
def find_stack
|
29
|
+
mod_path = Dir.glob("{app,vendor}/stacks/*").last
|
30
30
|
unless mod_path
|
31
|
-
logger.info "No
|
31
|
+
logger.info "No stacks found."
|
32
32
|
exit 0
|
33
33
|
end
|
34
34
|
File.basename(mod_path) # mod name
|
@@ -1,74 +1,69 @@
|
|
1
|
-
|
2
|
-
Code Explanation:
|
3
|
-
|
4
|
-
There are 3 types of things to auto-complete:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
Here's an example:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
When command parameters are done processing, the remaining completion words will be options. We can tell that the command params are completed based on the method arity.
|
19
|
-
|
20
|
-
## Arity
|
21
|
-
|
22
|
-
For example, say you had a method for a CLI command with the following form:
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
It's equivalent ruby method:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
So typing:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
So the completion should only show options, something like this:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
## Splat Arguments
|
39
|
-
|
40
|
-
When the ruby method has a splat argument, it's arity is negative. Here are some example methods and their arities.
|
41
|
-
|
42
|
-
|
43
|
-
scale(service, count) = 2
|
44
|
-
|
45
|
-
foo(example, *rest) = -2
|
46
|
-
|
47
|
-
Fortunately, negative and positive arity values are processed the same way. So we take simply take the absolute value of the arity and process it the same.
|
48
|
-
|
49
|
-
Here are some test cases, hit TAB after typing the command:
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
* Thor::Group command: ufo init
|
68
|
-
|
69
|
-
Auto-completion accounts for each of these type of commands.
|
70
|
-
=end
|
71
|
-
module Terraspace
|
1
|
+
# begin
|
2
|
+
# Code Explanation:
|
3
|
+
#
|
4
|
+
# There are 3 types of things to auto-complete:
|
5
|
+
#
|
6
|
+
# 1. command: the command itself
|
7
|
+
# 2. parameters: command parameters.
|
8
|
+
# 3. options: command options
|
9
|
+
#
|
10
|
+
# Here's an example:
|
11
|
+
#
|
12
|
+
# mycli hello name --from me
|
13
|
+
#
|
14
|
+
# * command: hello
|
15
|
+
# * parameters: name
|
16
|
+
# * option: --from
|
17
|
+
#
|
18
|
+
# When command parameters are done processing, the remaining completion words will be options. We can tell that the command params are completed based on the method arity.
|
19
|
+
#
|
20
|
+
# ## Arity
|
21
|
+
#
|
22
|
+
# For example, say you had a method for a CLI command with the following form:
|
23
|
+
#
|
24
|
+
# terraspace up STACK
|
25
|
+
#
|
26
|
+
# It's equivalent ruby method:
|
27
|
+
#
|
28
|
+
# up(mod) = has an arity of 1
|
29
|
+
#
|
30
|
+
# So typing:
|
31
|
+
#
|
32
|
+
# terraspace up [TAB] # there is parameter including the "scale" command according to Thor's CLI processing.
|
33
|
+
#
|
34
|
+
# So the completion should only show options, something like this:
|
35
|
+
#
|
36
|
+
# --noop --verbose --cluster
|
37
|
+
#
|
38
|
+
# ## Splat Arguments
|
39
|
+
#
|
40
|
+
# When the ruby method has a splat argument, it's arity is negative. Here are some example methods and their arities.
|
41
|
+
#
|
42
|
+
# up(mod) = 1
|
43
|
+
# scale(service, count) = 2
|
44
|
+
# bundle(*args) = -1
|
45
|
+
# foo(example, *rest) = -2
|
46
|
+
#
|
47
|
+
# Fortunately, negative and positive arity values are processed the same way. So we take simply take the absolute value of the arity and process it the same.
|
48
|
+
#
|
49
|
+
# Here are some test cases, hit TAB after typing the command:
|
50
|
+
#
|
51
|
+
# terraspace completion
|
52
|
+
# terraspace completion up
|
53
|
+
# terraspace completion up name
|
54
|
+
# terraspace completion up name --
|
55
|
+
# terraspace completion up name --noop
|
56
|
+
#
|
57
|
+
# ## Subcommands and Thor::Group Registered Commands
|
58
|
+
#
|
59
|
+
# Sometimes the commands are not simple thor commands but are subcommands or Thor::Group commands. A good specific example is the terraspace tool.
|
60
|
+
#
|
61
|
+
# * regular command: terraspace up
|
62
|
+
# * subcommand: terraspace all
|
63
|
+
# * Thor::Group command: terraspace new project
|
64
|
+
|
65
|
+
# Auto-completion accounts for each of these type of commands.
|
66
|
+
class Terraspace::CLI
|
72
67
|
class Completer
|
73
68
|
def initialize(command_class, *params)
|
74
69
|
@params = params
|
@@ -132,7 +127,6 @@ module Terraspace
|
|
132
127
|
|
133
128
|
def params_completion
|
134
129
|
offset = @params.size - 1
|
135
|
-
offset_params = command_params[offset..-1]
|
136
130
|
command_params[offset..-1].first
|
137
131
|
end
|
138
132
|
|
File without changes
|
data/lib/terraspace/cli/up.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
require 'securerandom'
|
2
|
+
|
1
3
|
class Terraspace::CLI
|
2
4
|
class Up < Base
|
3
5
|
include TfcConcern
|
4
6
|
|
5
7
|
def run
|
6
8
|
build
|
7
|
-
if @options[:yes] && !tfc?
|
9
|
+
if @options[:yes] && !@options[:plan] && !tfc?
|
8
10
|
plan
|
9
11
|
Commander.new("apply", @options.merge(plan: plan_path)).run
|
10
12
|
else
|
@@ -25,8 +27,8 @@ class Terraspace::CLI
|
|
25
27
|
end
|
26
28
|
|
27
29
|
def plan_path
|
28
|
-
@@
|
29
|
-
"#{Terraspace.tmp_root}/plans/#{@mod.name}-#{@@
|
30
|
+
@@random ||= SecureRandom.hex
|
31
|
+
"#{Terraspace.tmp_root}/plans/#{@mod.name}-#{@@random}.plan"
|
30
32
|
end
|
31
33
|
end
|
32
34
|
end
|
data/lib/terraspace/mod.rb
CHANGED
data/lib/terraspace/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terraspace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -481,6 +481,9 @@ files:
|
|
481
481
|
- lib/terraspace/cli/cloud.rb
|
482
482
|
- lib/terraspace/cli/cloud/runs.rb
|
483
483
|
- lib/terraspace/cli/commander.rb
|
484
|
+
- lib/terraspace/cli/completer.rb
|
485
|
+
- lib/terraspace/cli/completer/script.rb
|
486
|
+
- lib/terraspace/cli/completer/script.sh
|
484
487
|
- lib/terraspace/cli/down.rb
|
485
488
|
- lib/terraspace/cli/help.rb
|
486
489
|
- lib/terraspace/cli/help/all/down.md
|
@@ -608,9 +611,6 @@ files:
|
|
608
611
|
- lib/terraspace/compiler/strategy/tfvar/rb.rb
|
609
612
|
- lib/terraspace/compiler/strategy/tfvar/tfvars.rb
|
610
613
|
- lib/terraspace/compiler/writer.rb
|
611
|
-
- lib/terraspace/completer.rb
|
612
|
-
- lib/terraspace/completer/script.rb
|
613
|
-
- lib/terraspace/completer/script.sh
|
614
614
|
- lib/terraspace/core.rb
|
615
615
|
- lib/terraspace/dependency/graph.rb
|
616
616
|
- lib/terraspace/dependency/helper/base.rb
|
@@ -835,7 +835,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
835
835
|
- !ruby/object:Gem::Version
|
836
836
|
version: '0'
|
837
837
|
requirements: []
|
838
|
-
rubygems_version: 3.
|
838
|
+
rubygems_version: 3.2.5
|
839
839
|
signing_key:
|
840
840
|
specification_version: 4
|
841
841
|
summary: 'Terraspace: The Terraspace Framework'
|