lib/cicd/builder/manifest/mixlib/repo/artifactory.rb in manifest-builder-0.5.4 vs lib/cicd/builder/manifest/mixlib/repo/artifactory.rb in manifest-builder-0.5.5
- old
+ new
@@ -1,6 +1,7 @@
require 'artifactory'
+require 'tmpdir'
module CiCd
module Builder
# noinspection RubySuperCallWithoutSuperclassInspection
module Manifest
@@ -76,13 +77,29 @@
manifest_data += "#{k}=#{v}\n"
end
end
amn = artifactory_manifest_name # Just using a local iso invoking method_missing repeatedly ... ;)
data = {module: amn, data: manifest_data, version: @vars[:build_ver], build: @vars[:build_num], properties: @properties_matrix}
- tempArtifactFile(amn, data)
+ # tempArtifactFile(amn, data)
+
+ data[:file] = Dir::Tmpname.create(amn) do |tmpnam, n, opts|
+ mode = File::RDWR|File::CREAT|File::EXCL
+ perm = 0600
+ opts = perm
+ end + '.properties'
+ IO.write(data[:file], data[:data])
+
data[:sha1] = Digest::SHA1.file(data[:file]).hexdigest
data[:md5] = Digest::MD5.file(data[:file]).hexdigest
data[:name] = amn
+ # data[:temp] = false
+ # @builder.addArtifact(@vars[:artifacts], local, local_dir, {module: comp[0], name: comp[0], build: build, version: version, file: local})
+ @vars[:artifacts].unshift({
+ key: amn,
+ data: data.dup,
+ })
+ manifest[amn]={ amn => "#{@vars[:build_ver]}-#{@vars[:build_num]}" }
+
maybeUploadArtifactoryObject(data: data, artifact_module: amn, artifact_version: data[:version] || @vars[:version], file_name: '', file_ext: 'properties')
end
# ---------------------------------------------------------------------------------------------------------------
def createProductManifests(manifest)