package_cloud 0.3.03 → 0.3.04

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
  SHA1:
3
- metadata.gz: a890c54d35d8e20a13b808479d5d951d986287d9
4
- data.tar.gz: 3744f208a831a10f4007588f6a0b69776081f405
3
+ metadata.gz: e95f2cabf64878a9b29d2f5a2ab69436cd45ff65
4
+ data.tar.gz: de1217318fb28244b03147c25ae95196bd3b0781
5
5
  SHA512:
6
- metadata.gz: 92842bf3d910bd4afd50305a2168e74a0a176e36c970b411f73e73b88c983d8bcb157a390a7f3bbe498a42eb4c3569406ba3a7c957731fd02be2e19a990b1154
7
- data.tar.gz: 6b986161cd5e8821a7ff09e3a83416bbe4e6622c42a8e8d98bacbd6a0ea1360e563929c64571211933ee26eab1883d708e033f34d1abbd63868ee71f41e2f5e3
6
+ metadata.gz: d8f05eecc8ae5cf82d7158e320e9f76c2cbcd5b70dfeda3343fdebf44dad66d25af4ac01fd7b2369202006c32a1df333cf8b80a17b69548c8f338aa266a14bc9
7
+ data.tar.gz: a50867145d3412871c80a5ef4683cfdebf9b9008419373efdf510f8b55dd7ffddef6dce6a7b0d02a2b5494c9756337a98be733d90739a42bba8a5696310de13c
data/README.md CHANGED
@@ -3,10 +3,12 @@
3
3
  Greetings! Welcome to the [packagecloud](https://packagecloud.io) command line
4
4
  client, `package_cloud`.
5
5
 
6
- #### Requirements
6
+ ## Requirements
7
+
7
8
  Only Ruby 2.x and greater is supported, please use version 0.2.45 for Ruby 1.9 support.
8
9
 
9
10
  ## Overview
11
+
10
12
  The `package_cloud` command line client allows you to easily:
11
13
 
12
14
  * Create Node.js, Debian, RPM, RubyGem, Python, and Maven package repositories on [packagecloud](https://packagecloud.io).
@@ -71,7 +73,7 @@ that will override the settings found in `~/.packagecloud`:
71
73
  `PACKAGECLOUD_URL`. This environment should only be used by
72
74
  packagecloud:enterprise customers. It allows you to set the URL of the
73
75
  packagecloud installation. Customers using our hosted, cloud based product
74
- should not set this variable; it is defaulted to http://packagecloud.io
76
+ should not set this variable; it is defaulted to `http://packagecloud.io`
75
77
  automatically.
76
78
 
77
79
  ### Pushing a package
@@ -273,7 +275,7 @@ metadata.
273
275
 
274
276
  #### Deleting a RubyGem package
275
277
 
276
- You can delete a RubyGem package named `example-1.0.gem' from the
278
+ You can delete a RubyGem package named `example-1.0.gem` from the
277
279
  repository `example-repository` owned by the user `example-user`
278
280
  by running the following command:
279
281
 
@@ -297,7 +299,6 @@ $ package_cloud yank example-user/example-repository/python example-1.0.1.whl
297
299
  This will delete the package and trigger a reindex of the repository's metadata.
298
300
  Python eggs and sdists can be deleted in a similar manner.
299
301
 
300
-
301
302
  #### Deleting a Java package
302
303
 
303
304
  You can delete a Java package named `example-1.0.3.jar` with the group `com.groupid` from the repository
@@ -330,6 +331,11 @@ $ package_cloud yank example-user/example-repository/node @scoped-user/example-1
330
331
  This will delete the package and trigger a reindex of the registry's
331
332
  metadata.
332
333
 
334
+ Note that deleting Node.js packages can have unexpected side effects when
335
+ mixed with [NPM distribution tags](https://docs.npmjs.com/getting-started/using-tags). Read
336
+ more about how [promoting on packagecloud can affect dist tags
337
+ here.](https://packagecloud.io/docs/#node_promote)
338
+
333
339
  ### GPG Keys
334
340
 
335
341
  Some package managers use [GPG keys](https://packagecloud.io/docs#gpg)
@@ -412,10 +418,14 @@ If the package has a group (Java packages), you can promote it by including the
412
418
  $ package_cloud promote example-user/repo1/java com.groupid/jake-2.3.jar example-user/repo2
413
419
  ```
414
420
 
415
-
416
421
  After the package is moved, a reindex will be triggered for both `repo1` and
417
422
  `repo2`.
418
423
 
424
+ Note that promoting Node.js packages can have unexpected side effects when
425
+ mixed with [NPM distribution tags](https://docs.npmjs.com/getting-started/using-tags). Read
426
+ more about how [promoting on packagecloud can affect dist tags
427
+ here](https://packagecloud.io/docs/#node_promote).
428
+
419
429
  ### Creating, deleting, and listing master and read tokens
420
430
 
421
431
  The [token authentication](https://packagecloud.io/docs/#token_auth) system
@@ -25,7 +25,7 @@ module PackageCloud
25
25
  "promotes a package from user/repo [in dist/version] to user/destination_repo [also in dist/version]"
26
26
  def promote(source_repo_desc, package_name, dest_repo_desc)
27
27
  repo_name = source_repo_desc.split("/")[0..1].join("/")
28
- dist = source_repo_desc.split("/")[2..3].join("/")
28
+ dist = expand_dist_shortcut(source_repo_desc.split("/")[2..3].join("/"))
29
29
 
30
30
  dest_repo_name = expand_dist_shortcut(dest_repo_desc.split("/")[0..1].join("/"))
31
31
 
@@ -42,14 +42,19 @@ module PackageCloud
42
42
  print "success!\n"
43
43
 
44
44
  if package_name.include?('@')
45
- print "Attempting to promote scoped package #{repo_name}/#{dist} #{package_name} to #{dest_repo_name}..."
46
45
  scope, unscoped_package_name = package_scope(package_name)
46
+
47
+ print "Attempting to promote scoped package #{scope}/#{unscoped_package_name} from #{repo_name}/#{dist} to #{dest_repo_name}..."
47
48
  packages = src_repo.promote(dist, unscoped_package_name, dest_repo_name, scope)
48
49
  else
49
50
  print "Attempting to promote #{repo_name}/#{dist}/#{package_name} to #{dest_repo_name}..."
50
51
  packages = src_repo.promote(dist, package_name, dest_repo_name)
51
52
  end
52
53
  puts "done!".color(:green)
54
+
55
+ if dist == "node/1"
56
+ puts "WARNING: This Node.js package will NOT be downloadable by clients until a dist tag is created. Read more: https://packagecloud.io/docs/#node_promote".color(:yellow)
57
+ end
53
58
  end
54
59
 
55
60
  desc "yank user/repo[/distro/version] [@scope/]package_name",
@@ -78,6 +83,10 @@ module PackageCloud
78
83
  repo.yank(dist, package_name)
79
84
  end
80
85
  puts "done!".color(:green)
86
+
87
+ if dist == "node/1"
88
+ puts "WARNING: Deleting Node.js packages can have unexpected side effects with dist tags. Read more: https://packagecloud.io/docs/#node_delete".color(:yellow)
89
+ end
81
90
  end
82
91
 
83
92
  desc "push user/repo[/distro/version] /path/to/packages",
@@ -134,12 +134,12 @@ module PackageCloud
134
134
  begin
135
135
  url = PackageCloud::Util.compute_url(@config.base_url, paths["self"] + "/" + [dist, package_name, "promote.json"].compact.join("/"))
136
136
  resp = if scope
137
- RestClient.post(url, destination: dest_repo_name, scope: scope)
138
- else
139
- RestClient.post(url, destination: dest_repo_name)
140
- end
137
+ RestClient.post(url, destination: dest_repo_name, scope: scope)
138
+ else
139
+ RestClient.post(url, destination: dest_repo_name)
140
+ end
141
141
  resp = JSON.parse(resp)
142
- rescue RestClient::ResourceNotFound => e
142
+ rescue RestClient::UnprocessableEntity, RestClient::ResourceNotFound => e
143
143
  print "error:\n".color(:red)
144
144
  json = JSON.parse(e.response)
145
145
  json.each do |k,v|
@@ -1,7 +1,7 @@
1
1
  module PackageCloud
2
2
  MAJOR_VERSION = "0"
3
3
  MINOR_VERSION = "3"
4
- PATCH_VERSION = "03"
4
+ PATCH_VERSION = "04"
5
5
 
6
6
  VERSION = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join(".")
7
7
  end
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.3.03
4
+ version: 0.3.04
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Damato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-24 00:00:00.000000000 Z
11
+ date: 2018-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.4.8
167
+ rubygems_version: 2.4.4
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: The https://packagecloud.io CLI for uploading Node.js, Debian, RPM, RubyGem,