Class: Luna::Binary::Refresh

Inherits:
Object
  • Object
show all
Defined in:
lib/luna/binary/refresh.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#binary_pathObject

Returns the value of attribute binary_path.



8
9
10
# File 'lib/luna/binary/refresh.rb', line 8

def binary_path
  @binary_path
end

#request_result_hashObject

Returns the value of attribute request_result_hash.



9
10
11
# File 'lib/luna/binary/refresh.rb', line 9

def request_result_hash
  @request_result_hash
end

Instance Method Details

#in_framework_service(dependencies_mapper, name, version) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/luna/binary/refresh.rb', line 51

def in_framework_service(dependencies_mapper, name, version)
     dependency = dependencies_mapper[name]
    if lockfile.dependencies_mappe
    else
        
    end
end

#lockfileObject



59
60
61
# File 'lib/luna/binary/refresh.rb', line 59

def lockfile 
    return Common.instance.lockfile
end

#runObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/luna/binary/refresh.rb', line 11

def run 
    spec_repo_binary = Common.instance.createNeedFrameworkMapper
    dependencies_mapper = Common.instance.dependenciesMapper
    failList = []
    successList = []
    spec_repo_binary.each { |k,v|
        if request_result_hash[k] != nil && request_result_hash[k].include?(v)
            begin
                puts "#{k} #{v}".yellow
                
                uploader = Common.instance.upload_lockitem(dependencies_mapper,k ,binary_path, true)
                if uploader != nil
                    Delete.new(k,v).delete
                    puts "#{k} #{v} 重新制作上传".yellow
                    uploader.upload
                    successList << "#{k} #{v}"
                else
                    failList << "#{k} #{v} 失败,请确保在非二进制状态下"
                end
        
            rescue => exception
                failList << "#{k} #{v} exception:#{exception}"
            ensure
                
            end                        
        else   
          failList << "name: #{k} #{v} 在服务不存在"
        end 
    } 
    puts "-=-=-=-=-=-=-=-=重新上传的名单-=-=-=-=-=-=-=-=".yellow
    successList.each { |item|
        puts item.green
    }

    puts "-=-=-=-=-=-=-=-=失败的名单-=-=-=-=-=-=-=-=".yellow if failList.length > 0
    failList.each { |item|
        puts item.red
    }
end