terraspace 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/terraspace/all/runner.rb +1 -1
- data/lib/terraspace/app.rb +2 -0
- data/lib/terraspace/cli.rb +7 -0
- data/lib/terraspace/cli/help/force_unlock.md +7 -0
- data/lib/terraspace/compiler/strategy/mod.rb +4 -3
- data/lib/terraspace/compiler/writer.rb +7 -1
- data/lib/terraspace/core.rb +7 -0
- data/lib/terraspace/terraform/args/default.rb +8 -4
- data/lib/terraspace/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d5645441169b979490b844b27b8a6752b2ddddc05ed058c0b2681e34569a899
|
4
|
+
data.tar.gz: 2ce13fabc90ca45ba8b7ff89b452d2c210e12420b7ffbbc1c54ee5403d484a81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7230e3a06fba98b04a487f9005c6ab635560ac912f48489e35b78883908f83194cf83f567a71a6d928aba6a72498d9ebc37e56c0fdeb3b9564b2794b0d0c2e2d
|
7
|
+
data.tar.gz: 880d907e3366bf7e5af1cd2e2add2646bb44edaf153ee2742cd2f8fc0c3aeb09aed3105d531da0f9aeaa7cbbedf03ae7376e692fca20ca43cebcdf356bc97414
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@
|
|
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.6.6] - 2021-04-15
|
7
|
+
- [#101](https://github.com/boltops-tools/terraspace/pull/101) terraspace force-unlock command
|
8
|
+
- [#102](https://github.com/boltops-tools/terraspace/pull/102) fix terraspace all summarized logging
|
9
|
+
- [#103](https://github.com/boltops-tools/terraspace/pull/103) config.build.pass_files with default files use pass strategy
|
10
|
+
|
6
11
|
## [0.6.5] - 2021-03-24
|
7
12
|
- [#96](https://github.com/boltops-tools/terraspace/pull/96) terraspace fmt: ability to specific module or stack
|
8
13
|
|
@@ -104,7 +104,7 @@ module Terraspace::All
|
|
104
104
|
def run_terraspace(mod_name)
|
105
105
|
set_log_path!(mod_name)
|
106
106
|
name = command_map(@command)
|
107
|
-
o = @options.merge(mod: mod_name, yes: true, build: false, input: false)
|
107
|
+
o = @options.merge(mod: mod_name, yes: true, build: false, input: false, log_to_stderr: true)
|
108
108
|
o.merge!(quiet: false) if @command == "init" # noisy so can filter and summarize output
|
109
109
|
case @command
|
110
110
|
when "up"
|
data/lib/terraspace/app.rb
CHANGED
@@ -27,6 +27,8 @@ module Terraspace
|
|
27
27
|
config.build.cache_dir = ":CACHE_ROOT/:REGION/:ENV/:BUILD_DIR"
|
28
28
|
config.build.cache_root = nil # defaults to /full/path/to/.terraspace-cache
|
29
29
|
config.build.clean_cache = nil # defaults to /full/path/to/.terraspace-cache
|
30
|
+
config.build.default_pass_files = ["/files/"]
|
31
|
+
config.build.pass_files = []
|
30
32
|
config.bundle = ActiveSupport::OrderedOptions.new
|
31
33
|
config.bundle.logger = ts_logger
|
32
34
|
config.init = ActiveSupport::OrderedOptions.new
|
data/lib/terraspace/cli.rb
CHANGED
@@ -85,6 +85,13 @@ module Terraspace
|
|
85
85
|
Down.new(options.merge(mod: mod)).run
|
86
86
|
end
|
87
87
|
|
88
|
+
desc "force_unlock", "Calls terrform force-unlock"
|
89
|
+
long_desc Help.text(:force_unlock)
|
90
|
+
instance_option.call
|
91
|
+
def force_unlock(mod, lock_id)
|
92
|
+
Commander.new("force-unlock", options.merge(mod: mod, lock_id: lock_id)).run
|
93
|
+
end
|
94
|
+
|
88
95
|
desc "fmt", "Run terraform fmt"
|
89
96
|
long_desc Help.text(:fmt)
|
90
97
|
type_option.call
|
@@ -1,14 +1,15 @@
|
|
1
1
|
module Terraspace::Compiler::Strategy
|
2
2
|
class Mod < AbstractBase
|
3
3
|
def run
|
4
|
-
|
5
|
-
klass = strategy_class(ext)
|
4
|
+
klass = strategy_class(@src_path)
|
6
5
|
strategy = klass.new(@mod, @src_path) # IE: Terraspace::Compiler::Strategy::Mod::Rb.new
|
7
6
|
strategy.run
|
8
7
|
end
|
9
8
|
|
10
|
-
def strategy_class(
|
9
|
+
def strategy_class(path)
|
10
|
+
ext = File.extname(path).sub('.','')
|
11
11
|
return Mod::Pass if ext.empty? # infinite loop without this
|
12
|
+
return Mod::Pass if Terraspace.pass_file?(path)
|
12
13
|
"Terraspace::Compiler::Strategy::Mod::#{ext.camelize}".constantize rescue Mod::Pass
|
13
14
|
end
|
14
15
|
end
|
@@ -10,11 +10,17 @@ module Terraspace::Compiler
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def dest_path
|
13
|
-
name =
|
13
|
+
name = get_name
|
14
14
|
name = basename(name)
|
15
15
|
"#{dest_dir}/#{name}"
|
16
16
|
end
|
17
17
|
|
18
|
+
def get_name
|
19
|
+
return @dest_name if @dest_name
|
20
|
+
return @src_path if Terraspace.pass_file?(@src_path)
|
21
|
+
@src_path.sub('.rb','.tf.json')
|
22
|
+
end
|
23
|
+
|
18
24
|
def dest_dir
|
19
25
|
if @mod.is_a?(Terraspace::Mod::Remote)
|
20
26
|
File.dirname(@src_path) # for Mod::Remote src is dest
|
data/lib/terraspace/core.rb
CHANGED
@@ -51,5 +51,12 @@ module Terraspace
|
|
51
51
|
def logger=(v)
|
52
52
|
@@logger = v
|
53
53
|
end
|
54
|
+
|
55
|
+
def pass_file?(path)
|
56
|
+
pass_files = config.build.pass_files + config.build.default_pass_files
|
57
|
+
pass_files.uniq.detect do |i|
|
58
|
+
i.is_a?(Regexp) ? path =~ i : path.include?(i)
|
59
|
+
end
|
60
|
+
end
|
54
61
|
end
|
55
62
|
end
|
@@ -3,7 +3,7 @@ require "tempfile"
|
|
3
3
|
module Terraspace::Terraform::Args
|
4
4
|
class Default
|
5
5
|
def initialize(mod, name, options={})
|
6
|
-
@mod, @name, @options = mod, name, options
|
6
|
+
@mod, @name, @options = mod, name.underscore, options
|
7
7
|
@quiet = @options[:quiet].nil? ? true : @options[:quiet]
|
8
8
|
end
|
9
9
|
|
@@ -11,14 +11,18 @@ module Terraspace::Terraform::Args
|
|
11
11
|
# https://terraspace.cloud/docs/ci-automation/
|
12
12
|
ENV['TF_IN_AUTOMATION'] = '1' if @options[:auto]
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
send(
|
14
|
+
args_meth = "#{@name}_args"
|
15
|
+
if respond_to?(args_meth)
|
16
|
+
send(args_meth)
|
17
17
|
else
|
18
18
|
[]
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
def force_unlock_args
|
23
|
+
[" -force #{@options[:lock_id]}"]
|
24
|
+
end
|
25
|
+
|
22
26
|
def apply_args
|
23
27
|
args = auto_approve_arg
|
24
28
|
var_files = @options[:var_files]
|
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.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -508,6 +508,7 @@ files:
|
|
508
508
|
- lib/terraspace/cli/help/console.md
|
509
509
|
- lib/terraspace/cli/help/down.md
|
510
510
|
- lib/terraspace/cli/help/fmt.md
|
511
|
+
- lib/terraspace/cli/help/force_unlock.md
|
511
512
|
- lib/terraspace/cli/help/info.md
|
512
513
|
- lib/terraspace/cli/help/init.md
|
513
514
|
- lib/terraspace/cli/help/list.md
|