cicd-builder 0.9.62 → 0.9.63

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9f762dfe4a6bf7cb39d6fe1dde6a0975fb27db3
4
- data.tar.gz: 0b32e2b4a2eea3eb9b630e94e1dd643c0128321d
3
+ metadata.gz: cbcaaea56aeb6d58f0c6619e14c97ada2f896edb
4
+ data.tar.gz: 7155296c173631359b1fd1b9b52582af4dc5998c
5
5
  SHA512:
6
- metadata.gz: 7c9a6463ebc0d75ff2498dbfa4f9a1e2702920e963ca2cc0a58853e0723b8827de16c67a27eb58c64fc8bff6ad57c324b672fe0a8c052237ee04bdb05a19a5f0
7
- data.tar.gz: 4b5230a04e1781dac45f29fa60aa5beeff34ccf8e607801ca55ff96baeb59cbc566f59eb4b941bbfbac9dd40a9e24a612d4d53ab81db27f25f7d57f91a8da383
6
+ metadata.gz: fc2f8a8a8ee4e7252ba7f38cc2f8985f1a7d65ba1f0baafff162497b880bab4d2f09875f75bb2f1490c56ea2437329ac2c87bd2e248ad1143a88a8fd880e696b
7
+ data.tar.gz: 6ecc482d13efe1ff3b3459739de14a6939ab10a4b04ef2c5b106ff83eb238a793e7c26e8191387dae284fe822d3c3540e23b9a67dd3c965e3423095b6aeefa72
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cicd-builder (0.9.62)
4
+ cicd-builder (0.9.63)
5
5
  artifactory (>= 2.2.1, < 2.3)
6
6
  awesome_print (>= 1.6, < 2.0)
7
7
  aws-sdk (>= 2.0, < 2.1)
@@ -20,14 +20,14 @@ GEM
20
20
  specs:
21
21
  artifactory (2.2.1)
22
22
  awesome_print (1.6.1)
23
- aws-sdk (2.0.41)
24
- aws-sdk-resources (= 2.0.41)
25
- aws-sdk-core (2.0.41)
23
+ aws-sdk (2.0.42)
24
+ aws-sdk-resources (= 2.0.42)
25
+ aws-sdk-core (2.0.42)
26
26
  builder (~> 3.0)
27
27
  jmespath (~> 1.0)
28
28
  multi_json (~> 1.0)
29
- aws-sdk-resources (2.0.41)
30
- aws-sdk-core (= 2.0.41)
29
+ aws-sdk-resources (2.0.42)
30
+ aws-sdk-core (= 2.0.42)
31
31
  builder (3.2.2)
32
32
  chef (12.0.3)
33
33
  chef-zero (~> 3.2)
@@ -112,7 +112,7 @@ GEM
112
112
  coderay (~> 1.1.0)
113
113
  method_source (~> 0.8.1)
114
114
  slop (~> 3.4)
115
- rack (1.6.0)
115
+ rack (1.6.1)
116
116
  rake (10.3.2)
117
117
  ruby-progressbar (1.7.5)
118
118
  rubygems-tasks (0.2.4)
@@ -209,14 +209,25 @@ module CiCd
209
209
  matched = matchArtifactoryObjects(artifact_path, data, objects)
210
210
  upload ||= (matched.size == 0)
211
211
  end
212
+ properties_matrix = {}
213
+ data.select{|k,_| not k.to_s.match(%r'^file')}.each do |k,v|
214
+ properties_matrix["product.#{k}"] = v
215
+ end
216
+ data[:properties] = properties_matrix.merge(@properties_matrix)
212
217
  if upload
213
- properties_matrix = {}
214
- data.select{|k,_| not k.to_s.eql?('file')}.each do |k,v|
215
- properties_matrix["product.#{k}"] = v
216
- end
217
- data[:properties] = properties_matrix.merge(@properties_matrix)
218
218
  objects = uploadArtifact(artifact_module, artifact_version, artifact_path, data, args[:repo])
219
219
  matched = matchArtifactoryObjects(artifact_path, data, objects)
220
+ properties = matched.map{ |artifact|
221
+ artifact.properties
222
+ }
223
+ @logger.info "Matched artifacts properties: #{properties.ai}"
224
+ matched.each { |match|
225
+ artifact = ::Artifactory::Resource::Artifact.from_url(match.uri, client: @client)
226
+ unless artifact.uri =~ %r'#{data[:properties]['product.version']}/'
227
+ @logger.error "Artifact uploaded #{artifact_module}/#{artifact_version} to #{match.uri} does not contain #{data[:properties]['product.version']}/"
228
+ @vars[:return_code] = Errors::ARTIFACT_NOT_UPLOADED
229
+ end
230
+ }
220
231
  else
221
232
  @logger.info "Keep existing #{matched.map{|o| o.attributes[:uri]}.join("\t")}"
222
233
  end
@@ -238,13 +249,28 @@ module CiCd
238
249
  matched = matchArtifactoryObjects(artifact_path, data, copies)
239
250
  upload = (matched.size == 0)
240
251
  if upload
252
+ copies = []
241
253
  objects.each do |artifact|
242
254
  copied = copyArtifact(artifact_module, artifact_version, artifact_path, artifact, args[:repo])
243
255
  unless copied.size > 0
244
256
  @vars[:return_code] = Errors::ARTIFACT_NOT_COPIED
245
257
  break
246
258
  end
259
+ copies << copied
247
260
  end
261
+ copies.flatten!
262
+ matched = matchArtifactoryObjects(artifact_path, data, copies)
263
+ properties = matched.map{ |artifact|
264
+ artifact.properties
265
+ }
266
+ @logger.info "Matched artifacts properties: #{properties.ai}"
267
+ matched.each { |match|
268
+ artifact = ::Artifactory::Resource::Artifact.from_url(match.uri, client: @client)
269
+ unless artifact.uri =~ %r'#{data[:properties]['product.version']}-#{data[:properties]['product.build']}/'
270
+ @logger.error "Artifact uploaded #{artifact_module}/#{artifact_version} to #{match.uri} does not contain #{data[:properties]['product.version']}-#{data[:properties]['product.version']}/"
271
+ @vars[:return_code] = Errors::ARTIFACT_NOT_UPLOADED
272
+ end
273
+ }
248
274
  else
249
275
  @logger.info "Keep existing #{matched.map{|o| o.attributes[:uri]}.join("\t")}"
250
276
  end
@@ -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.62'
7
+ version = '0.9.63'
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.62
4
+ version: 0.9.63
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-05-07 00:00:00.000000000 Z
11
+ date: 2015-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print