clc-promote 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/promote/cookbook.rb +29 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddd4e5a4f6e058ab00b7a7ffd4e825c789c13f34
|
4
|
+
data.tar.gz: dc18d819f21b0b41f8accc45ab09d247161adbe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc2f696b503abdc2fdba35556453a0abf26f275e1e5691731d0907f6ea25f435971e8d70a9b344bb607ff5a9aa21831ee098c654c1a73ebb498a60ab6e81e0d7
|
7
|
+
data.tar.gz: 85258c220d03dc349abe15370b1295500d129bd0a5a5a1fc464305628eaa34bf29c3ce50ec6270d674c789d9998a39116d71f79e973fb77931f533d1a825628b
|
data/lib/promote/cookbook.rb
CHANGED
@@ -11,7 +11,7 @@ module Promote
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def dependencies
|
14
|
-
@dependencies ||=
|
14
|
+
@dependencies ||= get_synced_dependencies_from_lockfile
|
15
15
|
end
|
16
16
|
|
17
17
|
def metadata_dependencies
|
@@ -58,7 +58,23 @@ module Promote
|
|
58
58
|
return if berksfile.nil?
|
59
59
|
|
60
60
|
update = false unless File.exist?("#{@berks_path}.lock")
|
61
|
-
update ?
|
61
|
+
update ? berksfile_update : berksfile.install
|
62
|
+
end
|
63
|
+
|
64
|
+
def dependencies_changed_after_update?
|
65
|
+
old_deps = dependencies
|
66
|
+
sync_berksfile(true)
|
67
|
+
new_deps = get_dependencies_from_lockfile
|
68
|
+
|
69
|
+
return true unless old_deps.count == new_deps.count
|
70
|
+
|
71
|
+
old_deps.each do |k,v|
|
72
|
+
if k != @name
|
73
|
+
return true unless new_deps[k] == v
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
return false
|
62
78
|
end
|
63
79
|
|
64
80
|
def sync_latest_app_cookbooks(environment_cookbook_name)
|
@@ -68,11 +84,10 @@ module Promote
|
|
68
84
|
env_cookbook.metadata_dependencies do |key|
|
69
85
|
latest_version = latest_server_cookbooks[key]['versions'][0]
|
70
86
|
if dependencies.keys.include?(key) && latest_version > dependencies[key].to_s
|
71
|
-
|
87
|
+
berksfile_update(key)
|
72
88
|
result[key] = latest_version
|
73
89
|
end
|
74
90
|
end
|
75
|
-
@dependencies = nil unless result.keys.empty?
|
76
91
|
result
|
77
92
|
end
|
78
93
|
|
@@ -96,8 +111,12 @@ module Promote
|
|
96
111
|
metadata
|
97
112
|
end
|
98
113
|
|
99
|
-
def
|
114
|
+
def get_synced_dependencies_from_lockfile
|
100
115
|
berksfile.install
|
116
|
+
get_dependencies_from_lockfile
|
117
|
+
end
|
118
|
+
|
119
|
+
def get_dependencies_from_lockfile
|
101
120
|
berks_deps = berksfile.list
|
102
121
|
deps = {}
|
103
122
|
|
@@ -110,5 +129,10 @@ module Promote
|
|
110
129
|
Berkshelf.set_format :null
|
111
130
|
Berkshelf::Berksfile.from_file(@berks_path)
|
112
131
|
end
|
132
|
+
|
133
|
+
def berksfile_update(cookbooks = nil)
|
134
|
+
berksfile.update(cookbooks)
|
135
|
+
@dependencies = nil
|
136
|
+
end
|
113
137
|
end
|
114
138
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clc-promote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CenturyLink Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clc-git
|