forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinary-task.rb
1937 lines (1756 loc) · 53.9 KB
/
binary-task.rb
1
2
3
4
5
6
7
8
9
10
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
require "cgi/util"
require "digest/sha2"
require "io/console"
require "json"
require "net/http"
require "pathname"
require "tempfile"
require "thread"
require "time"
begin
require "apt-dists-merge"
rescue LoadError
warn("apt-dists-merge is needed for apt:* tasks")
end
class BinaryTask
include Rake::DSL
class ThreadPool
def initialize(use_case, &worker)
@n_workers = choose_n_workers(use_case)
@worker = worker
@jobs = Thread::Queue.new
@workers = @n_workers.times.collect do
Thread.new do
loop do
job = @jobs.pop
break if job.nil?
@worker.call(job)
end
end
end
end
def <<(job)
@jobs << job
end
def join
@n_workers.times do
@jobs << nil
end
@workers.each(&:join)
end
private
def choose_n_workers(use_case)
case use_case
when :artifactory
# Too many workers cause Artifactory error.
6
when :gpg
# Too many workers cause gpg-agent error.
2
else
raise "Unknown use case: #{use_case}"
end
end
end
class ProgressReporter
def initialize(label, count_max=0)
@label = label
@count_max = count_max
@mutex = Thread::Mutex.new
@time_start = Time.now
@time_previous = Time.now
@count_current = 0
@count_previous = 0
end
def advance
@mutex.synchronize do
@count_current += 1
return if @count_max.zero?
time_current = Time.now
if time_current - @time_previous <= 1
return
end
show_progress(time_current)
end
end
def increment_max
@mutex.synchronize do
@count_max += 1
show_progress(Time.now) if @count_max == 1
end
end
def finish
@mutex.synchronize do
return if @count_max.zero?
show_progress(Time.now)
$stderr.puts
end
end
private
def show_progress(time_current)
n_finishes = @count_current - @count_previous
throughput = n_finishes.to_f / (time_current - @time_previous)
@time_previous = time_current
@count_previous = @count_current
message = build_message(time_current, throughput)
$stderr.print("\r#{message}") if message
end
def build_message(time_current, throughput)
percent = (@count_current / @count_max.to_f) * 100
formatted_count = "[%s/%s]" % [
format_count(@count_current),
format_count(@count_max),
]
elapsed_second = time_current - @time_start
if throughput.zero?
rest_second = 0
else
rest_second = (@count_max - @count_current) / throughput
end
separator = " - "
progress = "%5.1f%% %s %s %s %s" % [
percent,
formatted_count,
format_time_interval(elapsed_second),
format_time_interval(rest_second),
format_throughput(throughput),
]
label = @label
width = guess_terminal_width
return "#{label}#{separator}#{progress}" if width.nil?
return nil if progress.size > width
label_width = width - progress.size - separator.size
if label.size > label_width
ellipsis = "..."
shorten_label_width = label_width - ellipsis.size
if shorten_label_width < 1
return progress
else
label = label[0, shorten_label_width] + ellipsis
end
end
"#{label}#{separator}#{progress}"
end
def format_count(count)
"%d" % count
end
def format_time_interval(interval)
if interval < 60
"00:00:%02d" % interval
elsif interval < (60 * 60)
minute, second = interval.divmod(60)
"00:%02d:%02d" % [minute, second]
elsif interval < (60 * 60 * 24)
minute, second = interval.divmod(60)
hour, minute = minute.divmod(60)
"%02d:%02d:%02d" % [hour, minute, second]
else
minute, second = interval.divmod(60)
hour, minute = minute.divmod(60)
day, hour = hour.divmod(24)
"%dd %02d:%02d:%02d" % [day, hour, minute, second]
end
end
def format_throughput(throughput)
"%2d/s" % throughput
end
def guess_terminal_width
guess_terminal_width_from_io ||
guess_terminal_width_from_command ||
guess_terminal_width_from_env ||
80
end
def guess_terminal_width_from_io
if IO.respond_to?(:console) and IO.console
IO.console.winsize[1]
elsif $stderr.respond_to?(:winsize)
begin
$stderr.winsize[1]
rescue SystemCallError
nil
end
else
nil
end
end
def guess_terminal_width_from_command
IO.pipe do |input, output|
begin
pid = spawn("tput", "cols", {:out => output, :err => output})
rescue SystemCallError
return nil
end
output.close
_, status = Process.waitpid2(pid)
return nil unless status.success?
result = input.read.chomp
begin
Integer(result, 10)
rescue ArgumentError
nil
end
end
end
def guess_terminal_width_from_env
env = ENV["COLUMNS"] || ENV["TERM_WIDTH"]
return nil if env.nil?
begin
Integer(env, 10)
rescue ArgumentError
nil
end
end
end
class ArtifactoryClient
class Error < StandardError
attr_reader :request
attr_reader :response
def initialize(request, response, message)
@request = request
@response = response
super(message)
end
end
def initialize(prefix, api_key)
@prefix = prefix
@api_key = api_key
@http = nil
restart
end
def restart
close
@http = start_http(build_url(""))
end
private def start_http(url, &block)
http = Net::HTTP.new(url.host, url.port)
http.set_debug_output($stderr) if ENV["DEBUG"]
http.use_ssl = true
if block_given?
http.start(&block)
else
http
end
end
def close
return if @http.nil?
@http.finish if @http.started?
@http = nil
end
def request(method, headers, url, body: nil, &block)
request = build_request(method, url, headers, body: body)
if ENV["DRY_RUN"]
case request
when Net::HTTP::Get, Net::HTTP::Head
else
p [method, url]
return
end
end
request_internal(@http, request, &block)
end
private def request_internal(http, request, &block)
http.request(request) do |response|
case response
when Net::HTTPSuccess,
Net::HTTPNotModified
if block_given?
return yield(response)
else
response.read_body
return response
end
when Net::HTTPRedirection
redirected_url = URI(response["Location"])
redirected_request = Net::HTTP::Get.new(redirected_url, {})
start_http(redirected_url) do |redirected_http|
request_internal(redirected_http, redirected_request, &block)
end
else
message = "failed to request: "
message << "#{request.uri}: #{request.method}: "
message << "#{response.message} #{response.code}"
if response.body
message << "\n"
message << response.body
end
raise Error.new(request, response, message)
end
end
end
def files
_files = []
directories = [""]
until directories.empty?
directory = directories.shift
list(directory).each do |path|
resolved_path = "#{directory}#{path}"
case path
when "../"
when /\/\z/
directories << resolved_path
else
_files << resolved_path
end
end
end
_files
end
def list(path)
url = build_url(path)
with_retry(3, url) do
begin
request(:get, {}, url) do |response|
response.body.scan(/<a href="(.+?)"/).flatten
end
rescue Error => error
case error.response
when Net::HTTPNotFound
return []
else
raise
end
end
end
end
def head(path)
url = build_url(path)
with_retry(3, url) do
request(:head, {}, url)
end
end
def exist?(path)
begin
head(path)
true
rescue Error => error
case error.response
when Net::HTTPNotFound
false
else
raise
end
end
end
def upload(path, destination_path)
destination_url = build_url(destination_path)
with_retry(3, destination_url) do
sha1 = Digest::SHA1.file(path).hexdigest
sha256 = Digest::SHA256.file(path).hexdigest
headers = {
"X-Artifactory-Last-Modified" => File.mtime(path).rfc2822,
"X-Checksum-Deploy" => "false",
"X-Checksum-Sha1" => sha1,
"X-Checksum-Sha256" => sha256,
"Content-Length" => File.size(path).to_s,
"Content-Type" => "application/octet-stream",
}
File.open(path, "rb") do |input|
request(:put, headers, destination_url, body: input)
end
end
end
def download(path, output_path=nil)
url = build_url(path)
with_retry(5, url) do
begin
begin
headers = {}
if output_path and File.exist?(output_path)
headers["If-Modified-Since"] = File.mtime(output_path).rfc2822
end
request(:get, headers, url) do |response|
case response
when Net::HTTPNotModified
else
if output_path
File.open(output_path, "wb") do |output|
response.read_body do |chunk|
output.write(chunk)
end
end
last_modified = response["Last-Modified"]
if last_modified
FileUtils.touch(output_path,
mtime: Time.rfc2822(last_modified))
end
else
response.body
end
end
end
rescue Error => error
case error.response
when Net::HTTPNotFound
$stderr.puts(error.message)
return
else
raise
end
end
end
rescue
FileUtils.rm_f(output_path)
raise
end
end
def delete(path)
url = build_url(path)
with_retry(3, url) do
request(:delete, {}, url)
end
end
def copy(source, destination)
url = build_api_url("copy/arrow/#{source}",
"to" => "/arrow/#{destination}")
with_retry(3, url) do
with_read_timeout(300) do
request(:post, {}, url)
end
end
end
private
def build_url(path)
uri_string = "https://apache.jfrog.io/artifactory/arrow"
uri_string << "/#{@prefix}" unless @prefix.nil?
uri_string << "/#{path}"
URI(uri_string)
end
def build_api_url(path, parameters)
uri_string = "https://apache.jfrog.io/artifactory/api/#{path}"
unless parameters.empty?
uri_string << "?"
escaped_parameters = parameters.collect do |key, value|
"#{CGI.escape(key)}=#{CGI.escape(value)}"
end
uri_string << escaped_parameters.join("&")
end
URI(uri_string)
end
def build_request(method, url, headers, body: nil)
need_auth = false
case method
when :head
request = Net::HTTP::Head.new(url, headers)
when :get
request = Net::HTTP::Get.new(url, headers)
when :post
need_auth = true
request = Net::HTTP::Post.new(url, headers)
when :put
need_auth = true
request = Net::HTTP::Put.new(url, headers)
when :delete
need_auth = true
request = Net::HTTP::Delete.new(url, headers)
else
raise "unsupported HTTP method: #{method.inspect}"
end
request["Connection"] = "Keep-Alive"
request["X-JFrog-Art-Api"] = @api_key if need_auth
if body
if body.is_a?(String)
request.body = body
else
request.body_stream = body
end
end
request
end
def with_retry(max_n_retries, target)
n_retries = 0
begin
yield
rescue Net::OpenTimeout,
OpenSSL::OpenSSLError,
SocketError,
SystemCallError,
Timeout::Error => error
n_retries += 1
if n_retries <= max_n_retries
$stderr.puts
$stderr.puts("Retry #{n_retries}: #{target}: " +
"#{error.class}: #{error.message}")
restart
retry
else
raise
end
end
end
def with_read_timeout(timeout)
current_timeout = @http.read_timeout
begin
@http.read_timeout = timeout
yield
ensure
@http.read_timeout = current_timeout
end
end
end
class ArtifactoryClientPool
class << self
def open(prefix, api_key)
pool = new(prefix, api_key)
begin
yield(pool)
ensure
pool.close
end
end
end
def initialize(prefix, api_key)
@prefix = prefix
@api_key = api_key
@mutex = Thread::Mutex.new
@clients = []
end
def pull
client = @mutex.synchronize do
if @clients.empty?
ArtifactoryClient.new(@prefix, @api_key)
else
@clients.pop
end
end
begin
yield(client)
ensure
release(client)
end
end
def release(client)
@mutex.synchronize do
@clients << client
end
end
def close
@clients.each(&:close)
end
end
module ArtifactoryPath
private
def base_path
path = @distribution
path += "-staging"
path
end
def rc_base_path
base_path + "-rc"
end
def release_base_path
base_path
end
def target_base_path
if @rc
rc_base_path
else
release_base_path
end
end
end
class ArtifactoryDownloader
include ArtifactoryPath
def initialize(api_key:,
destination:,
distribution:,
pattern: nil,
prefix: nil,
rc: nil,
staging: false)
@api_key = api_key
@destination = destination
@distribution = distribution
@pattern = pattern
@prefix = prefix
@rc = rc
@staging = staging
end
def download
progress_label = "Downloading: #{target_base_path}"
progress_reporter = ProgressReporter.new(progress_label)
prefix = [target_base_path, @prefix].compact.join("/")
ArtifactoryClientPool.open(prefix, @api_key) do |client_pool|
thread_pool = ThreadPool.new(:artifactory) do |path, output_path|
client_pool.pull do |client|
client.download(path, output_path)
end
progress_reporter.advance
end
files = client_pool.pull do |client|
client.files
end
files.each do |path|
output_path = "#{@destination}/#{path}"
if @pattern
next unless @pattern.match?(path)
end
yield(output_path)
output_dir = File.dirname(output_path)
FileUtils.mkdir_p(output_dir)
progress_reporter.increment_max
thread_pool << [path, output_path]
end
thread_pool.join
end
progress_reporter.finish
end
end
class ArtifactoryUploader
include ArtifactoryPath
def initialize(api_key:,
destination_prefix: nil,
distribution:,
rc: nil,
source:,
staging: false,
sync: false,
sync_pattern: nil)
@api_key = api_key
@destination_prefix = destination_prefix
@distribution = distribution
@rc = rc
@source = source
@staging = staging
@sync = sync
@sync_pattern = sync_pattern
end
def upload
progress_label = "Uploading: #{target_base_path}"
progress_reporter = ProgressReporter.new(progress_label)
prefix = target_base_path
prefix += "/#{@destination_prefix}" if @destination_prefix
ArtifactoryClientPool.open(prefix, @api_key) do |client_pool|
if @sync
existing_files = client_pool.pull do |client|
client.files
end
else
existing_files = []
end
thread_pool = ThreadPool.new(:artifactory) do |path, relative_path|
client_pool.pull do |client|
client.upload(path, relative_path)
end
progress_reporter.advance
end
source = Pathname(@source)
source.glob("**/*") do |path|
next if path.directory?
destination_path = path.relative_path_from(source)
progress_reporter.increment_max
existing_files.delete(destination_path.to_s)
thread_pool << [path, destination_path]
end
thread_pool.join
if @sync
thread_pool = ThreadPool.new(:artifactory) do |path|
client_pool.pull do |client|
client.delete(path)
end
progress_reporter.advance
end
existing_files.each do |path|
if @sync_pattern
next unless @sync_pattern.match?(path)
end
progress_reporter.increment_max
thread_pool << path
end
thread_pool.join
end
end
progress_reporter.finish
end
end
class ArtifactoryReleaser
include ArtifactoryPath
def initialize(api_key:,
distribution:,
list: nil,
rc_prefix: nil,
release_prefix: nil,
staging: false)
@api_key = api_key
@distribution = distribution
@list = list
@rc_prefix = rc_prefix
@release_prefix = release_prefix
@staging = staging
end
def release
progress_label = "Releasing: #{release_base_path}"
progress_reporter = ProgressReporter.new(progress_label)
rc_prefix = [rc_base_path, @rc_prefix].compact.join("/")
release_prefix = [release_base_path, @release_prefix].compact.join("/")
ArtifactoryClientPool.open(rc_prefix, @api_key) do |client_pool|
thread_pool = ThreadPool.new(:artifactory) do |path, release_path|
client_pool.pull do |client|
client.copy(path, release_path)
end
progress_reporter.advance
end
files = client_pool.pull do |client|
if @list
client.download(@list, nil).lines(chomp: true)
else
client.files
end
end
files.each do |path|
progress_reporter.increment_max
rc_path = "#{rc_prefix}/#{path}"
release_path = "#{release_prefix}/#{path}"
thread_pool << [rc_path, release_path]
end
thread_pool.join
end
progress_reporter.finish
end
end
def define
define_apt_tasks
define_yum_tasks
define_docs_tasks
define_nuget_tasks
define_python_tasks
define_summary_tasks
end
private
def env_value(name)
value = ENV[name]
value = yield(name) if value.nil? and block_given?
raise "Specify #{name} environment variable" if value.nil?
value
end
def verbose?
ENV["VERBOSE"] == "yes"
end
def default_output
if verbose?
$stdout
else
IO::NULL
end
end
def gpg_key_id
env_value("GPG_KEY_ID")
end
def shorten_gpg_key_id(id)
id[-8..-1]
end
def rpm_gpg_key_package_name(id)
"gpg-pubkey-#{shorten_gpg_key_id(id).downcase}"
end
def artifactory_api_key
env_value("ARTIFACTORY_API_KEY")
end
def artifacts_dir
env_value("ARTIFACTS_DIR")
end
def version
env_value("VERSION")
end
def rc
env_value("RC")
end
def staging?
ENV["STAGING"] == "yes"
end
def full_version
"#{version}-rc#{rc}"
end
def valid_sign?(path, sign_path)
IO.pipe do |input, output|
begin
sh({"LANG" => "C"},
"gpg",
"--verify",
sign_path,
path,
out: default_output,
err: output,
verbose: false)
rescue
return false
end
output.close
/Good signature/ === input.read
end
end
def sign(source_path, destination_path)
if File.exist?(destination_path)
return if valid_sign?(source_path, destination_path)
rm(destination_path, verbose: false)
end
sh("gpg",
"--detach-sig",
"--local-user", gpg_key_id,
"--output", destination_path,
source_path,
out: default_output,
verbose: verbose?)
end
def sha512(source_path, destination_path)
if File.exist?(destination_path)
sha512 = File.read(destination_path).split[0]
return if Digest::SHA512.file(source_path).hexdigest == sha512
end
absolute_destination_path = File.expand_path(destination_path)
Dir.chdir(File.dirname(source_path)) do
sh("shasum",
"--algorithm", "512",
File.basename(source_path),
out: absolute_destination_path,
verbose: verbose?)
end
end
def sign_dir(label, dir)
progress_label = "Signing: #{label}"
progress_reporter = ProgressReporter.new(progress_label)
target_paths = []
Pathname(dir).glob("**/*") do |path|
next if path.directory?
case path.extname
when ".asc", ".sha512"
next
end
progress_reporter.increment_max
target_paths << path.to_s
end
target_paths.each do |path|
sign(path, "#{path}.asc")
sha512(path, "#{path}.sha512")
progress_reporter.advance
end
progress_reporter.finish
end
def download_distribution(distribution,
destination,
target,
pattern: nil,
prefix: nil)
mkdir_p(destination, verbose: verbose?) unless File.exist?(destination)
existing_paths = {}
Pathname(destination).glob("**/*") do |path|
next if path.directory?
existing_paths[path.to_s] = true
end
options = {
api_key: artifactory_api_key,
destination: destination,
distribution: distribution,
pattern: pattern,
prefix: prefix,
staging: staging?,
}
options[:rc] = rc if target == :rc
downloader = ArtifactoryDownloader.new(**options)
downloader.download do |output_path|
existing_paths.delete(output_path)
end
existing_paths.each_key do |path|
rm_f(path, verbose: verbose?)
end
end
def release_distribution(distribution,
list: nil,
rc_prefix: nil,
release_prefix: nil)
options = {
api_key: artifactory_api_key,
distribution: distribution,
list: list,
rc_prefix: rc_prefix,
release_prefix: release_prefix,
staging: staging?,
}
releaser = ArtifactoryReleaser.new(**options)
releaser.release
end
def same_content?(path1, path2)
File.exist?(path1) and
File.exist?(path2) and
Digest::SHA256.file(path1) == Digest::SHA256.file(path2)
end
def copy_artifact(source_path,
destination_path,
progress_reporter)
return if same_content?(source_path, destination_path)
progress_reporter.increment_max
destination_dir = File.dirname(destination_path)
unless File.exist?(destination_dir)
mkdir_p(destination_dir, verbose: verbose?)
end
cp(source_path, destination_path, verbose: verbose?)
progress_reporter.advance
end
def prepare_staging(base_path)
client = ArtifactoryClient.new(nil, artifactory_api_key)