cicd-builder 0.9.33 → 0.9.35
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/Gemfile.lock +7 -7
- data/lib/cicd/builder/mixlib/errors.rb +2 -0
- data/lib/cicd/builder/mixlib/repo.rb +0 -1
- data/lib/cicd/builder/mixlib/repo/artifactory.rb +17 -45
- data/lib/cicd/builder/version.rb +1 -1
- 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: 0275855a5cc4233aa1bf72a8092e773ceb71faa9
|
4
|
+
data.tar.gz: 3c0c67c3e9a8c493d410af11236eb8611666bdc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c85c6478bf10a199d0401777194fb4900155bb6c3e06fa8d6468466aeaab58e2181d927da227ec17ad4b8f74378478afff5f1c0a6df170e1e99293712508fa5a
|
7
|
+
data.tar.gz: 4511c916fdef1e8f83a8fbabfd4b45d4901c1f654147e94fced3b7191e695cc3d7aeff615b7f8563c10d689542093bfff863f19ae425b64002b9e51d5b8b5775
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cicd-builder (0.9.
|
4
|
+
cicd-builder (0.9.35)
|
5
5
|
artifactory (>= 2.2.1, < 2.3)
|
6
6
|
awesome_print (>= 1.6, < 2.0)
|
7
7
|
aws-sdk (>= 2.0, < 2.1)
|
@@ -18,15 +18,15 @@ GEM
|
|
18
18
|
specs:
|
19
19
|
artifactory (2.2.1)
|
20
20
|
awesome_print (1.6.1)
|
21
|
-
aws-sdk (2.0.
|
22
|
-
aws-sdk-resources (= 2.0.
|
23
|
-
aws-sdk-core (2.0.
|
21
|
+
aws-sdk (2.0.30)
|
22
|
+
aws-sdk-resources (= 2.0.30)
|
23
|
+
aws-sdk-core (2.0.30)
|
24
24
|
builder (~> 3.0)
|
25
25
|
jmespath (~> 1.0)
|
26
26
|
multi_json (~> 1.0)
|
27
27
|
multi_xml (~> 0.5)
|
28
|
-
aws-sdk-resources (2.0.
|
29
|
-
aws-sdk-core (= 2.0.
|
28
|
+
aws-sdk-resources (2.0.30)
|
29
|
+
aws-sdk-core (= 2.0.30)
|
30
30
|
builder (3.2.2)
|
31
31
|
chef (12.0.3)
|
32
32
|
chef-zero (~> 3.2)
|
@@ -86,7 +86,7 @@ GEM
|
|
86
86
|
mixlib-config (2.1.0)
|
87
87
|
mixlib-log (1.6.0)
|
88
88
|
mixlib-shellout (2.0.1)
|
89
|
-
multi_json (1.
|
89
|
+
multi_json (1.11.0)
|
90
90
|
multi_xml (0.5.5)
|
91
91
|
net-dhcp (1.3.2)
|
92
92
|
net-ssh (2.9.2)
|
@@ -37,7 +37,6 @@ module CiCd
|
|
37
37
|
if clazz.is_a?(Class) and not clazz.nil?
|
38
38
|
@repo = clazz.new(self)
|
39
39
|
@vars[:return_code] = @repo.uploadBuildArtifacts()
|
40
|
-
@vars[:return_code]
|
41
40
|
else
|
42
41
|
@logger.error "CiCd::Builder::Repo::#{type} is not a valid repo class"
|
43
42
|
@vars[:return_code] = Errors::BUILDER_REPO_TYPE
|
@@ -75,11 +75,10 @@ module CiCd
|
|
75
75
|
end
|
76
76
|
# matrix = properties.map{|k,v| (v.nil? or v.empty?) ? nil : "#{k}=#{v}"}.join("\;").gsub(%r'^\;*(.*?)\;*$', '\1')
|
77
77
|
# @client.endpoint += ";#{matrix}"
|
78
|
-
@manifest = {}
|
79
78
|
artifacts.each{|art|
|
80
79
|
data = art[:data]
|
81
80
|
if data.has_key?(:data)
|
82
|
-
tempArtifactFile(
|
81
|
+
tempArtifactFile(data[:name], data)
|
83
82
|
end
|
84
83
|
if data.has_key?(:file)
|
85
84
|
data[:sha1] = Digest::SHA1.file(data[:file]).hexdigest
|
@@ -94,38 +93,9 @@ module CiCd
|
|
94
93
|
unless file_name.empty?
|
95
94
|
file_name = '_'+file_name.gsub(%r'^(\.|-|)(\w)', '\2').gsub(%r'(\.|-)+', '_')
|
96
95
|
end
|
97
|
-
maybeUploadArtifactoryObject(data, data[:module], data[:version] || @vars[:version],
|
96
|
+
maybeUploadArtifactoryObject(data: data, artifact_module: data[:module], artifact_version: data[:version] || @vars[:version], file_name: file_name, file_ext: file_ext) # -#{@vars[:variant]
|
98
97
|
break unless @vars[:return_code] == 0
|
99
98
|
}
|
100
|
-
if @vars[:return_code] == 0
|
101
|
-
manifest = @manifest.dup
|
102
|
-
manifest.each do |mod,man|
|
103
|
-
manifest_data = ''
|
104
|
-
man.each do |k,v|
|
105
|
-
manifest_data += "#{k}=#{v}\n"
|
106
|
-
end
|
107
|
-
data = { module: mod, data: manifest_data, version: @vars[:build_ver], build: @vars[:build_num], properties: @properties_matrix }
|
108
|
-
tempArtifactFile("#{mod}-manifest", data)
|
109
|
-
data[:sha1] = Digest::SHA1.file(data[:file]).hexdigest
|
110
|
-
data[:md5 ] = Digest::MD5.file(data[:file]).hexdigest
|
111
|
-
data[:name] = "#{mod}-manifest"
|
112
|
-
maybeUploadArtifactoryObject(data, data[:name], data[:version] || @vars[:version], 'properties', '') # -#{@vars[:variant]}
|
113
|
-
end
|
114
|
-
manifest_data = ''
|
115
|
-
manifest.each do |mod,man|
|
116
|
-
man.each do |k,v|
|
117
|
-
manifest_data += "#{k}=#{v}\n"
|
118
|
-
end
|
119
|
-
end
|
120
|
-
amn = artifactory_manifest_name # Just using a local iso invoking method_missing repeatedly ... ;)
|
121
|
-
data = { module: amn, data: manifest_data, version: @vars[:build_ver], build: @vars[:build_num], properties: @properties_matrix }
|
122
|
-
tempArtifactFile(amn, data)
|
123
|
-
data[:sha1] = Digest::SHA1.file(data[:file]).hexdigest
|
124
|
-
data[:md5 ] = Digest::MD5.file(data[:file]).hexdigest
|
125
|
-
data[:name] = amn
|
126
|
-
maybeUploadArtifactoryObject(data, amn, data[:version] || @vars[:version], 'properties', '') # -#{@vars[:variant]}
|
127
|
-
@manifest = manifest
|
128
|
-
end
|
129
99
|
@vars[:return_code]
|
130
100
|
end
|
131
101
|
|
@@ -144,7 +114,14 @@ module CiCd
|
|
144
114
|
return file_name, file_ext
|
145
115
|
end
|
146
116
|
|
147
|
-
|
117
|
+
# ---------------------------------------------------------------------------------------------------------------
|
118
|
+
def maybeUploadArtifactoryObject(args)
|
119
|
+
data = args[:data]
|
120
|
+
artifact_module = args[:artifact_module]
|
121
|
+
artifact_version = args[:artifact_version]
|
122
|
+
file_ext = args[:file_ext]
|
123
|
+
file_name = args[:file_name]
|
124
|
+
|
148
125
|
artifact_name = getArtifactName(data[:name], file_name, artifact_version, file_ext) # artifact_path = "#{artifactory_org_path()}/#{data[:name]}/#{data[:version]}-#{@vars[:variant]}/#{artifact_name}"
|
149
126
|
artifact_path = getArtifactPath(artifact_module, artifact_version, artifact_name)
|
150
127
|
objects = maybeArtifactoryObject(artifact_module, artifact_version, false)
|
@@ -172,6 +149,8 @@ module CiCd
|
|
172
149
|
if data[:temp]
|
173
150
|
if File.exists?(data[:file])
|
174
151
|
File.unlink(data[:file]) if File.exists?(data[:file])
|
152
|
+
data.delete(:file)
|
153
|
+
data.delete(:temp)
|
175
154
|
else
|
176
155
|
@logger.warn "Temporary file disappeared: #{data.ai}"
|
177
156
|
end
|
@@ -195,19 +174,12 @@ module CiCd
|
|
195
174
|
else
|
196
175
|
@logger.info "Keep existing #{matched.map{|o| o.attributes[:uri]}.join("\t")}"
|
197
176
|
end
|
198
|
-
if @manifest[artifact_module].nil?
|
199
|
-
@manifest[artifact_module] = {}
|
200
|
-
file_name = artifact_module
|
201
|
-
else
|
202
|
-
file_name, _ = get_artifact_file_name_ext(data)
|
203
|
-
if file_name.empty?
|
204
|
-
file_name = artifact_module
|
205
|
-
else
|
206
|
-
file_name = "#{artifact_module}#{file_name}"
|
207
|
-
end
|
208
|
-
end
|
209
|
-
@manifest[artifact_module][file_name] = artifact_version
|
210
177
|
end
|
178
|
+
args[:data] = data
|
179
|
+
args[:artifact_module] = artifact_module
|
180
|
+
args[:artifact_version] = artifact_version
|
181
|
+
args[:file_ext] = file_ext
|
182
|
+
args[:file_name] = file_name
|
211
183
|
|
212
184
|
@vars[:return_code]
|
213
185
|
end
|
data/lib/cicd/builder/version.rb
CHANGED
@@ -4,7 +4,7 @@ module CiCd
|
|
4
4
|
# file = File.expand_path("#{File.dirname(__FILE__)}/../../../VERSION")
|
5
5
|
# lines = File.readlines(file)
|
6
6
|
# version = lines[0]
|
7
|
-
version = '0.9.
|
7
|
+
version = '0.9.35'
|
8
8
|
VERSION = version unless const_defined?('VERSION')
|
9
9
|
major, minor, tiny = VERSION.split('.')
|
10
10
|
MAJOR = major unless const_defined?('MAJOR')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cicd-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christo De Lange
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|