terraspace 2.0.0 → 2.0.3

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: e2e48b2824f50628986b242f0d8f751795b755f54ae1cf3cda72bf7ff2447807
4
- data.tar.gz: cdaec82517675a111b57f15ef081f930bc4f4712003109452dda9c79222b2ee5
3
+ metadata.gz: 2fec1ba076567ee419169922ed9dd183f13bd998983776f603bf36b051d7a6a7
4
+ data.tar.gz: a2c710787cedca1d62b788c761a9cb3bb40f43511d04ccf51fdfe44a0cdff391
5
5
  SHA512:
6
- metadata.gz: 6cc7d06b5e877b2ff3a5dccf2a19c1a94028ed34f83ce8067600c1b6a0e1ba9b3a1dd27d558a7a3d6916af346b09a7eb5248536b4afc162e4268862a484b710f
7
- data.tar.gz: c4293d7b1b496ea38c839113c1845d95552d11da8b041ff115ae1ecaab3b11e659a4e7f906b7b704150144ac70e48faa689e35cb75642b583db7e19a3c36ff79
6
+ metadata.gz: 3318d458250b2e33892740f9fd1fa47d363b2bcffb53a8c8dc8ac081e282bb3cd13be18b230841aa9c125d3fe5e832b53cf2294a51010c123ec96c831666d76d
7
+ data.tar.gz: 4acc67e5c612e584d96c2fd752a1b967c5fe9ce34069ec3149b5f1f6329dff56075f26a220106d20e22155d37279d50cb2e02db10bec873c7803fcadddc1e890
@@ -0,0 +1 @@
1
+ github: boltops-tools
data/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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.0.3] - 2022-07-04
7
+ - [#237](https://github.com/boltops-tools/terraspace/pull/237) remove duplicate paths in layering
8
+ - [#244](https://github.com/boltops-tools/terraspace/pull/244) rename _cache2 to .cache2
9
+ - [#245](https://github.com/boltops-tools/terraspace/pull/245) set utf8 in case system is not configured with LANG=en_US.UTF-8
10
+
11
+ ## [2.0.2] - 2022-06-21
12
+ - [#242](https://github.com/boltops-tools/terraspace/pull/242) :PROJECT variable: TS_PROJECT as well as config.cloud.project
13
+
14
+ ## [2.0.1] - 2022-06-14
15
+ - [#240](https://github.com/boltops-tools/terraspace/pull/240) add project expander variable
16
+
6
17
  ## [2.0.0] - 2022-06-10
7
18
  * Terraspace Cloud Support
8
19
 
@@ -11,21 +22,20 @@ Highlights:
11
22
  * CI plugin support
12
23
  * CI plugin generator
13
24
  * VCS manual support in core for github, gitlab, bitbucket
25
+ * Layering: simplified by removing provider layering by default.
26
+ * Layering: new default `config.layering.mode = "simple"`. Use `config.layering.mode = "provider"` for v1 behavior.
27
+ * Layering: easier to debug with config.layering.show
28
+ * Layering: App, Role, Extra level layering
14
29
 
15
30
  More:
16
31
  * Backend expander variables handle env vars in general
17
32
  * Remove config.build.cache_root option
18
- * Clean up Terraspace::Plugin.autodetect
19
33
  * cloud.record = "changes". dont create cloud record when no changes
20
- * ci generic
21
- * edge case TS_ENV=''
22
- * .cody/cloud test
23
34
  * cloud warning message when TS_TOKEN is confiugred but cloud is not yet
24
- * API expodential retry logic
25
- * plugin autodetect cleanup
35
+ * Cloud API expodential retry logic
26
36
  * TS_EXTRA in favor of instance option, deprecate instance option
27
37
  * handle ctrl-c
28
- * improve acceptannce codebuild scripts
38
+ * improve acceptance codebuild scripts
29
39
 
30
40
  ## [1.1.7] - 2022-02-22
31
41
  - [#215](https://github.com/boltops-tools/terraspace/pull/215) fix all down by building child nodes
@@ -2,7 +2,7 @@ module Terraspace::CLI::Concerns
2
2
  module PlanPath
3
3
  # Use when --out option not used
4
4
  def plan_path
5
- ".terraspace-cache/_cache2/plan/plan.binary"
5
+ ".terraspace-cache/.cache2/plan/plan.binary"
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ class Terraspace::CLI::Logs
2
2
  module Concern
3
3
  # Filters for lines that belong to the last ran process pid
4
4
  def readlines(path)
5
- lines = IO.readlines(path)
5
+ lines = IO.readlines(path).map { |l| l.force_encoding('UTF-8') }
6
6
  found = lines.reverse.find do |line|
7
7
  pid(line) # search in reverse order for lines with interesting info
8
8
  end
@@ -62,7 +62,7 @@ module Terraspace::Cloud
62
62
  # terraform plan can be a kind of apply or destroy
63
63
  # terraform apply can be a kind of apply or destroy
64
64
  kind = self.class.name.to_s.split('::').last.underscore # IE: apply or destroy
65
- dir = "#{@mod.cache_dir}/.terraspace-cache/_cache2/#{kind}"
65
+ dir = "#{@mod.cache_dir}/.terraspace-cache/.cache2/#{kind}"
66
66
  FileUtils.rm_rf(dir)
67
67
  FileUtils.mkdir_p(dir)
68
68
  end
@@ -11,7 +11,7 @@ class Terraspace::Cloud::Folder
11
11
  end
12
12
 
13
13
  def artifacts_path
14
- "#{@mod.cache_dir}/.terraspace-cache/_cache2/artifacts/#{@type}"
14
+ "#{@mod.cache_dir}/.terraspace-cache/.cache2/artifacts/#{@type}"
15
15
  end
16
16
  end
17
17
  end
@@ -12,7 +12,7 @@ class Terraspace::Cloud::Folder
12
12
  FileUtils.rm_rf(artifacts_path)
13
13
  FileUtils.mkdir_p(File.dirname(artifacts_path))
14
14
 
15
- expr = "#{@mod.cache_dir}/.terraspace-cache/_cache2/#{@type}/*"
15
+ expr = "#{@mod.cache_dir}/.terraspace-cache/.cache2/#{@type}/*"
16
16
  Dir.glob(expr).each do |src|
17
17
  dest = "#{artifacts_path}/#{File.basename(src)}"
18
18
  FileUtils.mkdir_p(File.dirname(dest))
@@ -23,7 +23,7 @@ module Terraspace::Cloud
23
23
  clean_cache2_stage
24
24
  # .terraspace-cache/dev/stacks/demo
25
25
  Dir.chdir(@mod.cache_dir) do
26
- cache2_path = ".terraspace-cache/_cache2/#{@kind}"
26
+ cache2_path = ".terraspace-cache/.cache2/#{@kind}"
27
27
  FileUtils.mkdir_p(cache2_path)
28
28
 
29
29
  IO.write("#{cache2_path}/#{@kind}.log", Terraspace::Logger.logs)
@@ -41,7 +41,7 @@ class Terraspace::Compiler::Strategy::Tfvar
41
41
  def paths
42
42
  project_paths = full_paths(project_tfvars_dir)
43
43
  stack_paths = full_paths(stack_tfvars_dir)
44
- paths = project_paths + stack_paths
44
+ paths = (project_paths + stack_paths).uniq
45
45
  show_layers(paths)
46
46
  paths.select do |path|
47
47
  File.exist?(path)
@@ -18,6 +18,14 @@ module Terraspace
18
18
  ENV['TS_EXTRA'] unless ENV['TS_EXTRA'].blank?
19
19
  end
20
20
 
21
+ def project
22
+ if ENV['TS_PROJECT'].blank?
23
+ config.cloud.project
24
+ else
25
+ ENV['TS_PROJECT']
26
+ end
27
+ end
28
+
21
29
  @@root = nil
22
30
  def root
23
31
  @@root ||= ENV['TS_ROOT'] || Dir.pwd
@@ -45,7 +45,8 @@ module Terraspace
45
45
  end
46
46
 
47
47
  def logs
48
- @@buffer.join('')
48
+ # force_encoding https://jch.github.io/posts/2013-03-05-ruby-incompatible-encoding.html
49
+ @@buffer.map { |s| s.force_encoding('UTF-8') }.join('')
49
50
  end
50
51
 
51
52
  # for test framework
@@ -96,10 +96,11 @@ module Terraspace::Plugin::Expander
96
96
  @mod.name
97
97
  end
98
98
 
99
- def app; Terraspace.app ; end
100
- def role; Terraspace.role ; end
101
- def env; Terraspace.env ; end
102
- def extra; Terraspace.extra ; end
99
+ def app; Terraspace.app ; end
100
+ def env; Terraspace.env ; end
101
+ def extra; Terraspace.extra ; end
102
+ def project; Terraspace.project ; end
103
+ def role; Terraspace.role ; end
103
104
 
104
105
  def type_instance
105
106
  [type, instance].reject { |s| s.blank? }.join('-')
@@ -22,7 +22,7 @@ module Terraspace::Terraform::Ihooks::After
22
22
  def cloud_create_plan
23
23
  return unless Terraspace.cloud?
24
24
 
25
- unless @mod.out_option.include?("_cache2")
25
+ unless @mod.out_option.include?(".cache2/")
26
26
  # copy absolute path directly
27
27
  src = @mod.out_option.starts_with?('/') ? @mod.out_option : "#{@mod.cache_dir}/#{@mod.out_option}"
28
28
  dest = "#{@mod.cache_dir}/#{plan_path}"
@@ -1,3 +1,3 @@
1
1
  module Terraspace
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.3"
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.0.0
4
+ version: 2.0.3
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-06-10 00:00:00.000000000 Z
11
+ date: 2022-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -388,6 +388,7 @@ files:
388
388
  - ".cody/unit/bin/build.sh"
389
389
  - ".cody/unit/buildspec.yml"
390
390
  - ".cody/unit/project.rb"
391
+ - ".github/FUNDING.yml"
391
392
  - ".github/ISSUE_TEMPLATE.md"
392
393
  - ".github/ISSUE_TEMPLATE/bug_report.md"
393
394
  - ".github/ISSUE_TEMPLATE/documentation.md"