artifactory-gem_import 0.2.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57ab4217838b44abf3dde9b5f6e1bd6e6209af40e3cd84dfa9b758c68946cb86
|
4
|
+
data.tar.gz: 3d0b72405f995269769ebeebb9aaacab60b28dcf14dbd00426a7d3b97278b8f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67c0448e9161b7ac268569b064aadcabd7d79c29ff2e266e9a706807f9a9cfbe77a467aa61b666c7a9a70dfe32705fc62d2862521ceccd74b83047539a949797
|
7
|
+
data.tar.gz: 0b7f11815cb9ac286ea1e3997f7ec44f00b47a5f5f4b7cd986c7b1014af45c81a637f8a21f5067dcd0436b9ca6e4aa1bb4915d316b0014ae552198007ad05d91
|
data/README.md
CHANGED
@@ -26,18 +26,18 @@ gem 'artifactory-gem_import'
|
|
26
26
|
|
27
27
|
Show gems not already present in the Artifactory.
|
28
28
|
```shell
|
29
|
-
$ artifactory-gem-import show-missing --source-repo https://your-repo.local/private --target-repo https://your-artifactory.local/gems-local --target-repo-
|
29
|
+
$ artifactory-gem-import show-missing --source-repo https://your-repo.local/private --target-repo https://your-artifactory.local/gems-local --target-repo-access-token <access-token> [--only "+."]
|
30
30
|
```
|
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-
|
34
|
+
$ artifactory-gem-import import --source-repo https://your-repo.local/private --target-repo https://your-artifactory.local/gems-local --target-repo-access-token <access-token> [--only "+."] [--force]
|
35
35
|
```
|
36
36
|
Using `--force` uploads gems even if already present in the target repo instead of skipping them.
|
37
37
|
|
38
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.
|
39
39
|
```shell
|
40
|
-
$ artifactory-gem-import delete --target-repo https://your-artifactory.local/gems-local --target-repo-
|
40
|
+
$ artifactory-gem-import delete --target-repo https://your-artifactory.local/gems-local --target-repo-access-token <access-token> [--only "+."]
|
41
41
|
```
|
42
42
|
|
43
43
|
Keep in mind that Artifactory needs some time to apply your changes.
|
@@ -13,7 +13,7 @@ module Artifactory
|
|
13
13
|
|
14
14
|
option :target_repo, required: true, type: :string
|
15
15
|
|
16
|
-
option :
|
16
|
+
option :target_repo_access_token, required: true, type: :string
|
17
17
|
|
18
18
|
option :only, type: :string, default: ".+"
|
19
19
|
|
@@ -30,7 +30,7 @@ module Artifactory
|
|
30
30
|
|
31
31
|
option :target_repo, required: true, type: :string
|
32
32
|
|
33
|
-
option :
|
33
|
+
option :target_repo_access_token, required: true, type: :string
|
34
34
|
|
35
35
|
option :only, type: :string, default: ".+"
|
36
36
|
|
@@ -45,7 +45,7 @@ module Artifactory
|
|
45
45
|
|
46
46
|
option :target_repo, required: true, type: :string
|
47
47
|
|
48
|
-
option :
|
48
|
+
option :target_repo_access_token, required: true, type: :string
|
49
49
|
|
50
50
|
option :only, type: :string, default: ".+"
|
51
51
|
|
@@ -63,7 +63,7 @@ module Artifactory
|
|
63
63
|
|
64
64
|
# option :target_repo, required: true, type: :string
|
65
65
|
#
|
66
|
-
# option :
|
66
|
+
# option :target_repo_access_token, required: true, type: :string
|
67
67
|
#
|
68
68
|
# desc "reindex", "Trigger reindexing of the target repo (Artifactory only)."
|
69
69
|
# def reindex
|
@@ -84,7 +84,7 @@ module Artifactory
|
|
84
84
|
|
85
85
|
def target_repo
|
86
86
|
GemImport.target_repo url: options[:target_repo],
|
87
|
-
|
87
|
+
access_token: options[:target_repo_access_token]
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -15,13 +15,19 @@ module Artifactory
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def get(repo:, only: /.+/)
|
18
|
-
|
19
|
-
.
|
20
|
-
.
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
%i[prerelease_specs_url specs_url]
|
19
|
+
.flat_map { |getter| fetch repo.public_send(getter), repo.headers }
|
20
|
+
.sort
|
21
|
+
.then { |specs| Specs.filter specs, only: only }
|
22
|
+
end
|
23
|
+
|
24
|
+
private_class_method
|
25
|
+
|
26
|
+
def fetch(url, headers)
|
27
|
+
Specs.new(url: url, headers: headers)
|
28
|
+
.specs
|
29
|
+
rescue Zlib::GzipFile::Error, Net::HTTPClientException, Net::HTTPFatalError, Net::OpenTimeout, SocketError => err
|
30
|
+
raise ClientError, "Could not fetch specs. URL: #{url}, Reason: #{err.message}"
|
25
31
|
end
|
26
32
|
end
|
27
33
|
end
|
@@ -4,7 +4,7 @@ module Artifactory
|
|
4
4
|
attr_reader :url, :headers
|
5
5
|
|
6
6
|
def initialize(url:, headers:)
|
7
|
-
@url
|
7
|
+
@url = url
|
8
8
|
@headers = headers
|
9
9
|
end
|
10
10
|
|
@@ -12,9 +12,17 @@ module Artifactory
|
|
12
12
|
File.join url, "gems", "/"
|
13
13
|
end
|
14
14
|
|
15
|
+
def prerelease_specs_url
|
16
|
+
File.join url, "prerelease_specs.4.8.gz"
|
17
|
+
end
|
18
|
+
|
15
19
|
def specs_url
|
16
20
|
File.join url, "specs.4.8.gz"
|
17
21
|
end
|
22
|
+
|
23
|
+
def latest_specs_url
|
24
|
+
File.join url, "latest_specs.4.8.gz"
|
25
|
+
end
|
18
26
|
end
|
19
27
|
end
|
20
28
|
end
|
@@ -8,7 +8,7 @@ require_relative "gem_import/worker"
|
|
8
8
|
|
9
9
|
module Artifactory
|
10
10
|
module GemImport
|
11
|
-
Error
|
11
|
+
Error = Class.new StandardError
|
12
12
|
ClientError = Class.new Error
|
13
13
|
|
14
14
|
module_function
|
@@ -32,13 +32,13 @@ module Artifactory
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def source_repo(url:)
|
35
|
-
Repo.new url:
|
35
|
+
Repo.new url: url,
|
36
36
|
headers: {}
|
37
37
|
end
|
38
38
|
|
39
|
-
def target_repo(url:,
|
40
|
-
Repo.new url:
|
41
|
-
headers: { "
|
39
|
+
def target_repo(url:, access_token:)
|
40
|
+
Repo.new url: url,
|
41
|
+
headers: { "Authorization" => "Bearer #{access_token}" }
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
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:
|
4
|
+
version: 1.1.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: 2025-01-31 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.5.
|
107
|
+
rubygems_version: 3.5.22
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: Artifactory Gem Import.
|