manifest-builder 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f64453fb19e30cbd7065f1b958724c4ba5ae1ba6
4
- data.tar.gz: 6c5e2f18acbffd7f46b3b1cae785ce172c0422db
3
+ metadata.gz: 5fca672bc384323782ececfc914b4aad61b66e6e
4
+ data.tar.gz: 361f062381aa0c5725298087193aefd0ec13a18e
5
5
  SHA512:
6
- metadata.gz: 742e68dcdf78eaac4efda5e1616d9702f99857bd8075b0366951d14f2ca7fa47cc85f24e8059d925064aab04052bd23d1cdadb7ef6d71d3deb31381b40753168
7
- data.tar.gz: 89c2af981a892260f5126e64b9bd31e286cbe35c7414b06d719b4f7c3ac091c947a70e188b967a9c483625e5061d8a081b312c062e3b28ac0ad7a982a7c42453
6
+ metadata.gz: df05492e33d0542fb90fd4b803735e7b3729cbabf0822ae5ec965993d012b679b9f3c9a8ce64f296fa32691c4a484094530a9174abbebff51396196fa9356c37
7
+ data.tar.gz: 992e851fe4f11a89b2a5794195e954313ecba00e07f1a7ba95dcb6e883cc414f41b84b88ba9e8ab05de3e10906e5534da2616b07c241deacf35541753768cea4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- manifest-builder (0.5.5)
4
+ manifest-builder (0.5.6)
5
5
  archive-tar-minitar (= 0.5.2)
6
6
  chefrepo-builder (>= 0.9.27, < 1.1)
7
7
  cicd-builder (>= 0.9.38, < 1.1)
@@ -38,6 +38,18 @@ module CiCd
38
38
  end
39
39
  end
40
40
  end
41
+ @vars[:artifacts].each do |art|
42
+ if art[:data][:temp].is_a?(FalseClass)
43
+ if File.exists?(art[:data][:file])
44
+ File.unlink(art[:data][:file]) if File.exists?(art[:data][:file])
45
+ art[:data].delete(:file)
46
+ art[:data].delete(:temp)
47
+ else
48
+ @logger.warn "Temporary file disappeared: #{data.ai}"
49
+ @vars[:return_code] = Errors::TEMP_FILE_MISSING
50
+ end
51
+ end
52
+ end
41
53
  @vars[:return_code]
42
54
  end
43
55
 
@@ -87,16 +99,14 @@ module CiCd
87
99
  opts = perm
88
100
  end + '.properties'
89
101
  IO.write(data[:file], data[:data])
90
-
102
+ data[:temp] = false
91
103
  data[:sha1] = Digest::SHA1.file(data[:file]).hexdigest
92
- data[:md5] = Digest::MD5.file(data[:file]).hexdigest
104
+ data[:md5] = Digest::MD5.file(data[:file]).hexdigest
93
105
  data[:name] = amn
94
- # data[:temp] = false
95
- # @builder.addArtifact(@vars[:artifacts], local, local_dir, {module: comp[0], name: comp[0], build: build, version: version, file: local})
96
- @vars[:artifacts].unshift({
97
- key: amn,
98
- data: data.dup,
99
- })
106
+ @vars[:artifacts] << {
107
+ key: amn,
108
+ data: data.dup,
109
+ }
100
110
  manifest[amn]={ amn => "#{@vars[:build_ver]}-#{@vars[:build_num]}" }
101
111
 
102
112
  maybeUploadArtifactoryObject(data: data, artifact_module: amn, artifact_version: data[:version] || @vars[:version], file_name: '', file_ext: 'properties')
@@ -104,16 +114,31 @@ module CiCd
104
114
 
105
115
  # ---------------------------------------------------------------------------------------------------------------
106
116
  def createProductManifests(manifest)
107
- manifest.each do |mod, man|
117
+ manifest.dup.each do |mod, man|
108
118
  manifest_data = ''
109
119
  man.each do |k, v|
110
120
  manifest_data += "#{k}=#{v}\n"
111
121
  end
112
122
  data = {module: mod, data: manifest_data, version: @vars[:build_ver], build: @vars[:build_num], properties: @properties_matrix}
113
- tempArtifactFile("#{mod}-manifest", data)
123
+ # tempArtifactFile("#{mod}-manifest", data)
124
+
125
+ data[:file] = Dir::Tmpname.create("#{mod}-manifest") do |tmpnam, n, opts|
126
+ mode = File::RDWR|File::CREAT|File::EXCL
127
+ perm = 0600
128
+ opts = perm
129
+ end + '.properties'
130
+ IO.write(data[:file], data[:data])
131
+ data[:temp] = false
114
132
  data[:sha1] = Digest::SHA1.file(data[:file]).hexdigest
115
- data[:md5] = Digest::MD5.file(data[:file]).hexdigest
133
+ data[:md5] = Digest::MD5.file(data[:file]).hexdigest
116
134
  data[:name] = "#{mod}-manifest"
135
+ @vars[:artifacts] << {
136
+ key: "#{mod}-manifest",
137
+ data: data.dup,
138
+ }
139
+ # noinspection RubyStringKeysInHashInspection
140
+ manifest["#{mod}-manifest"]={ "#{mod}-manifest" => "#{@vars[:build_ver]}-#{@vars[:build_num]}" }
141
+
117
142
  maybeUploadArtifactoryObject(data: data, artifact_module: data[:name], artifact_version: data[:version] || @vars[:version], file_name: '', file_ext: 'properties') # -#{@vars[:variant]}
118
143
  end
119
144
  end
@@ -2,7 +2,7 @@ module CiCd
2
2
  module Builder
3
3
  module Manifest
4
4
  # manifest-builder version
5
- VERSION = '0.5.5'
5
+ VERSION = '0.5.6'
6
6
  MAJOR, MINOR, TINY = VERSION.split('.')
7
7
  PATCH = TINY
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manifest-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christo De Lange