Sha256: e8fcbca6bd8ca1f8eb35c986ce1d426ce529842864bbf571f7654e242e8038cc

Contents?: true

Size: 1.96 KB

Versions: 7

Compression:

Stored size: 1.96 KB

Contents

require 'artifactory'
require 'tmpdir'
require "cicd/builder/manifest/mixlib/repo/artifactory"

module CiCd
  module Builder
    # noinspection RubySuperCallWithoutSuperclassInspection
    module EnvironmentsList
      module Repo
        class Artifactory < CiCd::Builder::Manifest::Repo::Artifactory

          alias_method :super_uploadToRepo, :uploadToRepo
          # ---------------------------------------------------------------------------------------------------------------
          def uploadToRepo(artifacts)
            @logger.step CLASS+'::'+__method__.to_s
            # super_uploadToRepo(artifacts) get's the immediate parent class
            cicd_uploadToRepo(artifacts)
            # CiCd::Builder::Repo::Artifactory.instance_method(:uploadToRepo).bind(self).call(artifacts)
            if @vars[:environments][:changed]
              data = {
                         name: ENV['ARTIFACTORY_ENVIRONMENTS_MODULE'],
                       module: ENV['ARTIFACTORY_ENVIRONMENTS_MODULE'],
                         file: @vars[:environments][:file],
                      version: @vars[:environments][:version],
                        build: @vars[:build_num],
                   properties: @properties_matrix,
                         temp: false,
                         sha1: Digest::SHA1.file(@vars[:environments][:file]).hexdigest,
                          md5: Digest::MD5.file(@vars[:environments][:file]).hexdigest,
              }

              cicd_maybeUploadArtifactoryObject(
                              data: data,
                   artifact_module: data[:module],
                  artifact_version: data[:version],
                         file_name: '',
                          file_ext: File.extname(data[:file]).gsub(/^\./,''),
                              repo: ENV['ARTIFACTORY_RELEASE_REPO'],
                              copy: false
              )
            end
            @vars[:return_code]
          end

        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
environments-list-builder-0.3.4 lib/cicd/builder/environments-list/mixlib/repo/artifactory.rb
environments-list-builder-0.3.3 lib/cicd/builder/environments-list/mixlib/repo/artifactory.rb
environments-list-builder-0.3.2 lib/cicd/builder/environments-list/mixlib/repo/artifactory.rb
environments-list-builder-0.3.1 lib/cicd/builder/environments-list/mixlib/repo/artifactory.rb
environments-list-builder-0.3.0 lib/cicd/builder/environments-list/mixlib/repo/artifactory.rb
environments-list-builder-0.2.0 lib/cicd/builder/environments-list/mixlib/repo/artifactory.rb
environments-list-builder-0.1.9 lib/cicd/builder/environments-list/mixlib/repo/artifactory.rb