artifactory-gem_import 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/artifactory/gem_import/cli.rb +13 -1
- data/lib/artifactory/gem_import/version.rb +1 -1
- data/lib/artifactory/gem_import/worker/importer.rb +11 -6
- data/lib/artifactory/gem_import.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 460a984b5bd5f4a87876aabd1472607c3de3c6b0d5d99256f95123171f78bc23
|
4
|
+
data.tar.gz: e1e43e4826f1f29425eadfa46df916a8298ff1d55596cfd28645c9d7ef3c4500
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58a288d282421b5205f7fb02e4eb04e673739cec4bc0a4a8580458ed9263f772b91d3edb5c052bc035af0f1cc61e048c08ed07eb52590c998d5cfddf2d0495ed
|
7
|
+
data.tar.gz: b4e8c2b714a6126be9c84e9bfcdd831cd3591fb927e446ab40c89251e89092561a8e1b7625d53a19ce587b389ff5776fc6b63ae4a278883ee2ca65a19bb48a41
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ to you e.g. as part of the CI/CD pipeline when releasing gems.
|
|
12
12
|
|
13
13
|
## How it works
|
14
14
|
- it diffs the specs.4.8.gz of both repositories
|
15
|
-
- it down- and uploads the missing gems
|
15
|
+
- it down- and uploads the missing gems
|
16
16
|
- it verifies the MD5 hash of the uploaded gem file with the cached one
|
17
17
|
- it deletes the uploaded gem if the checksums do not match
|
18
18
|
|
@@ -31,8 +31,9 @@ $ artifactory-gem-import show-missing --source-repo https://your-repo.local/priv
|
|
31
31
|
|
32
32
|
Import gems into the Artifactory.
|
33
33
|
```shell
|
34
|
-
$ artifactory-gem-import import --source-repo https://your-repo.local/private --target-repo https://your-artifactory.local/gems-local --target-repo-api-key <api-key> [--only "+."]
|
34
|
+
$ artifactory-gem-import import --source-repo https://your-repo.local/private --target-repo https://your-artifactory.local/gems-local --target-repo-api-key <api-key> [--only "+."] [--force]
|
35
35
|
```
|
36
|
+
Using `--force` uploads gems even if already present in the target repo instead of skipping them.
|
36
37
|
|
37
38
|
Delete gems from the Artifactory. It will NOT remove the `rubygems-update` gem as it seems to be needed to keep the gem repository working.
|
38
39
|
```shell
|
@@ -17,12 +17,15 @@ module Artifactory
|
|
17
17
|
|
18
18
|
option :only, type: :string, default: ".+"
|
19
19
|
|
20
|
+
option :force, type: :boolean, default: false
|
21
|
+
|
20
22
|
desc "import", "Copy gems from the source repo into the target repo."
|
21
23
|
|
22
24
|
def import
|
23
25
|
say GemImport.import! source_repo: source_repo,
|
24
26
|
target_repo: target_repo,
|
25
|
-
only: options[:only]
|
27
|
+
only: options[:only],
|
28
|
+
force: options[:force]
|
26
29
|
end
|
27
30
|
|
28
31
|
option :target_repo, required: true, type: :string
|
@@ -58,6 +61,15 @@ module Artifactory
|
|
58
61
|
say gems.count
|
59
62
|
end
|
60
63
|
|
64
|
+
# option :target_repo, required: true, type: :string
|
65
|
+
#
|
66
|
+
# option :target_repo_api_key, required: true, type: :string
|
67
|
+
#
|
68
|
+
# desc "reindex", "Trigger reindexing of the target repo (Artifactory only)."
|
69
|
+
# def reindex
|
70
|
+
# GemImport.reindex! repo: target_repo
|
71
|
+
# end
|
72
|
+
|
61
73
|
desc "version", "Show version information"
|
62
74
|
|
63
75
|
def version
|
@@ -5,12 +5,13 @@ module Artifactory
|
|
5
5
|
module GemImport
|
6
6
|
module Worker
|
7
7
|
class Importer < Base
|
8
|
-
attr_reader :source_repo, :target_repo, :only
|
8
|
+
attr_reader :source_repo, :target_repo, :only, :force
|
9
9
|
|
10
|
-
def initialize(source_repo:, target_repo:, only:
|
10
|
+
def initialize(source_repo:, target_repo:, only: /.+/, force: false)
|
11
11
|
@source_repo = source_repo
|
12
12
|
@target_repo = target_repo
|
13
|
-
@only
|
13
|
+
@only = only
|
14
|
+
@force = force
|
14
15
|
end
|
15
16
|
|
16
17
|
def import!
|
@@ -42,9 +43,13 @@ module Artifactory
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def missing_gems
|
45
|
-
@missing_gems ||=
|
46
|
-
|
47
|
-
|
46
|
+
@missing_gems ||= if force
|
47
|
+
GemSpecs.get repo: source_repo, only: only
|
48
|
+
else
|
49
|
+
GemSpecs.missing_gems source_repo: source_repo,
|
50
|
+
target_repo: target_repo,
|
51
|
+
only: only
|
52
|
+
end
|
48
53
|
end
|
49
54
|
|
50
55
|
def download(gem)
|
@@ -13,9 +13,9 @@ module Artifactory
|
|
13
13
|
|
14
14
|
module_function
|
15
15
|
|
16
|
-
def import!(source_repo:, target_repo:, only:
|
16
|
+
def import!(source_repo:, target_repo:, only: /.+/, force: false)
|
17
17
|
Worker::Importer
|
18
|
-
.new(source_repo: source_repo, target_repo: target_repo, only: only)
|
18
|
+
.new(source_repo: source_repo, target_repo: target_repo, only: only, force: force)
|
19
19
|
.import!
|
20
20
|
end
|
21
21
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artifactory-gem_import
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Scholz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
|
-
rubygems_version: 3.
|
107
|
+
rubygems_version: 3.4.18
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: Artifactory Gem Import.
|