terraspace 2.2.6 → 2.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/templates/base/project/Gemfile.tt +3 -7
- data/lib/terraspace/cli/fmt/runner.rb +9 -4
- data/lib/terraspace/cli/fmt.rb +4 -1
- data/lib/terraspace/cli/new/helpers.rb +3 -15
- data/lib/terraspace/compiler/strategy/mod.rb +3 -2
- data/lib/terraspace/seeder/content.rb +3 -1
- data/lib/terraspace/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5477cf33cd5e864e5b7117cdc129d4aaa96a9f6ff9255093e9499180e67068f8
|
4
|
+
data.tar.gz: 3dc0b9113b44f7e0d10019aeb22898b8045f8de0be3c60a756d9bda588847184
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15da8006c07825c64446444c58e2efa4c22baeeda85da0abcf5d2d54e16e35e9929c6a636885a969fc12a9918ff74df90b34f88147141f0bc53c170061be0964
|
7
|
+
data.tar.gz: 499ebbabe6e904e6d3800c7d18b8b830c1130aee5faf07a317159d63e63eeeb96bf9483416efcf59a9d8753f5b0f09648b1595da56591751ce389d6d7710c3d7
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,16 @@
|
|
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.2.8] - 2023-06-27
|
7
|
+
- Fix exit status for fmt
|
8
|
+
|
9
|
+
## [2.2.7] - 2023-06-07
|
10
|
+
- [#308](https://github.com/boltops-tools/terraspace/pull/308) feat: add support for exit code in terraspace fmt command
|
11
|
+
- [#310](https://github.com/boltops-tools/terraspace/pull/310) improve terraspace seed for map(string) variables
|
12
|
+
- [#311](https://github.com/boltops-tools/terraspace/pull/311) erb processing for rb files in modules folder for dsl
|
13
|
+
- [#312](https://github.com/boltops-tools/terraspace/pull/312) refactor terraspace new project Gemfile.tt
|
14
|
+
- [#313](https://github.com/boltops-tools/terraspace/pull/313) cleanup terraspace fmt exit status return
|
15
|
+
|
6
16
|
## [2.2.6] - 2023-05-03
|
7
17
|
- [#302](https://github.com/boltops-tools/terraspace/pull/302) update new project generator config/app.rb config.build.copy_modules
|
8
18
|
|
@@ -1,12 +1,8 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
<%=
|
4
|
-
|
5
|
-
|
6
|
-
"rspec-terraspace",
|
7
|
-
plugin_gem_name,
|
8
|
-
)
|
9
|
-
%>
|
3
|
+
gem "terraspace", "~> <%= terraspace_minor_version %>"
|
4
|
+
gem "<%= plugin_gem_name %>"
|
5
|
+
gem "rspec-terraspace"
|
10
6
|
|
11
7
|
# Uncomment the ci and vcs provider you wish to use. Should use both ci and vcs gem
|
12
8
|
# Docs: https://terraspace.cloud/docs/ci/
|
@@ -10,14 +10,17 @@ class Terraspace::CLI::Fmt
|
|
10
10
|
|
11
11
|
def format!
|
12
12
|
logger.info @dir.color(:green)
|
13
|
+
|
14
|
+
exit_status = nil
|
13
15
|
Dir.chdir(@dir) do
|
14
16
|
skip_rename
|
15
17
|
begin
|
16
|
-
terraform_fmt
|
18
|
+
exit_status = terraform_fmt
|
17
19
|
ensure
|
18
20
|
restore_rename
|
19
21
|
end
|
20
22
|
end
|
23
|
+
exit_status
|
21
24
|
end
|
22
25
|
|
23
26
|
def skip_rename
|
@@ -35,9 +38,11 @@ class Terraspace::CLI::Fmt
|
|
35
38
|
def sh(command)
|
36
39
|
logger.debug("=> #{command}")
|
37
40
|
success = system(command)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
+
unless success
|
42
|
+
logger.info "WARN: There were some errors running terraform fmt for files in #{@dir}:".color(:yellow)
|
43
|
+
logger.info "The errors are shown above"
|
44
|
+
end
|
45
|
+
$?.exitstatus
|
41
46
|
end
|
42
47
|
|
43
48
|
def restore_rename
|
data/lib/terraspace/cli/fmt.rb
CHANGED
@@ -8,11 +8,14 @@ class Terraspace::CLI
|
|
8
8
|
@mod_name = options[:mod]
|
9
9
|
end
|
10
10
|
|
11
|
+
@@exit_status = 0
|
11
12
|
def run
|
12
13
|
logger.info "Formating terraform files"
|
13
14
|
dirs.each do |dir|
|
14
|
-
format(dir)
|
15
|
+
exit_status = format(dir)
|
16
|
+
@@exit_status = exit_status if exit_status != 0
|
15
17
|
end
|
18
|
+
exit(@@exit_status)
|
16
19
|
end
|
17
20
|
|
18
21
|
def format(dir)
|
@@ -3,21 +3,9 @@ class Terraspace::CLI::New
|
|
3
3
|
include Helpers::PluginGem
|
4
4
|
|
5
5
|
private
|
6
|
-
def
|
7
|
-
|
8
|
-
|
9
|
-
lines << gem_line(name)
|
10
|
-
end
|
11
|
-
lines.join("\n")
|
12
|
-
end
|
13
|
-
|
14
|
-
def gem_line(name)
|
15
|
-
if name == "terraspace"
|
16
|
-
major_version = Terraspace::VERSION.split('.').first
|
17
|
-
%Q|gem "#{name}", '~> #{major_version}'|
|
18
|
-
else
|
19
|
-
%Q|gem "#{name}"|
|
20
|
-
end
|
6
|
+
def terraspace_minor_version
|
7
|
+
major, minor, _ = Terraspace::VERSION.split('.')
|
8
|
+
[major, minor, '0'].join('.')
|
21
9
|
end
|
22
10
|
end
|
23
11
|
end
|
@@ -10,7 +10,7 @@ module Terraspace::Compiler::Strategy
|
|
10
10
|
|
11
11
|
def strategy_class(path)
|
12
12
|
# Significant speed improvement
|
13
|
-
return Mod::Pass if copy_modules?
|
13
|
+
return Mod::Pass if copy_modules?(path)
|
14
14
|
|
15
15
|
ext = File.extname(path).sub('.','')
|
16
16
|
return Mod::Pass if ext.empty? # infinite loop without this
|
@@ -20,7 +20,8 @@ module Terraspace::Compiler::Strategy
|
|
20
20
|
end
|
21
21
|
|
22
22
|
@@copy_modules_warned = false
|
23
|
-
def copy_modules?
|
23
|
+
def copy_modules?(path)
|
24
|
+
return false if path.include?("/modules/") && path.ends_with?(".rb") # For DSL
|
24
25
|
return false unless @options[:type_dir] == "modules"
|
25
26
|
|
26
27
|
copy_modules = Terraspace.config.build.copy_modules
|
@@ -39,7 +39,9 @@ class Terraspace::Seeder
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def escape(type, value)
|
42
|
-
if type
|
42
|
+
if type == "map(string)"
|
43
|
+
"{...} # #{type}"
|
44
|
+
elsif type&.include?('(') # complex type
|
43
45
|
"[...] # #{type}"
|
44
46
|
elsif %w[null any true false].include?(value)
|
45
47
|
value # no quotes
|
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: 2.2.
|
4
|
+
version: 2.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -346,7 +346,7 @@ dependencies:
|
|
346
346
|
- - ">="
|
347
347
|
- !ruby/object:Gem::Version
|
348
348
|
version: '0'
|
349
|
-
description:
|
349
|
+
description:
|
350
350
|
email:
|
351
351
|
- tung@boltops.com
|
352
352
|
executables:
|
@@ -950,7 +950,7 @@ metadata:
|
|
950
950
|
homepage_uri: https://terraspace.cloud
|
951
951
|
source_code_uri: https://github.com/boltops-tools/terraspace
|
952
952
|
changelog_uri: https://github.com/boltops-tools/terraspace/blob/master/CHANGELOG.md
|
953
|
-
post_install_message:
|
953
|
+
post_install_message:
|
954
954
|
rdoc_options: []
|
955
955
|
require_paths:
|
956
956
|
- lib
|
@@ -965,8 +965,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
965
965
|
- !ruby/object:Gem::Version
|
966
966
|
version: '0'
|
967
967
|
requirements: []
|
968
|
-
rubygems_version: 3.
|
969
|
-
signing_key:
|
968
|
+
rubygems_version: 3.4.10
|
969
|
+
signing_key:
|
970
970
|
specification_version: 4
|
971
971
|
summary: 'Terraspace: The Terraspace Framework'
|
972
972
|
test_files:
|