artifactory-cleaner 1.0.3 → 1.0.4
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/.rspec_status +34 -34
- data/CHANGELOG.md +4 -0
- data/Gemfile +4 -1
- data/lib/artifactory/cleaner/cli.rb +22 -22
- data/lib/artifactory/cleaner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 651c4273cd326a97138339f39293a026ce2803f78c64ddde62efed509e664402
|
|
4
|
+
data.tar.gz: d197cf8c783f274eeed318d793cc0568a7a348c7f6badf4c8eb66c5aaa7d783f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 65103fc134d051f65782980c236676f6d03dcc0bbf87461892671162ad07582ea782aadd4433d482dd4c475f8f52607998253506bf1795b298710e78fa32bf49
|
|
7
|
+
data.tar.gz: 7f7f3aef50dd02503c975c7fbd85fded4a851a352156e8f94aa842a3268f409100cd53a36e9401064ee41309eb1242192193eecec9983921e12ae6ef19ec25eb
|
data/.rspec_status
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
example_id | status | run_time |
|
|
2
2
|
-------------------------------------------- | ------ | --------------- |
|
|
3
|
-
./spec/artifactory/cleaner_spec.rb[1:1] | passed | 0.
|
|
4
|
-
./spec/artifactory/cleaner_spec.rb[1:2:1] | passed | 0.
|
|
5
|
-
./spec/artifactory/cleaner_spec.rb[1:2:2] | passed | 0.
|
|
6
|
-
./spec/artifactory/cleaner_spec.rb[1:2:3] | passed | 0.
|
|
7
|
-
./spec/artifactory/cleaner_spec.rb[1:2:4] | passed | 0.
|
|
8
|
-
./spec/artifactory/cleaner_spec.rb[1:2:5] | passed | 0.
|
|
9
|
-
./spec/artifactory/cleaner_spec.rb[1:2:6] | passed | 0.
|
|
10
|
-
./spec/artifactory/cleaner_spec.rb[1:2:7:1] | passed | 0.
|
|
11
|
-
./spec/artifactory/cleaner_spec.rb[1:2:7:2] | passed | 0.
|
|
12
|
-
./spec/artifactory/cleaner_spec.rb[1:2:7:3] | passed | 0.
|
|
3
|
+
./spec/artifactory/cleaner_spec.rb[1:1] | passed | 0.00158 seconds |
|
|
4
|
+
./spec/artifactory/cleaner_spec.rb[1:2:1] | passed | 0.00164 seconds |
|
|
5
|
+
./spec/artifactory/cleaner_spec.rb[1:2:2] | passed | 0.00011 seconds |
|
|
6
|
+
./spec/artifactory/cleaner_spec.rb[1:2:3] | passed | 0.00077 seconds |
|
|
7
|
+
./spec/artifactory/cleaner_spec.rb[1:2:4] | passed | 0.00007 seconds |
|
|
8
|
+
./spec/artifactory/cleaner_spec.rb[1:2:5] | passed | 0.00011 seconds |
|
|
9
|
+
./spec/artifactory/cleaner_spec.rb[1:2:6] | passed | 0.00179 seconds |
|
|
10
|
+
./spec/artifactory/cleaner_spec.rb[1:2:7:1] | passed | 0.00028 seconds |
|
|
11
|
+
./spec/artifactory/cleaner_spec.rb[1:2:7:2] | passed | 0.00309 seconds |
|
|
12
|
+
./spec/artifactory/cleaner_spec.rb[1:2:7:3] | passed | 0.00071 seconds |
|
|
13
13
|
./spec/artifactory/cleaner_spec.rb[1:2:7:4] | passed | 0.00006 seconds |
|
|
14
|
-
./spec/artifactory/cleaner_spec.rb[1:2:7:5] | passed | 0.
|
|
15
|
-
./spec/artifactory/cleaner_spec.rb[1:3:1] | passed | 0.
|
|
16
|
-
./spec/artifactory/cleaner_spec.rb[1:3:2] | passed | 0.
|
|
17
|
-
./spec/artifactory/cleaner_spec.rb[1:3:3] | passed | 0.
|
|
18
|
-
./spec/artifactory/cleaner_spec.rb[1:3:4] | passed | 0.
|
|
19
|
-
./spec/artifactory/cleaner_spec.rb[1:3:5] | passed | 0.
|
|
20
|
-
./spec/artifactory/cleaner_spec.rb[1:3:6] | passed | 0.
|
|
21
|
-
./spec/artifactory/cleaner_spec.rb[1:3:7] | passed | 0.
|
|
22
|
-
./spec/artifactory/cleaner_spec.rb[1:3:8] | passed | 0.
|
|
23
|
-
./spec/artifactory/cleaner_spec.rb[1:3:9] | passed | 0.
|
|
24
|
-
./spec/artifactory/cleaner_spec.rb[1:3:10:1] | passed | 0.
|
|
25
|
-
./spec/artifactory/cleaner_spec.rb[1:3:11:1] | passed | 0.
|
|
26
|
-
./spec/artifactory/cleaner_spec.rb[1:4:1] | passed | 0.
|
|
27
|
-
./spec/artifactory/cleaner_spec.rb[1:5:1] | passed | 0.
|
|
28
|
-
./spec/artifactory/cleaner_spec.rb[1:5:2] | passed | 0.
|
|
29
|
-
./spec/artifactory/cleaner_spec.rb[1:5:3] | passed | 0.
|
|
30
|
-
./spec/artifactory/cleaner_spec.rb[1:5:4] | passed | 0.
|
|
31
|
-
./spec/artifactory/cleaner_spec.rb[1:5:5] | passed | 0.
|
|
32
|
-
./spec/artifactory/cleaner_spec.rb[1:5:6] | passed | 0.
|
|
33
|
-
./spec/artifactory/cleaner_spec.rb[1:5:7:1] | passed | 0.
|
|
34
|
-
./spec/artifactory/cleaner_spec.rb[1:5:7:2] | passed | 0.
|
|
35
|
-
./spec/artifactory/cleaner_spec.rb[1:5:7:3] | passed | 0.
|
|
14
|
+
./spec/artifactory/cleaner_spec.rb[1:2:7:5] | passed | 0.00009 seconds |
|
|
15
|
+
./spec/artifactory/cleaner_spec.rb[1:3:1] | passed | 0.00081 seconds |
|
|
16
|
+
./spec/artifactory/cleaner_spec.rb[1:3:2] | passed | 0.00011 seconds |
|
|
17
|
+
./spec/artifactory/cleaner_spec.rb[1:3:3] | passed | 0.00007 seconds |
|
|
18
|
+
./spec/artifactory/cleaner_spec.rb[1:3:4] | passed | 0.00007 seconds |
|
|
19
|
+
./spec/artifactory/cleaner_spec.rb[1:3:5] | passed | 0.00056 seconds |
|
|
20
|
+
./spec/artifactory/cleaner_spec.rb[1:3:6] | passed | 0.00585 seconds |
|
|
21
|
+
./spec/artifactory/cleaner_spec.rb[1:3:7] | passed | 0.00024 seconds |
|
|
22
|
+
./spec/artifactory/cleaner_spec.rb[1:3:8] | passed | 0.00014 seconds |
|
|
23
|
+
./spec/artifactory/cleaner_spec.rb[1:3:9] | passed | 0.00058 seconds |
|
|
24
|
+
./spec/artifactory/cleaner_spec.rb[1:3:10:1] | passed | 0.00205 seconds |
|
|
25
|
+
./spec/artifactory/cleaner_spec.rb[1:3:11:1] | passed | 0.00278 seconds |
|
|
26
|
+
./spec/artifactory/cleaner_spec.rb[1:4:1] | passed | 0.00009 seconds |
|
|
27
|
+
./spec/artifactory/cleaner_spec.rb[1:5:1] | passed | 0.00012 seconds |
|
|
28
|
+
./spec/artifactory/cleaner_spec.rb[1:5:2] | passed | 0.00006 seconds |
|
|
29
|
+
./spec/artifactory/cleaner_spec.rb[1:5:3] | passed | 0.00012 seconds |
|
|
30
|
+
./spec/artifactory/cleaner_spec.rb[1:5:4] | passed | 0.00007 seconds |
|
|
31
|
+
./spec/artifactory/cleaner_spec.rb[1:5:5] | passed | 0.00007 seconds |
|
|
32
|
+
./spec/artifactory/cleaner_spec.rb[1:5:6] | passed | 0.00007 seconds |
|
|
33
|
+
./spec/artifactory/cleaner_spec.rb[1:5:7:1] | passed | 0.00007 seconds |
|
|
34
|
+
./spec/artifactory/cleaner_spec.rb[1:5:7:2] | passed | 0.00013 seconds |
|
|
35
|
+
./spec/artifactory/cleaner_spec.rb[1:5:7:3] | passed | 0.00009 seconds |
|
|
36
36
|
./spec/artifactory/cleaner_spec.rb[1:5:7:4] | passed | 0.00023 seconds |
|
|
37
|
-
./spec/artifactory/cleaner_spec.rb[1:5:7:5] | passed | 0.
|
|
37
|
+
./spec/artifactory/cleaner_spec.rb[1:5:7:5] | passed | 0.00012 seconds |
|
|
38
38
|
./spec/artifactory/cleaner_spec.rb[1:5:7:6] | passed | 0.00008 seconds |
|
|
39
|
-
./spec/artifactory/cleaner_spec.rb[1:5:7:7] | passed | 0.
|
|
39
|
+
./spec/artifactory/cleaner_spec.rb[1:5:7:7] | passed | 0.00008 seconds |
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@ Artifactory Cleaner CHANGELOG
|
|
|
2
2
|
=============================
|
|
3
3
|
This file describes the changes made in each release of `artifactory-cleaner`
|
|
4
4
|
|
|
5
|
+
## v1.0.4 (May 29, 2020)
|
|
6
|
+
|
|
7
|
+
- Fix bug with accepting YAML filter files on the CLI
|
|
8
|
+
|
|
5
9
|
## v1.0.3 (May 15, 2020)
|
|
6
10
|
|
|
7
11
|
- Fix thread deadlocks which occured if exceptions were raised in the discovery worker threads
|
data/Gemfile
CHANGED
|
@@ -4,9 +4,12 @@ source "https://rubygems.org"
|
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
6
|
gem "rake", "~> 12.0"
|
|
7
|
-
gem "rspec", "~> 3.0"
|
|
8
7
|
|
|
9
8
|
group :development do
|
|
10
9
|
gem 'pry-rescue'
|
|
11
10
|
gem 'pry-stack_explorer'
|
|
12
11
|
end
|
|
12
|
+
group :test do
|
|
13
|
+
gem "rspec", "~> 3.0"
|
|
14
|
+
gem "rspec_junit_formatter", ">= 0.4.1"
|
|
15
|
+
end
|
|
@@ -55,9 +55,9 @@ module Artifactory
|
|
|
55
55
|
super
|
|
56
56
|
@config = {}
|
|
57
57
|
begin
|
|
58
|
-
load_conf_file options
|
|
58
|
+
load_conf_file options[:conf_file] if options[:conf_file]
|
|
59
59
|
rescue => ex
|
|
60
|
-
STDERR.puts "Unable to load config from #{options
|
|
60
|
+
STDERR.puts "Unable to load config from #{options[:conf_file]}: #{ex}"
|
|
61
61
|
exit Sysexits::EX_DATAERR
|
|
62
62
|
end
|
|
63
63
|
@artifactory_config = {
|
|
@@ -111,8 +111,8 @@ module Artifactory
|
|
|
111
111
|
# Analyze usage and report where space is used
|
|
112
112
|
def usage_report
|
|
113
113
|
begin
|
|
114
|
-
from = Time.parse(options
|
|
115
|
-
to = Time.parse(options
|
|
114
|
+
from = Time.parse(options[:from])
|
|
115
|
+
to = Time.parse(options[:to])
|
|
116
116
|
rescue => ex
|
|
117
117
|
STDERR.puts "Unable to parse time format. Please use: YYYY-MM-DD HH:II:SS"
|
|
118
118
|
STDERR.puts ex
|
|
@@ -120,12 +120,12 @@ module Artifactory
|
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
begin
|
|
123
|
-
STDERR.puts "[DEBUG] controller.bucketize_artifacts from #{from} to #{to} repos #{options
|
|
123
|
+
STDERR.puts "[DEBUG] controller.bucketize_artifacts from #{from} to #{to} repos #{options[:repos]}" if options.verbose?
|
|
124
124
|
buckets = @controller.bucketize_artifacts(
|
|
125
125
|
from: from,
|
|
126
126
|
to: to,
|
|
127
|
-
repos: options
|
|
128
|
-
threads: options
|
|
127
|
+
repos: options[:repos],
|
|
128
|
+
threads: options[:threads],
|
|
129
129
|
)
|
|
130
130
|
|
|
131
131
|
@controller.bucketized_artifact_report(buckets).each { |l| STDERR.puts l }
|
|
@@ -192,7 +192,7 @@ module Artifactory
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
@controller.with_discovered_artifacts(from: dates[:from], to: dates[:to], repos: options
|
|
195
|
+
@controller.with_discovered_artifacts(from: dates[:from], to: dates[:to], repos: options[:repos], threads: options[:threads]) do |artifact|
|
|
196
196
|
if artifact_meets_criteria(artifact, dates, filter)
|
|
197
197
|
if options.dry_run?
|
|
198
198
|
STDERR.puts "Would archive #{artifact} to #{archive_to}"
|
|
@@ -252,8 +252,8 @@ module Artifactory
|
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
STDERR.puts "[DEBUG] controller.bucketize_artifacts from #{dates[:from]} to #{dates[:to]} repos #{options
|
|
256
|
-
@controller.with_discovered_artifacts(from: dates[:from], to: dates[:to], repos: options
|
|
255
|
+
STDERR.puts "[DEBUG] controller.bucketize_artifacts from #{dates[:from]} to #{dates[:to]} repos #{options[:repos]}" if options.verbose?
|
|
256
|
+
@controller.with_discovered_artifacts(from: dates[:from], to: dates[:to], repos: options[:repos], threads: options[:threads]) do |artifact|
|
|
257
257
|
if artifact_meets_criteria(artifact, dates, filter)
|
|
258
258
|
if archive_to
|
|
259
259
|
if options.dry_run?
|
|
@@ -307,10 +307,10 @@ module Artifactory
|
|
|
307
307
|
# return Ruby Time objects formed from CLI switches `--to`, `--from`, `--ctreated-before` etc
|
|
308
308
|
def parse_date_options
|
|
309
309
|
dates = {}
|
|
310
|
-
dates[:from] = Time.parse(options
|
|
311
|
-
dates[:created_before] = Time.parse(options
|
|
312
|
-
dates[:modified_before] = Time.parse(options
|
|
313
|
-
dates[:last_used_before] = Time.parse(options
|
|
310
|
+
dates[:from] = Time.parse(options[:from]) if options[:from]
|
|
311
|
+
dates[:created_before] = Time.parse(options[:created_before]) if options[:created_before]
|
|
312
|
+
dates[:modified_before] = Time.parse(options[:modified_before]) if options[:modified_before]
|
|
313
|
+
dates[:last_used_before] = Time.parse(options[:last_used_before]) if options[:last_used_before]
|
|
314
314
|
dates[:to] = [dates[:created_before], dates[:modified_before], dates[:downloaded_before], dates[:last_used_before]].compact.sort.first
|
|
315
315
|
|
|
316
316
|
if dates[:to].nil?
|
|
@@ -324,7 +324,7 @@ module Artifactory
|
|
|
324
324
|
##
|
|
325
325
|
# Parse and validate value for the `--archive-to` CLI switch, ensuring it points to a valid, writable directory
|
|
326
326
|
def parse_archive_option
|
|
327
|
-
archive_to = options
|
|
327
|
+
archive_to = options[:archive_to]
|
|
328
328
|
if archive_to
|
|
329
329
|
unless File.directory? archive_to
|
|
330
330
|
STDERR.puts "#{archive_to} is not a directory. `--archive-to` expects a valid, existing directory under which to store archived artifacts"
|
|
@@ -343,12 +343,12 @@ module Artifactory
|
|
|
343
343
|
# Load Artifactory::Cleaner::ArtifactFilter objects from a YAML file
|
|
344
344
|
def load_artifact_filter
|
|
345
345
|
filter = ArtifactFilter.new
|
|
346
|
-
if options
|
|
347
|
-
unless File.exist? options
|
|
348
|
-
STDERR.puts "Unable to read specified filter file #{options
|
|
346
|
+
if options[:filter]
|
|
347
|
+
unless File.exist? options[:filter] and File.readable? options[:filter]
|
|
348
|
+
STDERR.puts "Unable to read specified filter file #{options[:filter]}"
|
|
349
349
|
exit Sysexits::EX_USAGE
|
|
350
350
|
end
|
|
351
|
-
rules = YAML.load_file options
|
|
351
|
+
rules = YAML.load_file options[:filter]
|
|
352
352
|
rules.each {|rule| filter << rule}
|
|
353
353
|
end
|
|
354
354
|
filter
|
|
@@ -376,10 +376,10 @@ module Artifactory
|
|
|
376
376
|
def get_repo_cols(repo_kinds)
|
|
377
377
|
if options.details?
|
|
378
378
|
selected_cols =
|
|
379
|
-
if options
|
|
379
|
+
if options[:output].nil?
|
|
380
380
|
Artifactory::Cleaner::CLI.default_repo_table_cols
|
|
381
381
|
else
|
|
382
|
-
options
|
|
382
|
+
options[:output].split(',').map &:to_sym
|
|
383
383
|
end
|
|
384
384
|
@repo_table_cols.select do |col|
|
|
385
385
|
(col.only.nil? or repo_kinds.include? col.only) and (selected_cols.include? col.method)
|
|
@@ -392,7 +392,7 @@ module Artifactory
|
|
|
392
392
|
##
|
|
393
393
|
# CLI helper method for printing details of discovered repositories to a terminal
|
|
394
394
|
def print_repo_list(repo_info_table, include_cols)
|
|
395
|
-
if options
|
|
395
|
+
if options[:no_headers] || !options[:details]
|
|
396
396
|
repo_info_table.each {|row| puts row.join("\t")}
|
|
397
397
|
else
|
|
398
398
|
headers = include_cols.map &:heading
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: artifactory-cleaner
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Josh Gitlin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-05-
|
|
11
|
+
date: 2020-05-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cucumber
|