batali-tk 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/batali-tk.gemspec +1 -1
- data/bin/batali-tk +10 -3
- data/lib/batali-tk/provisioner.rb +38 -17
- data/lib/batali-tk/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86d46ac8fcec3698fa480ebcd8994a6e955608dc
|
4
|
+
data.tar.gz: c322dcd58a4ad29bcc2aca6942c0efe993f9661a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 440ece530e06205ac4495388866017980a4a3533104a7951ade18280d19c5dff7039264bb50b47b2f478325bfb4ff7e8ed1f650e191c61a0e5f9486b03750972
|
7
|
+
data.tar.gz: 9097f9fbc9bd7bd3d50e62565cdd2d5ad16b5dfec5f2ceed97d017836ea5d06ab94a76386906689e78b003f84e36cde544cb0ecd468965f62d3c5e27ddcaf097
|
data/CHANGELOG.md
CHANGED
data/batali-tk.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.description = 'Batali support injector for test kitchen'
|
11
11
|
s.require_path = 'lib'
|
12
12
|
s.license = 'Apache 2.0'
|
13
|
-
s.add_runtime_dependency 'batali', '>= 0.2.33', '<
|
13
|
+
s.add_runtime_dependency 'batali', '>= 0.2.33', '< 0.5'
|
14
14
|
s.add_runtime_dependency 'test-kitchen', BataliTk::TK_CONSTRAINT
|
15
15
|
s.executables << 'batali-tk'
|
16
16
|
s.files = Dir['{lib,bin}/**/**/*'] + %w(batali-tk.gemspec README.md CHANGELOG.md CONTRIBUTING.md LICENSE)
|
data/bin/batali-tk
CHANGED
@@ -3,16 +3,22 @@
|
|
3
3
|
Signal.trap("INT") { exit 1 }
|
4
4
|
require 'bogo'
|
5
5
|
require 'batali'
|
6
|
+
require 'tmpdir'
|
6
7
|
|
7
8
|
if(idx = ARGV.index('--batali-cookbook-path'))
|
9
|
+
cache_path = Dir.mktmpdir('batali-tk-cache')
|
8
10
|
_, cookbook_path = ARGV.slice!(idx, 2)
|
9
|
-
cookbook_info = Batali::Origin::Path.new(
|
11
|
+
cookbook_info = Batali::Origin::Path.new(
|
12
|
+
:name => 'metadata',
|
13
|
+
:path => File.expand_path(cookbook_path),
|
14
|
+
:cache_path => cache_path
|
15
|
+
)
|
10
16
|
cookbook_name = cookbook_info.units.first.name
|
11
17
|
ckbk_batali = File.join(File.expand_path(cookbook_path), 'Batali')
|
12
|
-
origin_batali = Batali::BFile.new(File.expand_path('./Batali'))
|
18
|
+
origin_batali = Batali::BFile.new(File.expand_path('./Batali'), cache_path)
|
13
19
|
origin_batali.cookbook.delete_if{|item| item.name == cookbook_name}
|
14
20
|
if(File.exists?(ckbk_batali))
|
15
|
-
ckbk_b = Batali::BFile.new(ckbk_batali)
|
21
|
+
ckbk_b = Batali::BFile.new(ckbk_batali, cache_path)
|
16
22
|
new_batali_data = MultiJson.dump(
|
17
23
|
MultiJson.load(
|
18
24
|
MultiJson.dump(ckbk_b.data)
|
@@ -52,6 +58,7 @@ if(idx = ARGV.index('--batali-cookbook-path'))
|
|
52
58
|
ENV['KITCHEN_YAML'] = File.expand_path(
|
53
59
|
File.join('.', cookbook_path, '.kitchen.yml')
|
54
60
|
)
|
61
|
+
FileUtils.rm_rf(cache_path)
|
55
62
|
puts "!! Batali test-kitchen infra-repo override for `#{cookbook_name}` @ `#{cookbook_path}`"
|
56
63
|
end
|
57
64
|
if(idx = ARGV.index('--batali-environment'))
|
@@ -48,32 +48,53 @@ module Kitchen
|
|
48
48
|
debug "Using Batali file located at: #{batali_file}"
|
49
49
|
output = ''
|
50
50
|
begin
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
if(ENV['KITCHEN_BATALI_FILE'])
|
52
|
+
debug 'Running Batali resolution in full vendor directory isolation'
|
53
|
+
FileUtils.cp(
|
54
|
+
batali_file,
|
55
|
+
File.join(
|
56
|
+
File.dirname(vendor_path),
|
57
|
+
'Batali'
|
58
|
+
)
|
56
59
|
)
|
57
|
-
|
58
|
-
|
60
|
+
Dir.chdir(File.dirname(vendor_path)) do
|
61
|
+
::Batali::Command::Update.new(
|
62
|
+
Smash.new(
|
63
|
+
:path => vendor_path,
|
64
|
+
:update => {
|
65
|
+
:install => true,
|
66
|
+
:environment => ENV['KITCHEN_BATALI_ENVIRONMENT'],
|
67
|
+
:infrastructure => false
|
68
|
+
},
|
69
|
+
:ui => Bogo::Ui.new(
|
70
|
+
:app_name => 'Batali',
|
71
|
+
:output_to => StringIO.new(output)
|
72
|
+
),
|
73
|
+
),
|
74
|
+
[]
|
75
|
+
).execute!
|
76
|
+
end
|
77
|
+
else
|
59
78
|
::Batali::Command::Update.new(
|
60
79
|
Smash.new(
|
61
|
-
|
62
|
-
|
63
|
-
:
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
:
|
69
|
-
|
80
|
+
:file => batali_file,
|
81
|
+
:path => vendor_path,
|
82
|
+
:update => {
|
83
|
+
:install => true,
|
84
|
+
:environment => ENV['KITCHEN_BATALI_ENVIRONMENT'],
|
85
|
+
:infrastructure => false
|
86
|
+
},
|
87
|
+
:ui => Bogo::Ui.new(
|
88
|
+
:app_name => 'Batali',
|
89
|
+
:output_to => StringIO.new(output)
|
90
|
+
),
|
70
91
|
),
|
71
|
-
),
|
72
92
|
[]
|
73
93
|
).execute!
|
74
94
|
end
|
75
95
|
rescue => e
|
76
96
|
error "Batali failed to install cookbooks! #{e.class}: #{e}"
|
97
|
+
raise e
|
77
98
|
end
|
78
99
|
debug "Batali output:\n#{output}"
|
79
100
|
end
|
data/lib/batali-tk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: batali-tk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: batali
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 0.2.33
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '0.5'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 0.2.33
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '0.5'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: test-kitchen
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|