batali 0.2.30 → 0.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/batali.gemspec +1 -1
- data/lib/batali/b_file.rb +22 -0
- data/lib/batali/command/resolve.rb +50 -10
- data/lib/batali/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb8be253084c752f62ea9022af64502013512df6
|
4
|
+
data.tar.gz: 14c8943c92771c752d94825140352a39a544aec3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8098dbc72989379d75e26ec694fad5be9c041dc659638c19cf4d85aa3bf68ebed4435c21d780cbaa0e0f207ca2525784f91da1e210fe86d2cd8ddf8896f30d53
|
7
|
+
data.tar.gz: 3f6de6fe1e4cb254bbc8322673f398297f5b37e433e60d04ca355a07375b1a902a3bc261785caac0d162890fcb8dc858202d7ada8e62eed440c4766e765fab12
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# v0.2.32
|
2
|
+
* [fix] Skip constraint merging when entry is non-site sourced
|
3
|
+
* [enhancement] Support dry run in infrastructure resolve
|
4
|
+
* [enhancement] Provide colorized diff on infrastructure manifest updates via resolve
|
5
|
+
|
1
6
|
# v0.2.30
|
2
7
|
* [fix] Run world pruner prior to manifest output
|
3
8
|
* [enhancement] Provider UI context when pruning world
|
data/batali.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.require_path = 'lib'
|
12
12
|
s.license = 'Apache 2.0'
|
13
13
|
s.add_runtime_dependency 'attribute_struct', '~> 0.2.14'
|
14
|
-
s.add_runtime_dependency 'grimoire', '~> 0.2.
|
14
|
+
s.add_runtime_dependency 'grimoire', '~> 0.2.8'
|
15
15
|
s.add_runtime_dependency 'bogo', '~> 0.1.20'
|
16
16
|
s.add_runtime_dependency 'bogo-cli', '~> 0.1.23'
|
17
17
|
s.add_runtime_dependency 'bogo-config', '~> 0.1.10'
|
data/lib/batali/b_file.rb
CHANGED
@@ -54,6 +54,24 @@ module Batali
|
|
54
54
|
super
|
55
55
|
end
|
56
56
|
|
57
|
+
::Object.constants.each do |const_name|
|
58
|
+
next if const_name == :Config
|
59
|
+
const_set(const_name, ::Object.const_get(const_name))
|
60
|
+
end
|
61
|
+
|
62
|
+
def require(*args)
|
63
|
+
result = ::Kernel.require(*args)
|
64
|
+
instance_exec do
|
65
|
+
class << self
|
66
|
+
::Object.constants.each do |const_name|
|
67
|
+
next if const_name == :Config
|
68
|
+
const_set(const_name, ::Object.const_get(const_name))
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
result
|
73
|
+
end
|
74
|
+
|
57
75
|
end
|
58
76
|
|
59
77
|
# Create a new file
|
@@ -157,6 +175,10 @@ module Batali
|
|
157
175
|
c.name == ckbk_name
|
158
176
|
end
|
159
177
|
if(ckbk)
|
178
|
+
unless(ckbk.constraint)
|
179
|
+
debug "Skipping constraint merging due to lack of original constraints: #{ckbk.inspect}"
|
180
|
+
next
|
181
|
+
end
|
160
182
|
new_constraints = ckbk.constraint.dup
|
161
183
|
new_constraints += constraints
|
162
184
|
requirement = UnitRequirement.new(*new_constraints)
|
@@ -126,19 +126,59 @@ module Batali
|
|
126
126
|
solv.prune_world!
|
127
127
|
nil
|
128
128
|
end
|
129
|
-
|
130
|
-
|
131
|
-
manifest
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
129
|
+
dry_run('manifest file write') do
|
130
|
+
run_action 'Writing infrastructure manifest file' do
|
131
|
+
File.open(manifest.path, 'w') do |file|
|
132
|
+
manifest = Manifest.new(
|
133
|
+
:cookbook => solv.world.units.values.flatten,
|
134
|
+
:infrastructure => true
|
135
|
+
)
|
136
|
+
file.write MultiJson.dump(manifest, :pretty => true)
|
137
|
+
nil
|
138
|
+
end
|
137
139
|
end
|
138
140
|
end
|
139
141
|
ui.info 'Infrastructure manifest solution:'
|
140
|
-
|
141
|
-
|
142
|
+
|
143
|
+
solution_units = solv.world.units
|
144
|
+
manifest_units = Smash.new.tap do |mu|
|
145
|
+
manifest.cookbook.each do |unit|
|
146
|
+
mu[unit.name] ||= []
|
147
|
+
mu[unit.name] << unit
|
148
|
+
end
|
149
|
+
end
|
150
|
+
(solution_units.keys + manifest_units.keys).compact.uniq.sort.each do |unit_name|
|
151
|
+
if(manifest_units[unit_name])
|
152
|
+
if(solution_units[unit_name])
|
153
|
+
removed = manifest_units[unit_name].find_all do |m_unit|
|
154
|
+
solution_units[unit_name].none? do |s_unit|
|
155
|
+
m_unit.same?(s_unit)
|
156
|
+
end
|
157
|
+
end.map{|u| [u.version, :red] }
|
158
|
+
added = solution_units[unit_name].find_all do |s_unit|
|
159
|
+
manifest_units[unit_name].none? do |m_unit|
|
160
|
+
s_unit.same?(m_unit)
|
161
|
+
end
|
162
|
+
end.map{|u| [u.version, :green]}
|
163
|
+
persisted = solution_units[unit_name].find_all do |s_unit|
|
164
|
+
manifest_units[unit_name].any? do |m_unit|
|
165
|
+
s_unit.same?(m_unit)
|
166
|
+
end
|
167
|
+
end.map{|u| [u.version, nil]}
|
168
|
+
unit_versions = (removed + added + persisted).sort_by(&:first).map do |uv|
|
169
|
+
uv.last ? ui.color(uv.first.to_s, uv.last) : uv.first.to_s
|
170
|
+
end
|
171
|
+
unless(added.empty? && removed.empty?)
|
172
|
+
ui.puts "#{ui.color(unit_name, :yellow)} #{ui.color('<', :yellow)}#{unit_versions.join(ui.color(', ', :yellow))}#{ui.color('>', :yellow)}"
|
173
|
+
else
|
174
|
+
ui.puts "#{unit_name} <#{unit_versions.join(', ')}>"
|
175
|
+
end
|
176
|
+
else
|
177
|
+
ui.puts ui.color("#{unit_name} <#{manifest_units[unit_name].map(&:version).sort.map(&:to_s).join(', ')}>", :red)
|
178
|
+
end
|
179
|
+
else
|
180
|
+
ui.puts ui.color("#{unit_name} <#{solution_units[unit_name].map(&:version).sort.map(&:to_s).join(', ')}>", :green)
|
181
|
+
end
|
142
182
|
end
|
143
183
|
end
|
144
184
|
|
data/lib/batali/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: batali
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.2.
|
33
|
+
version: 0.2.8
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.2.
|
40
|
+
version: 0.2.8
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bogo
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|