terraspace 2.2.5 → 2.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cea629f7a076ccbe0f682b3037fda1e69fe8f7658243e502103b395ff0396351
4
- data.tar.gz: ab8d340084aef5691796484d2942469262978ac848b8fc6f33d54b49d60609e7
3
+ metadata.gz: ee5dc242e1055db24d4105a3b2e8be3b7fb68bb283631843633075d8e949fbbd
4
+ data.tar.gz: f7639d78fbffeebb654f4e5a0eccd5236e1b2f0e2e10b0b9e1e3914a19b6cd75
5
5
  SHA512:
6
- metadata.gz: 421a85f27bc4fb0906de29037eba4f7e3d852b8c0ce60191e911ccd615a04897a3d631e7c742eba8006e681f893d6715097910fd71a558b0931e36d3d8a0d881
7
- data.tar.gz: 94c6f9f9a605a8e151576efb54d0326e7a6a0d8d18736edc9607bb04b35c158040d801d58ff50cf2567db21013095a531914c501ca19609b672f35c4450f0baf
6
+ metadata.gz: 840de5054bc4fb69a5f00031076f9dd65df5c7d7fddbd636b734df53c475490d1121b2d8b71f3f9910d16a7ed6f21cfa2c5d44088aff58bf7aff5195cc4f63a7
7
+ data.tar.gz: 911059ad7bb57d41b0c3ec3f83e3b2bf2f5623a2423ac496c35509cbca3be1e3b7bbf61c38b89b252d74bda846691a6e741967c129978a700d1b15d9a1383a29
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.7] - 2023-06-07
7
+ - [#308](https://github.com/boltops-tools/terraspace/pull/308) feat: add support for exit code in terraspace fmt command
8
+ - [#310](https://github.com/boltops-tools/terraspace/pull/310) improve terraspace seed for map(string) variables
9
+ - [#311](https://github.com/boltops-tools/terraspace/pull/311) erb processing for rb files in modules folder for dsl
10
+ - [#312](https://github.com/boltops-tools/terraspace/pull/312) refactor terraspace new project Gemfile.tt
11
+ - [#313](https://github.com/boltops-tools/terraspace/pull/313) cleanup terraspace fmt exit status return
12
+
13
+ ## [2.2.6] - 2023-05-03
14
+ - [#302](https://github.com/boltops-tools/terraspace/pull/302) update new project generator config/app.rb config.build.copy_modules
15
+
6
16
  ## [2.2.5] - 2023-05-02
7
17
  - [#301](https://github.com/boltops-tools/terraspace/pull/301) Speed boast copy modules
8
18
 
@@ -1,12 +1,8 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- <%=
4
- build_gemfile(
5
- "terraspace",
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/
@@ -2,10 +2,7 @@
2
2
  Terraspace.configure do |config|
3
3
  # config.logger.level = :info
4
4
 
5
- # To enable Terraspace Cloud set config.cloud.org
6
- # config.cloud.org = "ORG" # required: replace with your org. only letters, numbers, underscore and dashes allowed
7
- # config.cloud.project = "main" # optional. main is the default project name. only letters, numbers, underscore and dashes allowed
8
-
9
- # Uncomment to enable Cost Estimation. See: http://terraspace.cloud/docs/cloud/cost-estimation/
10
- # config.cloud.cost.enabled = true
5
+ # copy_modules setting introduced 2.2.5 to speed up terraspace build
6
+ # See: https://terraspace.cloud/docs/config/reference
7
+ config.build.copy_modules = true
11
8
  end
@@ -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
- return if success
39
- logger.info "WARN: There were some errors running terraform fmt for files in #{@dir}:".color(:yellow)
40
- logger.info "The errors are shown above"
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
@@ -10,9 +10,11 @@ class Terraspace::CLI
10
10
 
11
11
  def run
12
12
  logger.info "Formating terraform files"
13
+ exit_status = nil
13
14
  dirs.each do |dir|
14
- format(dir)
15
+ exit_status = format(dir)
15
16
  end
17
+ exit(exit_status)
16
18
  end
17
19
 
18
20
  def format(dir)
@@ -3,21 +3,9 @@ class Terraspace::CLI::New
3
3
  include Helpers::PluginGem
4
4
 
5
5
  private
6
- def build_gemfile(*list)
7
- lines = []
8
- list.compact.each do |name|
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&.include?('(') # complex 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
@@ -1,3 +1,3 @@
1
1
  module Terraspace
2
- VERSION = "2.2.5"
2
+ VERSION = "2.2.7"
3
3
  end
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.5
4
+ version: 2.2.7
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-05-02 00:00:00.000000000 Z
11
+ date: 2023-06-07 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.3.26
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: