terraspace 2.1.4 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/templates/base/project/config/app.rb +1 -1
- data/lib/terraspace/app.rb +1 -1
- data/lib/terraspace/cli/new/helpers.rb +2 -1
- data/lib/terraspace/cloud/vcs/commenter.rb +1 -0
- data/lib/terraspace/cloud/vcs/local_git.rb +10 -1
- data/lib/terraspace/compiler/perform.rb +3 -0
- data/lib/terraspace/core.rb +1 -1
- data/lib/terraspace/terraform/args/pass.rb +13 -2
- data/lib/terraspace/version.rb +1 -1
- data/spec/terraspace/terraform/args/pass_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 550175db9da67e3d7682fd5716c9d57aea3c3457a6b9fc57491d8d7befc4f2b0
|
|
4
|
+
data.tar.gz: 5d79ea28576b48715b6d48fa6e4d259a5c00471a631b4c6fc8c524a8f1c7d363
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6597079c61a475fc990edcdbd1b0ccf6cf459d29e4558ae02911c658ed2bc091bf9c85f1a09bb7202a33bd5f22bfa0df9a080850d4057a6bb478c8317e3cc680
|
|
7
|
+
data.tar.gz: 21f3bad245a3c7ff13dea9aef33714dd77c439fee0fa9073df801970be6ee40937ac30a74b331a79806222c08dac6fb05c0e344e1873d4e9bbf9a98ec16d998d
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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
|
+
## [2.1.7] - 2022-08-22
|
|
7
|
+
- [#259](https://github.com/boltops-tools/terraspace/pull/259) fix TS_PROJECT for ts cloud
|
|
8
|
+
- builder: skip examples
|
|
9
|
+
- improve generated config app.rb
|
|
10
|
+
|
|
11
|
+
## [2.1.6] - 2022-08-19
|
|
12
|
+
- [#258](https://github.com/boltops-tools/terraspace/pull/258) Fix terraform apply/destroy missing some passthrough options
|
|
13
|
+
|
|
14
|
+
## [2.1.5] - 2022-07-21
|
|
15
|
+
- [#255](https://github.com/boltops-tools/terraspace/pull/255) dont compute git info when not cloud not enabled and warn message improvement
|
|
16
|
+
- pin terraspace to major version in initially generated Gemfile
|
|
17
|
+
|
|
6
18
|
## [2.1.4] - 2022-07-16
|
|
7
19
|
- [#252](https://github.com/boltops-tools/terraspace/pull/252) puts friendlier user message with terraspace force_unlock suggestion
|
|
8
20
|
- [#253](https://github.com/boltops-tools/terraspace/pull/253) azure repo local git support
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Docs: https://terraspace.cloud/docs/config/reference/
|
|
2
2
|
Terraspace.configure do |config|
|
|
3
|
-
config.logger.level = :info
|
|
3
|
+
# config.logger.level = :info
|
|
4
4
|
|
|
5
5
|
# To enable Terraspace Cloud set config.cloud.org
|
|
6
6
|
# config.cloud.org = "ORG" # required: replace with your org. only letters, numbers, underscore and dashes allowed
|
data/lib/terraspace/app.rb
CHANGED
|
@@ -47,7 +47,7 @@ module Terraspace
|
|
|
47
47
|
config.bundle.logger = ts_logger
|
|
48
48
|
|
|
49
49
|
config.cloud = ActiveSupport::OrderedOptions.new
|
|
50
|
-
config.cloud.project =
|
|
50
|
+
config.cloud.project = Terraspace.project
|
|
51
51
|
config.cloud.org = ENV['TS_ORG'] # required for Terraspace cloud
|
|
52
52
|
config.cloud.record = "changes" # IE: changes or all
|
|
53
53
|
config.cloud.stack = ":APP-:ROLE-:MOD_NAME-:ENV-:EXTRA-:REGION"
|
|
@@ -13,7 +13,8 @@ class Terraspace::CLI::New
|
|
|
13
13
|
|
|
14
14
|
def gem_line(name)
|
|
15
15
|
if name == "terraspace"
|
|
16
|
-
|
|
16
|
+
major_version = Terraspace::VERSION.split('.').first
|
|
17
|
+
%Q|gem "#{name}", '~> #{major_version}'|
|
|
17
18
|
else
|
|
18
19
|
%Q|gem "#{name}"|
|
|
19
20
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
class Terraspace::Cloud::Vcs
|
|
2
2
|
class LocalGit < Base
|
|
3
3
|
def vars
|
|
4
|
-
if git_repo? && git_installed?
|
|
4
|
+
if git_repo? && git_installed? && host
|
|
5
5
|
provider_vars = vcs_class ? vcs_class.new(base_vars, git_url).vars : {}
|
|
6
6
|
base_vars.merge(provider_vars).compact # remove items with nil values
|
|
7
7
|
else
|
|
@@ -36,6 +36,15 @@ class Terraspace::Cloud::Vcs
|
|
|
36
36
|
return nil if git_url.blank?
|
|
37
37
|
uri = URI(git_url)
|
|
38
38
|
"#{uri.scheme}://#{uri.host}"
|
|
39
|
+
rescue URI::InvalidURIError => e
|
|
40
|
+
logger.info "WARN: #{e.class} #{e.message}".color(:yellow)
|
|
41
|
+
logger.info <<~EOL
|
|
42
|
+
Unable to get the host info from your local .git/config
|
|
43
|
+
Will not be able to determine local git info.
|
|
44
|
+
If possible, it would be a useful to provide the remote.url in your .git/config
|
|
45
|
+
as an issue report or email to improve help improve this logic.
|
|
46
|
+
EOL
|
|
47
|
+
nil
|
|
39
48
|
end
|
|
40
49
|
|
|
41
50
|
def full_repo
|
|
@@ -21,6 +21,9 @@ module Terraspace::Compiler
|
|
|
21
21
|
|
|
22
22
|
def compile_module
|
|
23
23
|
with_mod_file do |src_path|
|
|
24
|
+
# Skip examples. Dont want to process tfvars <%= output(...) %> which triggers dependency graph
|
|
25
|
+
# Also a speed improvement.
|
|
26
|
+
next if src_path.include?("#{@mod.root}/examples/")
|
|
24
27
|
compile_mod_file(src_path)
|
|
25
28
|
end
|
|
26
29
|
end
|
data/lib/terraspace/core.rb
CHANGED
|
@@ -60,6 +60,17 @@ module Terraspace::Terraform::Args
|
|
|
60
60
|
result
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
def terraform_arg_types
|
|
64
|
+
arg_types = terraform_arg_types_for_command(@name)
|
|
65
|
+
# "terraspace apply/destroy" support the same options as "plan", but they don't document
|
|
66
|
+
# them directly in their "-help" option, so we need to add them.
|
|
67
|
+
if ["apply", "destroy"].include? @name
|
|
68
|
+
arg_types.merge! terraform_arg_types_for_command("plan")
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
arg_types
|
|
72
|
+
end
|
|
73
|
+
|
|
63
74
|
# Parses terraform COMMAND -help output for arg types.
|
|
64
75
|
# Return Example:
|
|
65
76
|
#
|
|
@@ -69,8 +80,8 @@ module Terraspace::Terraform::Args
|
|
|
69
80
|
# var: :hash,
|
|
70
81
|
# }
|
|
71
82
|
#
|
|
72
|
-
def
|
|
73
|
-
out = terraform_help(
|
|
83
|
+
def terraform_arg_types_for_command(name)
|
|
84
|
+
out = terraform_help(name)
|
|
74
85
|
lines = out.split("\n")
|
|
75
86
|
lines.select! do |line|
|
|
76
87
|
line =~ /^ -/
|
data/lib/terraspace/version.rb
CHANGED
|
@@ -51,6 +51,19 @@ describe Terraspace::Terraform::Args::Pass do
|
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
+
context "indirectly documented args" do
|
|
55
|
+
# "terraform apply -help" doesn't document "-target" directly, but refers to
|
|
56
|
+
# "terraform plan -help" documentation.
|
|
57
|
+
context "-target=resource" do
|
|
58
|
+
let(:args) { ["-target=foo.bar"] }
|
|
59
|
+
let(:name) { "apply" }
|
|
60
|
+
it "pass through args" do
|
|
61
|
+
args = pass.args
|
|
62
|
+
expect(args).to eq ["-target=foo.bar"]
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
54
67
|
context "hash arg" do
|
|
55
68
|
context "-var 'foo=bar'" do
|
|
56
69
|
let(:args) { ["-var 'foo=bar'"] }
|
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: 2.1.
|
|
4
|
+
version: 2.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tung Nguyen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-08-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|