kpm 0.10.0 → 0.10.1
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/docker/docker-compose.ci.mysql.yml +21 -0
- data/lib/kpm/nexus_helper/cloudsmith_api_calls.rb +5 -3
- data/lib/kpm/plugins_directory.yml +2 -2
- data/lib/kpm/version.rb +1 -1
- data/pom.xml +1 -1
- data/spec/kpm/remote/cloudsmith_api_calls_spec.rb +81 -12
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d052b9c73fbb831cf7469a3f57ae21dfe733ededd65541f7b693117b857d4f7c
|
4
|
+
data.tar.gz: a76a44cac1de427a83183be0d1d271f8f79e35f0945d9722576363a5644be690
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8c51c778cd35a93b2416c8eed3ba9e43d9307ab1df9b6d066ca67384b17c17b32f612445ce102433b261057a137fe5b95b13be5366ec73a79eeb40cedd588ba
|
7
|
+
data.tar.gz: b634baf2edc85f1f0f0880dc4d1c81deb434affe7ee4065825f31fcffa53fe9f6a62fc5849e93b00d44cf9da64952a3e9c0431d89e73e6edd58541bd47175619
|
@@ -0,0 +1,21 @@
|
|
1
|
+
version: '3.8'
|
2
|
+
|
3
|
+
services:
|
4
|
+
killbill:
|
5
|
+
network_mode: host
|
6
|
+
image: killbill/killbill:0.22.1
|
7
|
+
environment:
|
8
|
+
- KILLBILL_CATALOG_URI=SpyCarAdvanced.xml
|
9
|
+
- KILLBILL_DAO_URL=jdbc:mysql://0.0.0.0:3306/killbill
|
10
|
+
- KILLBILL_DAO_USER=root
|
11
|
+
- KILLBILL_DAO_PASSWORD=root
|
12
|
+
- KILLBILL_SERVER_TEST_MODE=true
|
13
|
+
- KILLBILL_INVOICE_SANITY_SAFETY_BOUND_ENABLED=false
|
14
|
+
- KILLBILL_INVOICE_MAX_DAILY_NUMBER_OF_ITEMS_SAFETY_BOUND=-1
|
15
|
+
depends_on:
|
16
|
+
- db
|
17
|
+
db:
|
18
|
+
network_mode: host
|
19
|
+
image: killbill/mariadb:0.22
|
20
|
+
environment:
|
21
|
+
- MYSQL_ROOT_PASSWORD=root
|
@@ -9,7 +9,11 @@ module KPM
|
|
9
9
|
module NexusFacade
|
10
10
|
class CloudsmithApiCalls < NexusApiCallsV2
|
11
11
|
def pull_artifact_endpoint(coordinates)
|
12
|
-
version_artifact_details =
|
12
|
+
version_artifact_details = begin
|
13
|
+
parent_get_artifact_info(coordinates)
|
14
|
+
rescue StandardError
|
15
|
+
''
|
16
|
+
end
|
13
17
|
|
14
18
|
# For SNAPSHOTs, we need to figure out the version used as part of the filename
|
15
19
|
filename_version = begin
|
@@ -27,8 +31,6 @@ module KPM
|
|
27
31
|
|
28
32
|
alias parent_get_artifact_info get_artifact_info
|
29
33
|
def get_artifact_info(coordinates)
|
30
|
-
super
|
31
|
-
|
32
34
|
_, versioned_artifact, coords = build_base_path_and_coords(coordinates)
|
33
35
|
sha1 = get_sha1(coordinates)
|
34
36
|
"<artifact-resolution>
|
data/lib/kpm/version.rb
CHANGED
data/pom.xml
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
<modelVersion>4.0.0</modelVersion>
|
23
23
|
<groupId>org.kill-bill.billing.installer</groupId>
|
24
24
|
<artifactId>kpm</artifactId>
|
25
|
-
<version>0.10.
|
25
|
+
<version>0.10.1</version>
|
26
26
|
<packaging>pom</packaging>
|
27
27
|
<name>KPM</name>
|
28
28
|
<description>KPM: the Kill Bill Package Manager</description>
|
@@ -24,17 +24,86 @@ describe KPM::NexusFacade, skip_me_if_nil: ENV['CLOUDSMITH_TOKEN'].nil? do
|
|
24
24
|
expect { nexus_remote.search_for_artifacts(coordinates) }.to raise_exception(NoMethodError, 'Cloudsmith has no search support')
|
25
25
|
}
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
# Upload as: cloudsmith push maven -v --group-id com.mycompany.app --artifact-id my-app --packaging pom --version 1.2.3 org/repo my-app-1.2.3.pom
|
28
|
+
# <project>
|
29
|
+
# <modelVersion>4.0.0</modelVersion>
|
30
|
+
# <groupId>com.mycompany.app</groupId>
|
31
|
+
# <artifactId>my-app</artifactId>
|
32
|
+
# <version>1.2.3</version>
|
33
|
+
# <packaging>pom</packaging>
|
34
|
+
# </project>
|
35
|
+
context 'when pulling release artifact' do
|
36
|
+
let(:coordinates_map) do
|
37
|
+
{ version: '1.2.3',
|
38
|
+
group_id: 'com.mycompany.app',
|
39
|
+
artifact_id: 'my-app',
|
40
|
+
packaging: 'pom',
|
41
|
+
classifier: nil }
|
42
|
+
end
|
43
|
+
let(:coordinates) { KPM::Coordinates.build_coordinates(coordinates_map) }
|
32
44
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
45
|
+
it {
|
46
|
+
response = nil
|
47
|
+
expect { response = nexus_remote.get_artifact_info(coordinates) }.not_to raise_exception
|
48
|
+
parsed_doc = REXML::Document.new(response)
|
49
|
+
expect(parsed_doc.elements['//version'].text).to eq('1.2.3')
|
50
|
+
expect(parsed_doc.elements['//repositoryPath'].text).to eq('/com/mycompany/app/1.2.3/my-app-1.2.3.pom')
|
51
|
+
expect(parsed_doc.elements['//snapshot'].text).to eq('false')
|
52
|
+
}
|
53
|
+
|
54
|
+
it {
|
55
|
+
response = nil
|
56
|
+
destination = Dir.mktmpdir('artifact')
|
57
|
+
expect { response = nexus_remote.pull_artifact(coordinates, destination) }.not_to raise_exception
|
58
|
+
destination = File.join(File.expand_path(destination), response[:file_name])
|
59
|
+
parsed_pom = REXML::Document.new(File.read(destination))
|
60
|
+
expect(parsed_pom.elements['//groupId'].text).to eq('com.mycompany.app')
|
61
|
+
expect(parsed_pom.elements['//artifactId'].text).to eq('my-app')
|
62
|
+
expect(parsed_pom.elements['//version'].text).to eq('1.2.3')
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# File uploaded twice (the first doesn't have any <properties>)
|
67
|
+
# <project>
|
68
|
+
# <modelVersion>4.0.0</modelVersion>
|
69
|
+
# <groupId>com.mycompany.app</groupId>
|
70
|
+
# <artifactId>my-app</artifactId>
|
71
|
+
# <version>1.2.4-SNAPSHOT</version>
|
72
|
+
# <packaging>pom</packaging>
|
73
|
+
# <properties>
|
74
|
+
# <for-kpm>true</for-kpm>
|
75
|
+
# </properties>
|
76
|
+
# </project>
|
77
|
+
context 'when pulling SNAPSHOT artifact' do
|
78
|
+
let(:coordinates_map) do
|
79
|
+
{ version: '1.2.4-SNAPSHOT',
|
80
|
+
group_id: 'com.mycompany.app',
|
81
|
+
artifact_id: 'my-app',
|
82
|
+
packaging: 'pom',
|
83
|
+
classifier: nil }
|
84
|
+
end
|
85
|
+
let(:coordinates) { KPM::Coordinates.build_coordinates(coordinates_map) }
|
86
|
+
|
87
|
+
it {
|
88
|
+
response = nil
|
89
|
+
expect { response = nexus_remote.get_artifact_info(coordinates) }.not_to raise_exception
|
90
|
+
parsed_doc = REXML::Document.new(response)
|
91
|
+
expect(parsed_doc.elements['//version'].text).to eq('1.2.4-SNAPSHOT')
|
92
|
+
expect(parsed_doc.elements['//repositoryPath'].text).to eq('/com/mycompany/app/1.2.4-SNAPSHOT/my-app-1.2.4-SNAPSHOT.pom')
|
93
|
+
expect(parsed_doc.elements['//snapshot'].text).to eq('true')
|
94
|
+
}
|
95
|
+
|
96
|
+
it {
|
97
|
+
response = nil
|
98
|
+
destination = Dir.mktmpdir('artifact')
|
99
|
+
expect { response = nexus_remote.pull_artifact(coordinates, destination) }.not_to raise_exception
|
100
|
+
destination = File.join(File.expand_path(destination), response[:file_name])
|
101
|
+
parsed_pom = REXML::Document.new(File.read(destination))
|
102
|
+
expect(parsed_pom.elements['//groupId'].text).to eq('com.mycompany.app')
|
103
|
+
expect(parsed_pom.elements['//artifactId'].text).to eq('my-app')
|
104
|
+
expect(parsed_pom.elements['//version'].text).to eq('1.2.4-SNAPSHOT')
|
105
|
+
# Verify that if multiple SNAPSHOTs are uploaded, the last one is downloaded (the first one doesn't have <properties>)
|
106
|
+
expect(parsed_pom.elements['//properties/for-kpm'].text).to eq('true')
|
107
|
+
}
|
108
|
+
end
|
40
109
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kill Bill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- README.adoc
|
123
123
|
- Rakefile
|
124
124
|
- bin/kpm
|
125
|
+
- docker/docker-compose.ci.mysql.yml
|
125
126
|
- install_example.yml
|
126
127
|
- kpm.gemspec
|
127
128
|
- lib/kpm.rb
|