luna-binary-uploader 0.1.16 → 0.1.20
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 +4 -4
- data/.gitignore +0 -1
- data/Gemfile.lock +174 -0
- data/bin/lbu +44 -10
- data/lib/luna/binary/analysis.rb +46 -84
- data/lib/luna/binary/build.rb +31 -24
- data/lib/luna/binary/common/common.rb +141 -16
- data/lib/luna/binary/delete.rb +4 -4
- data/lib/luna/binary/init.rb +25 -0
- data/lib/luna/binary/install.rb +38 -0
- data/lib/luna/binary/refresh.rb +39 -30
- data/lib/luna/binary/update.rb +21 -81
- data/lib/luna/binary/uploader/version.rb +1 -1
- data/lib/luna/binary/uploader.rb +52 -21
- data/lib/luna-binary-uploader.rb +9 -0
- metadata +6 -2
data/lib/luna/binary/uploader.rb
CHANGED
@@ -18,13 +18,14 @@ module Luna
|
|
18
18
|
attr_reader :rootName
|
19
19
|
attr_reader :podspecName
|
20
20
|
attr_accessor :specification
|
21
|
+
attr_accessor :local_path
|
21
22
|
|
22
23
|
def initialize(podspecName, gitUrl, gitNode, binaryPath)
|
23
24
|
@podspecName = podspecName
|
24
25
|
@gitUrl = gitUrl
|
25
26
|
@gitNode = gitNode
|
26
27
|
@binaryPath = binaryPath
|
27
|
-
@rootName =
|
28
|
+
@rootName = Common.instance.tempLunaUploaderPath + "/temp/#{podspecName}/"
|
28
29
|
validate!
|
29
30
|
end
|
30
31
|
|
@@ -44,9 +45,16 @@ module Luna
|
|
44
45
|
if @specification != nil
|
45
46
|
return @specification
|
46
47
|
end
|
47
|
-
|
48
|
-
|
49
|
-
|
48
|
+
if local_path
|
49
|
+
puts "#{local_path}"
|
50
|
+
podspecPathArr = Dir.glob(local_path)
|
51
|
+
puts "#{podspecPathArr}"
|
52
|
+
else
|
53
|
+
puts "#{rootName + "**/#{podspecName}.podspec"}"
|
54
|
+
podspecPathArr = Dir.glob(rootName + "**/#{podspecName}.podspec")
|
55
|
+
puts "#{podspecPathArr}"
|
56
|
+
end
|
57
|
+
|
50
58
|
if podspecPathArr.length == 1
|
51
59
|
podspecPath = podspecPathArr[0]
|
52
60
|
p "模块路径为" + podspecPath
|
@@ -63,11 +71,7 @@ module Luna
|
|
63
71
|
rescue => exception
|
64
72
|
|
65
73
|
ensure
|
66
|
-
|
67
|
-
command = "git clone #{gitUrl} #{@rootName}temp; cd #{@rootName}temp; git fetch --all;git stash; git checkout #{gitNode};"
|
68
|
-
p command
|
69
|
-
result = system command
|
70
|
-
end
|
74
|
+
download_git
|
71
75
|
|
72
76
|
if isHasSpecInRepo == false && isHasFrameworkInService == false
|
73
77
|
@spec = createFrameworkSpec
|
@@ -78,6 +82,31 @@ module Luna
|
|
78
82
|
end
|
79
83
|
end
|
80
84
|
|
85
|
+
def refresh_specification_work
|
86
|
+
begin
|
87
|
+
clearTempFile
|
88
|
+
rescue => exception
|
89
|
+
|
90
|
+
ensure
|
91
|
+
download_git
|
92
|
+
|
93
|
+
if isHasSpecInRepo == true && isHasFrameworkInService == true
|
94
|
+
@spec = createFrameworkSpec
|
95
|
+
write_spec_file(@spec)
|
96
|
+
else
|
97
|
+
raise "repo or 二进制服务 不存在 #{specification.name} #{specification.version}"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def download_git
|
103
|
+
command("git clone #{gitUrl} #{@rootName}temp; cd #{@rootName}temp; git fetch --all;git stash; git checkout #{gitNode};") if gitUrl && gitUrl.length > 0
|
104
|
+
end
|
105
|
+
|
106
|
+
def command(c)
|
107
|
+
return Common.instance.command(c)
|
108
|
+
end
|
109
|
+
|
81
110
|
def push
|
82
111
|
if isLocalHasFramework && isLocalHasPodSpec
|
83
112
|
pushRepo
|
@@ -88,11 +117,13 @@ module Luna
|
|
88
117
|
end
|
89
118
|
|
90
119
|
def printPreUploadCommand
|
91
|
-
if isLocalHasFramework && isLocalHasPodSpec
|
92
|
-
if
|
93
|
-
|
120
|
+
if isLocalHasFramework && isLocalHasPodSpec
|
121
|
+
if local_path
|
122
|
+
puts "lbu single #{podspecName} #{local_path} #{binaryPath}".green
|
123
|
+
elsif gitUrl && gitUrl.length == 0
|
124
|
+
puts "lbu single #{podspecName} #{specification.version} #{binaryPath}" .green
|
94
125
|
else
|
95
|
-
|
126
|
+
puts "lbu single #{podspecName} #{gitUrl} #{gitNode} #{binaryPath}".green
|
96
127
|
end
|
97
128
|
else
|
98
129
|
raise "#{specification.name} #{specification.version} repo或framework缺失"
|
@@ -140,7 +171,7 @@ module Luna
|
|
140
171
|
bundlePaths = Dir.glob("#{binaryPath}/**/#{specification.root.name}.bundle")
|
141
172
|
if bundlePaths.length > 1
|
142
173
|
# raise "findBundle:#{bundlePaths},不知道取哪个"
|
143
|
-
|
174
|
+
puts "findBundle:#{bundlePaths},不知道取哪个,做合并"
|
144
175
|
end
|
145
176
|
bundlePaths.each { |item|
|
146
177
|
system "cp -r #{item} #{moduleDirPath}"
|
@@ -291,7 +322,7 @@ module Luna
|
|
291
322
|
end
|
292
323
|
|
293
324
|
def binary_source
|
294
|
-
{ http: format(
|
325
|
+
{ http: format(Common.instance.binary_download_url, specification.root.name, specification.version), type: Common.instance.download_file_type }
|
295
326
|
end
|
296
327
|
|
297
328
|
def source_files(suffix)
|
@@ -333,7 +364,7 @@ module Luna
|
|
333
364
|
|
334
365
|
|
335
366
|
def repoPath
|
336
|
-
return
|
367
|
+
return Common.instance.repoPath
|
337
368
|
end
|
338
369
|
|
339
370
|
def isHasSpecInRepo
|
@@ -354,7 +385,7 @@ module Luna
|
|
354
385
|
end
|
355
386
|
|
356
387
|
def isHasFrameworkInService
|
357
|
-
command = "curl #{format(
|
388
|
+
command = "curl #{format(Common.instance.binary_download_url, specification.root.name, specification.version).sub("#{Common.instance.download_file_type}","")}"
|
358
389
|
p command
|
359
390
|
result = %x(#{command})
|
360
391
|
resultHash = JSON.parse(result)
|
@@ -374,7 +405,7 @@ module Luna
|
|
374
405
|
zipCommand = "cd #{rootName};zip -r #{specification.root.name}.zip #{specification.root.name}"
|
375
406
|
p zipCommand
|
376
407
|
system zipCommand
|
377
|
-
command = "cd #{rootName};curl #{
|
408
|
+
command = "cd #{rootName};curl #{Common.instance.binary_upload_url} -F \"name=#{specification.root.name}\" -F \"version=#{specification.version}\" -F \"annotate=#{specification.root.name}_#{specification.version}_log\" -F \"file=@#{specification.root.name}.zip\""
|
378
409
|
p command
|
379
410
|
system command
|
380
411
|
end
|
@@ -382,17 +413,17 @@ module Luna
|
|
382
413
|
def clearTempFile
|
383
414
|
p rootName
|
384
415
|
begin
|
385
|
-
|
416
|
+
Common.instance.deleteDirectory("#{rootName}bin-json")
|
386
417
|
rescue => exception
|
387
418
|
|
388
419
|
ensure
|
389
420
|
begin
|
390
|
-
|
421
|
+
Common.instance.deleteDirectory("#{rootName}#{podspecName}.zip")
|
391
422
|
rescue => exception
|
392
423
|
|
393
424
|
ensure
|
394
425
|
begin
|
395
|
-
|
426
|
+
Common.instance.deleteDirectory("#{rootName}#{podspecName}")
|
396
427
|
rescue => exception
|
397
428
|
|
398
429
|
ensure
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require "luna/binary/uploader"
|
2
|
+
require "luna/binary/delete"
|
3
|
+
require "luna/binary/analysis"
|
4
|
+
require "luna/binary/refresh"
|
5
|
+
require "luna/binary/build"
|
6
|
+
require "luna/binary/update"
|
7
|
+
require "luna/binary/install"
|
8
|
+
require "luna/binary/init"
|
9
|
+
require "luna/binary/common/common"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luna-binary-uploader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 车德超
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -133,15 +133,19 @@ files:
|
|
133
133
|
- ".gitignore"
|
134
134
|
- CODE_OF_CONDUCT.md
|
135
135
|
- Gemfile
|
136
|
+
- Gemfile.lock
|
136
137
|
- LICENSE.txt
|
137
138
|
- README.md
|
138
139
|
- Rakefile
|
139
140
|
- bin/lbu
|
140
141
|
- bin/setup
|
142
|
+
- lib/luna-binary-uploader.rb
|
141
143
|
- lib/luna/binary/analysis.rb
|
142
144
|
- lib/luna/binary/build.rb
|
143
145
|
- lib/luna/binary/common/common.rb
|
144
146
|
- lib/luna/binary/delete.rb
|
147
|
+
- lib/luna/binary/init.rb
|
148
|
+
- lib/luna/binary/install.rb
|
145
149
|
- lib/luna/binary/refresh.rb
|
146
150
|
- lib/luna/binary/update.rb
|
147
151
|
- lib/luna/binary/uploader.rb
|