package_cloud 0.2.38 → 0.2.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/package_cloud/cli/entry.rb +25 -0
- data/lib/package_cloud/repository.rb +16 -0
- data/lib/package_cloud/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e76372c7e8b4af4d84af99971707593808571b3
|
4
|
+
data.tar.gz: 8c628eedff567d35d46039c4c630051cad5a09b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f52f775a3ab2547c41229873ff4e7970b5dd195bc77f7de82bf25b70fd02957dabdd4e5cf602394c683cc6c9198f9551fa1202cc9516a4d53914ec62acb15c7
|
7
|
+
data.tar.gz: 421b231fcc1b1d17ff1b606b5af01487b1ca2adda034d477c12a83cc804bcaa4789289f89ce09ed357b284fae7159c5e29a5af202fa412a0bb53667ff8284641
|
@@ -13,6 +13,31 @@ module PackageCloud
|
|
13
13
|
desc "read_token SUBCMD ...ARGS", "manage read tokens"
|
14
14
|
subcommand "read_token", ReadToken
|
15
15
|
|
16
|
+
desc "promote user/repo[/distro/version] package_name user/destination_repo",
|
17
|
+
"promotes a package from user/repo [in dist/version] to user/destination_repo [also in dist/version]"
|
18
|
+
def promote(source_repo_desc, package_name, dest_repo_desc)
|
19
|
+
repo_name = source_repo_desc.split("/")[0..1].join("/")
|
20
|
+
dist = source_repo_desc.split("/")[2..3].join("/")
|
21
|
+
|
22
|
+
dest_repo_name = dest_repo_desc.split("/")[0..1].join("/")
|
23
|
+
|
24
|
+
if dist == "" && package_name =~ /\.gem$/
|
25
|
+
dist = "gems"
|
26
|
+
end
|
27
|
+
|
28
|
+
print "Looking for source repository at #{repo_name}... "
|
29
|
+
src_repo = client.repository(source_repo_desc)
|
30
|
+
print "success!\n"
|
31
|
+
|
32
|
+
print "Looking for destination repository at #{dest_repo_name}... "
|
33
|
+
repo = client.repository(dest_repo_desc)
|
34
|
+
print "success!\n"
|
35
|
+
|
36
|
+
print "Attempting to promote #{repo_name}/#{dist}/#{package_name} to #{dest_repo_name}..."
|
37
|
+
packages = src_repo.promote(dist, package_name, dest_repo_name)
|
38
|
+
puts "done!".color(:green)
|
39
|
+
end
|
40
|
+
|
16
41
|
desc "yank user/repo[/distro/version] package_name",
|
17
42
|
"yank package from user/repo [in dist/version]"
|
18
43
|
def yank(repo_desc, package_name)
|
@@ -100,6 +100,22 @@ module PackageCloud
|
|
100
100
|
resp
|
101
101
|
end
|
102
102
|
|
103
|
+
def promote(dist, package_name, dest_repo_name)
|
104
|
+
begin
|
105
|
+
url = PackageCloud::Util.compute_url(@config.base_url, paths["self"] + "/" + [dist, package_name, "promote.json"].compact.join("/"))
|
106
|
+
resp = RestClient.post(url, :destination => dest_repo_name)
|
107
|
+
resp = JSON.parse(resp)
|
108
|
+
rescue RestClient::ResourceNotFound => e
|
109
|
+
print "error:\n".color(:red)
|
110
|
+
json = JSON.parse(e.response)
|
111
|
+
json.each do |k,v|
|
112
|
+
puts "\n\t#{k}: #{v.join(", ")}\n"
|
113
|
+
end
|
114
|
+
puts ""
|
115
|
+
exit(1)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
103
119
|
def yank(dist, package_name)
|
104
120
|
begin
|
105
121
|
url = PackageCloud::Util.compute_url(@config.base_url, paths["self"] + "/" + [dist, package_name].compact.join("/"))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: package_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Damato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -165,4 +165,3 @@ signing_key:
|
|
165
165
|
specification_version: 4
|
166
166
|
summary: https://packagecloud.io
|
167
167
|
test_files: []
|
168
|
-
has_rdoc:
|