artifactory 2.5.2 → 2.6.0
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/.travis.yml +3 -2
- data/CHANGELOG.md +6 -0
- data/Gemfile +9 -13
- data/README.md +10 -1
- data/Rakefile +16 -7
- data/appveyor.yml +4 -2
- data/artifactory.gemspec +14 -14
- data/lib/artifactory.rb +26 -26
- data/lib/artifactory/client.rb +25 -23
- data/lib/artifactory/configurable.rb +1 -0
- data/lib/artifactory/defaults.rb +24 -15
- data/lib/artifactory/errors.rb +2 -2
- data/lib/artifactory/resources/artifact.rb +34 -33
- data/lib/artifactory/resources/backup.rb +5 -5
- data/lib/artifactory/resources/base.rb +7 -7
- data/lib/artifactory/resources/build.rb +15 -15
- data/lib/artifactory/resources/build_component.rb +4 -4
- data/lib/artifactory/resources/group.rb +4 -4
- data/lib/artifactory/resources/layout.rb +3 -3
- data/lib/artifactory/resources/ldap_setting.rb +7 -6
- data/lib/artifactory/resources/mail_server.rb +3 -3
- data/lib/artifactory/resources/permission_target.rb +20 -20
- data/lib/artifactory/resources/plugin.rb +1 -1
- data/lib/artifactory/resources/repository.rb +20 -20
- data/lib/artifactory/resources/system.rb +6 -6
- data/lib/artifactory/resources/url_base.rb +4 -3
- data/lib/artifactory/resources/user.rb +4 -4
- data/lib/artifactory/util.rb +10 -10
- data/lib/artifactory/version.rb +1 -1
- data/spec/integration/resources/artifact_spec.rb +31 -31
- data/spec/integration/resources/backup.rb +7 -7
- data/spec/integration/resources/build_component_spec.rb +18 -18
- data/spec/integration/resources/build_spec.rb +15 -15
- data/spec/integration/resources/group_spec.rb +16 -16
- data/spec/integration/resources/layout_spec.rb +7 -7
- data/spec/integration/resources/ldap_setting_spec.rb +7 -7
- data/spec/integration/resources/mail_server_spec.rb +7 -7
- data/spec/integration/resources/permission_target_spec.rb +35 -35
- data/spec/integration/resources/repository_spec.rb +14 -14
- data/spec/integration/resources/system_spec.rb +20 -21
- data/spec/integration/resources/url_base_spec.rb +7 -7
- data/spec/integration/resources/user_spec.rb +16 -16
- data/spec/spec_helper.rb +11 -11
- data/spec/support/api_server.rb +13 -13
- data/spec/support/api_server/artifact_endpoints.rb +94 -94
- data/spec/support/api_server/build_component_endpoints.rb +18 -18
- data/spec/support/api_server/build_endpoints.rb +76 -76
- data/spec/support/api_server/group_endpoints.rb +24 -24
- data/spec/support/api_server/permission_target_endpoints.rb +24 -24
- data/spec/support/api_server/repository_endpoints.rb +82 -82
- data/spec/support/api_server/status_endpoints.rb +5 -5
- data/spec/support/api_server/system_endpoints.rb +17 -18
- data/spec/support/api_server/user_endpoints.rb +30 -30
- data/spec/unit/artifactory_spec.rb +17 -17
- data/spec/unit/client_spec.rb +43 -43
- data/spec/unit/resources/artifact_spec.rb +256 -256
- data/spec/unit/resources/backup_spec.rb +8 -8
- data/spec/unit/resources/base_spec.rb +51 -51
- data/spec/unit/resources/build_component_spec.rb +45 -45
- data/spec/unit/resources/build_spec.rb +98 -98
- data/spec/unit/resources/defaults_spec.rb +4 -4
- data/spec/unit/resources/group_spec.rb +36 -36
- data/spec/unit/resources/layout_spec.rb +8 -8
- data/spec/unit/resources/ldap_setting_spec.rb +8 -8
- data/spec/unit/resources/mail_server_spec.rb +8 -8
- data/spec/unit/resources/permission_target_spec.rb +79 -79
- data/spec/unit/resources/plugin_spec.rb +7 -7
- data/spec/unit/resources/repository_spec.rb +98 -98
- data/spec/unit/resources/system_spec.rb +30 -30
- data/spec/unit/resources/url_base_spec.rb +8 -8
- data/spec/unit/resources/user_spec.rb +40 -40
- metadata +3 -3
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
module Artifactory
|
|
4
4
|
describe Resource::Repository, :integration do
|
|
5
|
-
describe
|
|
6
|
-
it
|
|
5
|
+
describe ".all" do
|
|
6
|
+
it "returns an array of repository objects" do
|
|
7
7
|
results = described_class.all
|
|
8
8
|
expect(results).to be_a(Array)
|
|
9
9
|
expect(results.first).to be_a(described_class)
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
describe
|
|
14
|
-
it
|
|
15
|
-
repository = described_class.find(
|
|
13
|
+
describe ".find" do
|
|
14
|
+
it "finds a repository by key" do
|
|
15
|
+
repository = described_class.find("libs-snapshots-local")
|
|
16
16
|
|
|
17
17
|
expect(repository).to be_a(described_class)
|
|
18
|
-
expect(repository.key).to eq(
|
|
18
|
+
expect(repository.key).to eq("libs-snapshots-local")
|
|
19
19
|
expect(repository.max_unique_snapshots).to eq(10)
|
|
20
|
-
expect(repository.package_type).to eql(
|
|
20
|
+
expect(repository.package_type).to eql("generic")
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
it
|
|
24
|
-
repo =
|
|
23
|
+
it "finds debian repositories" do
|
|
24
|
+
repo = "libs-debian-local"
|
|
25
25
|
|
|
26
26
|
repository = described_class.find(repo)
|
|
27
27
|
|
|
28
|
-
expect(repository.package_type).to eql(
|
|
28
|
+
expect(repository.package_type).to eql("debian")
|
|
29
29
|
expect(repository.key).to eql(repo)
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
describe
|
|
34
|
-
it
|
|
35
|
-
repository = described_class.new(key:
|
|
33
|
+
describe "#save" do
|
|
34
|
+
it "saves the repository to the server" do
|
|
35
|
+
repository = described_class.new(key: "libs-testing-local")
|
|
36
36
|
expect(repository.save).to be_truthy
|
|
37
37
|
end
|
|
38
38
|
end
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
module Artifactory
|
|
4
4
|
describe Resource::System, :integration do
|
|
5
|
-
describe
|
|
6
|
-
it
|
|
7
|
-
expect(described_class.info).to eq(
|
|
5
|
+
describe ".info" do
|
|
6
|
+
it "gets the system information" do
|
|
7
|
+
expect(described_class.info).to eq("This is some serious system info right here")
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
describe
|
|
12
|
-
it
|
|
11
|
+
describe ".ping" do
|
|
12
|
+
it "returns ok" do
|
|
13
13
|
expect(described_class.ping).to be_truthy
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
describe
|
|
18
|
-
it
|
|
17
|
+
describe ".configuration" do
|
|
18
|
+
it "returns the system configuration" do
|
|
19
19
|
expect(described_class.configuration).to be_a(REXML::Document)
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
describe
|
|
24
|
-
let(:tempfile) { Tempfile.new(
|
|
23
|
+
describe ".update_configuration" do
|
|
24
|
+
let(:tempfile) { Tempfile.new(%w{config xml}) }
|
|
25
25
|
let(:content) do
|
|
26
|
-
<<-EOH.strip.gsub(/^ {10}/,
|
|
26
|
+
<<-EOH.strip.gsub(/^ {10}/, "")
|
|
27
27
|
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
|
|
28
28
|
<newConfig>true</newConfig>
|
|
29
29
|
EOH
|
|
@@ -34,7 +34,7 @@ module Artifactory
|
|
|
34
34
|
tempfile.unlink
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
it
|
|
37
|
+
it "posts the new configuration to the server" do
|
|
38
38
|
tempfile.write(content)
|
|
39
39
|
tempfile.rewind
|
|
40
40
|
|
|
@@ -42,16 +42,15 @@ module Artifactory
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
describe
|
|
46
|
-
it
|
|
45
|
+
describe ".version" do
|
|
46
|
+
it "gets the version information" do
|
|
47
47
|
expect(described_class.version).to eq({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
]
|
|
48
|
+
"version" => "3.1.0",
|
|
49
|
+
"revision" => "30062",
|
|
50
|
+
"addons" => %w{
|
|
51
|
+
ldap
|
|
52
|
+
license
|
|
53
|
+
yum},
|
|
55
54
|
})
|
|
56
55
|
end
|
|
57
56
|
end
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
module Artifactory
|
|
4
4
|
describe Resource::URLBase, :integration do
|
|
5
|
-
describe
|
|
6
|
-
it
|
|
5
|
+
describe ".all" do
|
|
6
|
+
it "returns an array of UrlBases" do
|
|
7
7
|
results = described_class.all
|
|
8
8
|
expect(results).to be_a(Array)
|
|
9
9
|
expect(results.first).to be_a(described_class)
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
describe
|
|
14
|
-
it
|
|
15
|
-
base = described_class.find(
|
|
13
|
+
describe ".find" do
|
|
14
|
+
it "finds a urlBase by url" do
|
|
15
|
+
base = described_class.find("http://33.33.33.20/artifactory")
|
|
16
16
|
|
|
17
17
|
expect(base).to be_a(described_class)
|
|
18
|
-
expect(base.url_base).to eq(
|
|
18
|
+
expect(base.url_base).to eq("http://33.33.33.20/artifactory")
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
end
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
module Artifactory
|
|
4
4
|
describe Resource::User, :integration do
|
|
5
|
-
describe
|
|
6
|
-
it
|
|
5
|
+
describe ".all" do
|
|
6
|
+
it "returns an array of user objects" do
|
|
7
7
|
results = described_class.all
|
|
8
8
|
expect(results).to be_a(Array)
|
|
9
9
|
expect(results.first).to be_a(described_class)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
it
|
|
12
|
+
it "includes the information from the server" do
|
|
13
13
|
results = described_class.all
|
|
14
14
|
seth = results[0]
|
|
15
15
|
yvonne = results[1]
|
|
16
16
|
|
|
17
|
-
expect(seth.name).to eq(
|
|
18
|
-
expect(yvonne.name).to eq(
|
|
17
|
+
expect(seth.name).to eq("sethvargo")
|
|
18
|
+
expect(yvonne.name).to eq("yzl")
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
describe
|
|
23
|
-
it
|
|
24
|
-
seth = described_class.find(
|
|
22
|
+
describe ".find" do
|
|
23
|
+
it "finds a user by name" do
|
|
24
|
+
seth = described_class.find("sethvargo")
|
|
25
25
|
|
|
26
26
|
expect(seth).to be_a(described_class)
|
|
27
|
-
expect(seth.name).to eq(
|
|
27
|
+
expect(seth.name).to eq("sethvargo")
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
describe
|
|
32
|
-
it
|
|
33
|
-
sethvargo = described_class.find(
|
|
31
|
+
describe "#delete" do
|
|
32
|
+
it "deletes the user from the server" do
|
|
33
|
+
sethvargo = described_class.find("sethvargo")
|
|
34
34
|
expect(sethvargo.delete).to be_truthy
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
describe
|
|
39
|
-
it
|
|
40
|
-
user = described_class.new(name:
|
|
38
|
+
describe "#save" do
|
|
39
|
+
it "saves the user to the server" do
|
|
40
|
+
user = described_class.new(name: "schisamo")
|
|
41
41
|
expect(user.save).to be_truthy
|
|
42
42
|
end
|
|
43
43
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
3
|
-
require
|
|
1
|
+
require "bundler/setup"
|
|
2
|
+
require "rspec"
|
|
3
|
+
require "webmock/rspec"
|
|
4
4
|
|
|
5
|
-
if ENV[
|
|
6
|
-
require
|
|
7
|
-
require
|
|
5
|
+
if ENV["COVERAGE"]
|
|
6
|
+
require "simplecov"
|
|
7
|
+
require "simplecov-console"
|
|
8
8
|
SimpleCov.start do
|
|
9
|
-
add_filter
|
|
9
|
+
add_filter "spec/"
|
|
10
10
|
formatter SimpleCov::Formatter::MultiFormatter.new [
|
|
11
11
|
SimpleCov::Formatter::HTMLFormatter,
|
|
12
12
|
SimpleCov::Formatter::Console,
|
|
@@ -15,10 +15,10 @@ if ENV['COVERAGE']
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# Require our main library
|
|
18
|
-
require
|
|
18
|
+
require "artifactory"
|
|
19
19
|
|
|
20
20
|
# Require helpers
|
|
21
|
-
require_relative
|
|
21
|
+
require_relative "support/api_server"
|
|
22
22
|
|
|
23
23
|
RSpec.configure do |config|
|
|
24
24
|
# Custom helper modules and extensions
|
|
@@ -38,7 +38,7 @@ RSpec.configure do |config|
|
|
|
38
38
|
config.after(:each) { Artifactory.reset! }
|
|
39
39
|
|
|
40
40
|
config.before(:each, :integration) do
|
|
41
|
-
Artifactory.endpoint =
|
|
41
|
+
Artifactory.endpoint = "http://localhost:8889"
|
|
42
42
|
Artifactory.username = nil
|
|
43
43
|
Artifactory.password = nil
|
|
44
44
|
stub_request(:any, /#{Artifactory.endpoint}/).to_rack(Artifactory::APIServer)
|
|
@@ -48,5 +48,5 @@ RSpec.configure do |config|
|
|
|
48
48
|
# order dependency and want to debug it, you can fix the order by providing
|
|
49
49
|
# the seed, which is printed after each run.
|
|
50
50
|
# --seed 1234
|
|
51
|
-
config.order =
|
|
51
|
+
config.order = "random"
|
|
52
52
|
end
|
data/spec/support/api_server.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "sinatra/base"
|
|
2
2
|
|
|
3
3
|
module Artifactory
|
|
4
4
|
#
|
|
@@ -6,15 +6,15 @@ module Artifactory
|
|
|
6
6
|
# fake, but it is based off of real responses from the Artifactory server.
|
|
7
7
|
#
|
|
8
8
|
class APIServer < Sinatra::Base
|
|
9
|
-
require_relative
|
|
10
|
-
require_relative
|
|
11
|
-
require_relative
|
|
12
|
-
require_relative
|
|
13
|
-
require_relative
|
|
14
|
-
require_relative
|
|
15
|
-
require_relative
|
|
16
|
-
require_relative
|
|
17
|
-
require_relative
|
|
9
|
+
require_relative "api_server/artifact_endpoints"
|
|
10
|
+
require_relative "api_server/build_component_endpoints"
|
|
11
|
+
require_relative "api_server/build_endpoints"
|
|
12
|
+
require_relative "api_server/group_endpoints"
|
|
13
|
+
require_relative "api_server/repository_endpoints"
|
|
14
|
+
require_relative "api_server/permission_target_endpoints"
|
|
15
|
+
require_relative "api_server/status_endpoints"
|
|
16
|
+
require_relative "api_server/system_endpoints"
|
|
17
|
+
require_relative "api_server/user_endpoints"
|
|
18
18
|
|
|
19
19
|
register APIServer::ArtifactEndpoints
|
|
20
20
|
register APIServer::BuildComponentEndpoints
|
|
@@ -38,9 +38,9 @@ module Artifactory
|
|
|
38
38
|
#
|
|
39
39
|
def server_url
|
|
40
40
|
@server_url ||= begin
|
|
41
|
-
scheme = request.env[
|
|
42
|
-
address = request.env[
|
|
43
|
-
port = request.env[
|
|
41
|
+
scheme = request.env["rack.url_scheme"]
|
|
42
|
+
address = request.env["SERVER_NAME"]
|
|
43
|
+
port = request.env["SERVER_PORT"]
|
|
44
44
|
|
|
45
45
|
Pathname.new("#{scheme}://#{address}:#{port}")
|
|
46
46
|
end
|
|
@@ -1,156 +1,156 @@
|
|
|
1
1
|
module Artifactory
|
|
2
2
|
module APIServer::ArtifactEndpoints
|
|
3
3
|
def self.registered(app)
|
|
4
|
-
app.get(
|
|
5
|
-
content_type
|
|
4
|
+
app.get("/api/search/artifact") do
|
|
5
|
+
content_type "application/vnd.org.jfrog.artifactory.search.ArtifactSearchResult+json"
|
|
6
6
|
artifacts_for_conditions do
|
|
7
|
-
params[
|
|
7
|
+
params["name"] == "artifact.deb"
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
app.get(
|
|
12
|
-
content_type
|
|
11
|
+
app.get("/api/search/gavc") do
|
|
12
|
+
content_type "application/vnd.org.jfrog.artifactory.search.GavcSearchResult+json"
|
|
13
13
|
artifacts_for_conditions do
|
|
14
|
-
params[
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
params["g"] == "org.acme" &&
|
|
15
|
+
params["a"] == "artifact.deb" &&
|
|
16
|
+
params["v"] == "1.0" &&
|
|
17
|
+
params["c"] == "sources"
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
app.get(
|
|
22
|
-
content_type
|
|
21
|
+
app.get("/api/search/prop") do
|
|
22
|
+
content_type "application/vnd.org.jfrog.artifactory.search.MetadataSearchResult+json"
|
|
23
23
|
artifacts_for_conditions do
|
|
24
|
-
params[
|
|
24
|
+
params["branch"] == "master" && params["committer"] == "Seth Vargo"
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
app.get(
|
|
29
|
-
content_type
|
|
28
|
+
app.get("/api/search/checksum") do
|
|
29
|
+
content_type "application/vnd.org.jfrog.artifactory.search.ChecksumSearchResult+json"
|
|
30
30
|
artifacts_for_conditions do
|
|
31
|
-
params[
|
|
31
|
+
params["md5"] == "abcd1234"
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
app.get(
|
|
36
|
-
content_type
|
|
35
|
+
app.get("/api/search/usage") do
|
|
36
|
+
content_type "application/vnd.org.jfrog.artifactory.search.ArtifactUsageResult+json"
|
|
37
37
|
artifacts_for_conditions do
|
|
38
|
-
params[
|
|
38
|
+
params["notUsedSince"] == "1414800000"
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
app.get(
|
|
43
|
-
content_type
|
|
42
|
+
app.get("/api/search/creation") do
|
|
43
|
+
content_type "application/vnd.org.jfrog.artifactory.search.ArtifactCreationResult+json"
|
|
44
44
|
artifacts_for_conditions do
|
|
45
|
-
params[
|
|
45
|
+
params["from"] == "1414800000"
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
app.get(
|
|
50
|
-
content_type
|
|
49
|
+
app.get("/api/search/versions") do
|
|
50
|
+
content_type "application/vnd.org.jfrog.artifactory.search.ArtifactVersionsResult+json"
|
|
51
51
|
JSON.fast_generate(
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
{
|
|
55
|
-
{
|
|
52
|
+
"results" => [
|
|
53
|
+
{ "version" => "1.2", "integration" => false },
|
|
54
|
+
{ "version" => "1.0-SNAPSHOT", "integration" => true },
|
|
55
|
+
{ "version" => "1.0", "integration" => false },
|
|
56
56
|
]
|
|
57
57
|
)
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
-
app.get(
|
|
61
|
-
|
|
60
|
+
app.get("/api/search/latestVersion") do
|
|
61
|
+
"1.0-201203131455-2"
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
app.get(
|
|
65
|
-
content_type
|
|
64
|
+
app.get("/api/storage/libs-release-local/org/acme/artifact.deb") do
|
|
65
|
+
content_type "application/vnd.org.jfrog.artifactory.storage.FileInfo+json"
|
|
66
66
|
JSON.fast_generate(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
"uri" => server_url.join("/api/storage/libs-release-local/org/acme/artifact.deb"),
|
|
68
|
+
"downloadUri" => server_url.join("/artifactory/libs-release-local/org/acme/artifact.deb"),
|
|
69
|
+
"repo" => "libs-release-local",
|
|
70
|
+
"path" => "/org/acme/artifact.deb",
|
|
71
|
+
"created" => Time.parse("1991-07-23 12:07am"),
|
|
72
|
+
"createdBy" => "schisamo",
|
|
73
|
+
"lastModified" => Time.parse("2013-12-24 11:50pm"),
|
|
74
|
+
"modifiedBy" => "sethvargo",
|
|
75
|
+
"lastUpdated" => Time.parse("2014-01-01 1:00pm"),
|
|
76
|
+
"size" => "1024",
|
|
77
|
+
"mimeType" => "application/tgz",
|
|
78
|
+
"checksums" => {
|
|
79
|
+
"md5" => "MD5123",
|
|
80
|
+
"sha" => "SHA456",
|
|
81
81
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
"originalChecksums" => {
|
|
83
|
+
"md5" => "MD5123",
|
|
84
|
+
"sha" => "SHA456",
|
|
85
85
|
}
|
|
86
86
|
)
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
app.get(
|
|
90
|
-
content_type
|
|
89
|
+
app.get("/api/storage/ext-release-local/org/acme/artifact.deb") do
|
|
90
|
+
content_type "application/vnd.org.jfrog.artifactory.storage.FileInfo+json"
|
|
91
91
|
JSON.fast_generate(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
92
|
+
"uri" => server_url.join("/api/storage/ext-release-local/org/acme/artifact.deb"),
|
|
93
|
+
"downloadUri" => server_url.join("/artifactory/ext-release-local/org/acme/artifact.deb"),
|
|
94
|
+
"repo" => "ext-release-local",
|
|
95
|
+
"path" => "/org/acme/artifact.deb",
|
|
96
|
+
"created" => Time.parse("1995-04-11 11:05am"),
|
|
97
|
+
"createdBy" => "yzl",
|
|
98
|
+
"lastModified" => Time.parse("2013-11-10 10:10pm"),
|
|
99
|
+
"modifiedBy" => "schisamo",
|
|
100
|
+
"lastUpdated" => Time.parse("2014-02-02 2:00pm"),
|
|
101
|
+
"size" => "1024",
|
|
102
|
+
"mimeType" => "application/tgz",
|
|
103
|
+
"checksums" => {
|
|
104
|
+
"md5" => "MD5789",
|
|
105
|
+
"sha" => "SHA101",
|
|
106
106
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
"originalChecksums" => {
|
|
108
|
+
"md5" => "MD5789",
|
|
109
|
+
"sha" => "SHA101",
|
|
110
110
|
}
|
|
111
111
|
)
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
app.get(
|
|
115
|
-
content_type
|
|
114
|
+
app.get("/api/storage/bin-release-local/org/acme/artifact 1.0.0.msi") do
|
|
115
|
+
content_type "application/vnd.org.jfrog.artifactory.storage.FileInfo+json"
|
|
116
116
|
JSON.fast_generate(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
117
|
+
"uri" => server_url.join("/api/storage/bin-release-local/org/acme/artifact 1.0.0.msi"),
|
|
118
|
+
"downloadUri" => server_url.join("/artifactory/bin-release-local/org/acme/artifact 1.0.0.msi"),
|
|
119
|
+
"repo" => "bin-release-local",
|
|
120
|
+
"path" => "/org/acme/artifact 1.0.0.msi",
|
|
121
|
+
"created" => Time.parse("1995-04-11 11:05am"),
|
|
122
|
+
"createdBy" => "yzl",
|
|
123
|
+
"lastModified" => Time.parse("2013-11-10 10:10pm"),
|
|
124
|
+
"modifiedBy" => "schisamo",
|
|
125
|
+
"lastUpdated" => Time.parse("2014-02-02 2:00pm"),
|
|
126
|
+
"size" => "1024",
|
|
127
|
+
"mimeType" => "application/octet-stream",
|
|
128
|
+
"checksums" => {
|
|
129
|
+
"md5" => "MD5789",
|
|
130
|
+
"sha" => "SHA101",
|
|
131
131
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
"originalChecksums" => {
|
|
133
|
+
"md5" => "MD5789",
|
|
134
|
+
"sha" => "SHA101",
|
|
135
135
|
}
|
|
136
136
|
)
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
app.class_eval do
|
|
140
140
|
def artifacts_for_conditions(&block)
|
|
141
|
-
if
|
|
142
|
-
if params[
|
|
141
|
+
if yield
|
|
142
|
+
if params["repos"] == "libs-release-local"
|
|
143
143
|
JSON.fast_generate(
|
|
144
|
-
|
|
145
|
-
{
|
|
144
|
+
"results" => [
|
|
145
|
+
{ "uri" => server_url.join("/api/storage/libs-release-local/org/acme/artifact.deb") },
|
|
146
146
|
]
|
|
147
147
|
)
|
|
148
148
|
else
|
|
149
149
|
JSON.fast_generate(
|
|
150
|
-
|
|
151
|
-
{
|
|
152
|
-
{
|
|
153
|
-
{
|
|
150
|
+
"results" => [
|
|
151
|
+
{ "uri" => server_url.join("/api/storage/libs-release-local/org/acme/artifact.deb") },
|
|
152
|
+
{ "uri" => server_url.join("/api/storage/ext-release-local/org/acme/artifact.deb") },
|
|
153
|
+
{ "uri" => server_url.join("/api/storage/bin-release-local/org/acme/artifact 1.0.0.msi") },
|
|
154
154
|
]
|
|
155
155
|
)
|
|
156
156
|
end
|