package_cloud 0.2.43 → 0.2.44

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd8d70baa95dc0392b7628081e7ada402add8d1b
4
- data.tar.gz: b11a15ec9e89258aa65014ba8d0b8d4618080aed
3
+ metadata.gz: 7a62b096fe5f34a03b636c6e23e85f0f594d60bb
4
+ data.tar.gz: 4434346fce72a318222c0d837db7889ed438805b
5
5
  SHA512:
6
- metadata.gz: daa87bc509eec63173f9f0b416cff5fba27219fda4a8be4aba9fcfb6b10803266ce0514c8b548ad4451ce649f22c7b16d9f370431a9b8328683e641c6d0efca0
7
- data.tar.gz: 57ff22ab7445689ecb7d41b3759b8ab1b020dbd6ffcf7baac9e2e577084a1b5baddba8873b4c9ac62fa51af316b221146dcb53d3710ce6cd43d2fb7fec489a81
6
+ metadata.gz: a2f0caf82796b4486293e2083c83919c22731800a191ea0dd6cd51abcf82a781f56d9557cca49022488d9cbc56fd4528419f3ec5f8fe15b49494b9066960b6ce
7
+ data.tar.gz: 6830a9268a95f8a66d565d42867a40bb108c05bd0783f5d6c9e9f1948051ebe5cfb95b3e8a44c390cfdb4c20a7758a2d01d29fc81951b938a3def8f09216ac84
data/README.md CHANGED
@@ -1,29 +1,412 @@
1
- # PackageCloud
1
+ # packagecloud CLI
2
2
 
3
- TODO: Write a gem description
3
+ Greetings! Welcome to the [packagecloud](https://packagecloud.io) command line
4
+ client, `package_cloud`.
4
5
 
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
6
+ The `package_cloud` command line client allows you to easily:
8
7
 
9
- gem 'package_cloud'
8
+ * Create Debian, RPM, RubyGem, Python, and Maven package repositories on [packagecloud](https://packagecloud.io).
9
+ * Upload Debian, RPM, RubyGem, Python, and Java JAR/WAR packages to your repositories.
10
+ * [Delete packages](https://packagecloud.io/docs#yank_pkg).
11
+ * [Promote packages](https://packagecloud.io/docs#promote_pkg) between repositories.
12
+ * Upload a package signing GPG key.
13
+ * Create and delete [master and read
14
+ tokens](https://packagecloud.io/docs#token_auth) to control repository
15
+ access.
10
16
 
11
- And then execute:
17
+ This tool is intended to be used on the command line either manually or in an
18
+ automated environment (like a build or CI process).
12
19
 
13
- $ bundle
20
+ ## Installation
14
21
 
15
- Or install it yourself as:
22
+ Simply run:
16
23
 
17
24
  $ gem install package_cloud
18
25
 
26
+ to install the command line client.
27
+
28
+ You can now run `package_cloud` from the command line to see the help message
29
+ displayed.
30
+
19
31
  ## Usage
20
32
 
21
- TODO: Write usage instructions here
33
+ ### Getting help
34
+
35
+ You can run `package_cloud help` to get general help information about the
36
+ supported commands.
37
+
38
+ You can also get help information for specific commands by running
39
+ `package_cloud help [command]`. For example, to get help on pushing a package
40
+ you can run: `package_cloud help push`.
41
+
42
+ Additional documentation is also available on our [documentation
43
+ page](https://packagecloud.io/docs).
44
+
45
+ You can interact with our system programmatically as well by using our
46
+ [API](https://packagecloud.io/docs/api).
47
+
48
+ ### Creating a repository
49
+
50
+ You can create a package repository named 'example' on [packagecloud](https://packagecloud.io) by running:
51
+
52
+ ```
53
+ $ package_cloud repository create example
54
+ ```
55
+
56
+ ### Pushing a package
57
+
58
+ You can upload Debian, RPM, RubyGem, Python, or Java packages to any
59
+ repository you've created by using the `push` command.
60
+
61
+ Most package types require specifying a `distribution/version` pair when
62
+ uploading. See the examples that follow for more information.
63
+
64
+ Please note that packages will be available for download via the packagecloud web UI
65
+ immediately after they are uploaded, but they will not necessarily be
66
+ available for installation via a package manager immediately. This is because
67
+ our system rengenerates the repository metadata needed by package managers as a
68
+ background job on our system. Jobs are added to a queue and processed.
69
+ Processing time depends on the number of packages in your repository and the
70
+ number of reindex jobs in front of yours.
71
+
72
+ The following examples will show an example user name of `example-user` and a repository
73
+ name of `example-repository`.
74
+
75
+ After the examples below, there will be an additional section documenting
76
+ important optional parameters you can specify when pushing packages.
77
+
78
+ #### Uploading a Debian package
79
+
80
+ You can upload a Debian package found at the path `/tmp/example.deb` for Ubuntu Xenial by running:
81
+
82
+ ```
83
+ $ package_cloud push example-user/example-repository/ubuntu/xenial /tmp/example.deb
84
+ ```
85
+
86
+ This command will upload `/tmp/example.deb` to the `example-repository`
87
+ repository owned by `example-user` as an Ubuntu Xenial package.
88
+
89
+ We also support Debian source packages (DSCs). You can upload a
90
+ `/tmp/example.dsc` for Ubuntu Xenial by running:
91
+
92
+ ```
93
+ $ package_cloud push example-user/example-repository/ubuntu/xenial /tmp/example.dsc
94
+ ```
95
+
96
+ Note that all files associated with the DSC (like source tarballs, patches,
97
+ etc) must reside in the same directory as the DSC itself.
98
+
99
+ You can specify other Ubuntu or Debian versions. Consult the [full list of
100
+ combinations](https://packagecloud.io/docs#os_distro_version) to find the one
101
+ you need.
102
+
103
+ #### Uploading an RPM package
104
+
105
+ You can upload an RPM package found at the path `/tmp/example.rpm` for CentOS
106
+ 6 by running:
107
+
108
+ ```
109
+ $ package_cloud push example-user/example-repository/el/6 /tmp/example.rpm
110
+ ```
111
+
112
+ This command will upload `/tmp/example.rpm` to the `example-repository`
113
+ repository owned by `example-user` as a CentOS 6 package.
114
+
115
+ You can specify other CentOS, Fedora, Oracle, Scientific Linux, or SUSE versions.
116
+ Consult the
117
+ [full list of combinations](https://packagecloud.io/docs#os_distro_version)
118
+ to find the one you need.
119
+
120
+ #### Uploading a RubyGem package
121
+
122
+ You can upload a RubyGem package found at the path `/tmp/example.gem` by
123
+ running:
124
+
125
+ ```
126
+ $ package_cloud push example-user/example-repository /tmp/example.gem
127
+ ```
128
+
129
+ This command will upload `/tmp/example.gem` to the `example-repository`
130
+ repository owned by `example-user` as a RubyGem package.
131
+
132
+ Note that unlike all other package types, RubyGems do not require any
133
+ additional specification on upload.
134
+
135
+ #### Uploading a Python package
136
+
137
+ You can upload a Python package found at the path `/tmp/example.whl` by
138
+ running:
139
+
140
+ ```
141
+ $ package_cloud push example-user/example-repository/python /tmp/example.whl
142
+ ```
143
+
144
+ This command will upload `/tmp/example.whl` to the `example-repository`
145
+ repository owned by `example-user` as a Python package.
146
+
147
+ We also support Python eggs and source distributions. Note that recent
148
+ versions of pip no longer support installing Python eggs and will fail to find
149
+ eggs in PyPI repositories.
150
+
151
+ If you'd like to upload a Python egg despite this, you can do so by running:
152
+
153
+ ```
154
+ $ package_cloud push example-user/example-repository/python /tmp/example.egg
155
+ ```
156
+
157
+ #### Uploading a Java JAR or WAR package
158
+
159
+ You can upload a Java JAR package found at the path `/tmp/example.jar` by
160
+ running:
161
+
162
+ ```
163
+ $ package_cloud push example-user/example-repository/java/maven2 /tmp/example.jar
164
+ ```
165
+
166
+ WAR files can be uploaded the same way.
167
+
168
+ It is important to note that in some cases (for example: 'fat JARs', or JARs
169
+ without `pom.xml` files, etc) our system will not be able to automatically detect
170
+ the [Maven coordinates](https://maven.apache.org/pom.html#Maven_Coordinates).
171
+ In these cases you will receive an error, and you should specify the
172
+ coordinates manually on the command line:
173
+
174
+ ```
175
+ $ package_cloud push example-user/example-repository/java/maven2 /tmp/example.jar --coordinates=com.mygroup:packagename:1.0.2
176
+ ```
177
+
178
+ #### Additional options
179
+
180
+ There are a few additional options you can use to fine tune package upload for
181
+ more advanced use cases:
182
+
183
+ * `--skip-file-ext-validation` - The CLI will attempt to verify the package's
184
+ file extension. In some cases, this may be unwanted (for example, when
185
+ uploading a randomly generated file name). You can ask the CLI to avoid
186
+ checking the file extension by specifying this flag.
187
+ * `--yes` - When uploading multiple packages the CLI will prompt the user to
188
+ verify their request by typing 'y'. You can skip the prompt by passing this
189
+ flag.
190
+ * `--skip-errors` - Sometimes a mass upload of a directory full of packages
191
+ may fail or be canceled by the user. If you want to re-upload all files
192
+ without having to manually remove files you have already uploaded, you can
193
+ use this flag to skip the duplicate file errors and force the CLI to
194
+ continue uploading packages.
195
+ * `--coordinates` - This flag is used for Java JARs or WARs which do not have
196
+ an internal `pom.xml` specifying the Maven coordinates. You can specify your
197
+ own Maven coordinates for this file using this flag: `--coordinates=com.mygroup:packagename:1.0.2`.
198
+ * `--config` - This flag is used to specify a custom configuration file path
199
+ for the CLI. This file specifies the website URL and your API token. This is
200
+ default to `~/.packagecloud`.
201
+ * `--url` - This flag is sued to specify a custom URL as the packagecloud
202
+ server. This option is used by packagecloud:enterprise customers to point to
203
+ their installation.
204
+ * `--verbose` - This flag is used to generate additional debug information for
205
+ push operations and is very useful if submitting a bug report to
206
+ packagecloud :)
207
+
208
+ ### Deleting a package
209
+
210
+ You can remove a package by using the `yank` command. You will need to specify
211
+ the full filename of the package and the distribution / version pair (except
212
+ for RubyGems).
213
+
214
+ Removing a package will
215
+ make the package immediately inaccessable from the packagecloud web UI, but it
216
+ may take a few moments for the package to be removed from the repository
217
+ metadata because removals trigger a reindex of the repository.
218
+
219
+ #### Deleting a Debian package
220
+
221
+ You can delete a Debian package named `example_1.0.1-1_amd64.deb` that was
222
+ uploaded for Ubuntu Xenial from the repository `example-repository` owned by
223
+ the user `example-user` by running the following command:
224
+
225
+ ```
226
+ $ package_cloud yank example-user/example-repository/ubuntu/xenial example_1.0.1-1_amd64.deb
227
+ ```
228
+
229
+ This will delete the package and trigger a reindex of the repository's
230
+ metadata.
231
+
232
+ #### Deleting an RPM package
233
+
234
+ You can delete an RPM package named `example-1.0-1.x86_64.rpm' that was
235
+ uploaded for CentOS 6 from the repository `example-repository` owned by
236
+ the user `example-user` by running the following command:
237
+
238
+ ```
239
+ $ package_cloud yank example-user/example-repository/el/6 example-1.0-1.x86_64.rpm
240
+ ```
241
+
242
+ This will delete the package and trigger a reindex of the repository's
243
+ metadata.
244
+
245
+ #### Deleting a RubyGem package
246
+
247
+ You can delete a RubyGem package named `example-1.0.gem' from the
248
+ repository `example-repository` owned by the user `example-user`
249
+ by running the following command:
250
+
251
+ ```
252
+ $ package_cloud yank example-user/example-repository example-1.0.gem
253
+ ```
254
+
255
+ This will delete the package and trigger a reindex of the repository's
256
+ metadata.
257
+
258
+ #### Deleting a Python package
259
+
260
+ You can delete a Python package named `example-1.0.1.whl` from the repository
261
+ `example-repository` owned by the user `example-user` by running the following
262
+ command:
263
+
264
+ ```
265
+ $ package_cloud yank example-user/example-repository example-1.0.1.whl
266
+ ```
267
+
268
+ This will delete the package and trigger a reindex of the repository's metadata.
269
+ Python eggs and sdists can be deleted in a similar manner.
270
+
271
+
272
+ #### Deleting a Java package
273
+
274
+ You can delete a Java package named `example-1.0.3.jar` from the repository
275
+ `example-repository` owned by the user `example-user` by running the following
276
+ command:
277
+
278
+ ```
279
+ $ package_cloud yank example-user/example-repository example-1.0.3.jar
280
+ ```
281
+
282
+ This will delete the package and trigger a reindex of the repository's
283
+ metadata. WARs can be deleted in a similar manner.
284
+
285
+ ### GPG Keys
286
+
287
+ Some package managers use [GPG keys](https://packagecloud.io/docs#gpg)
288
+ to verify that a package was created by the author and not an impersonator.
289
+
290
+ If you sign your packages with a GPG key before you upload them to
291
+ packagecloud, your package will still be signed when the user downloads it.
292
+
293
+ In these cases, especially with YUM repositories, it is useful to upload the
294
+ public GPG key that can verify the package you signed. When a user installs
295
+ your repository, the associated GPG key will be installed on their system and
296
+ used for verifying the package.
297
+
298
+ The follow sections will illustrate how to upload, list, and delete GPG keys.
299
+
300
+ #### Uploading a package signing GPG key
301
+
302
+ To upload a GPG key located on
303
+ your system at `/tmp/gpg.key` for the repository `example-repository` owned by
304
+ the user `example-user`, you can run the following command:
305
+
306
+ ```
307
+ $ package_cloud gpg_key create example-user/example-repository /tmp/gpg.key
308
+ ```
309
+
310
+ Note that if you attempt to upload a private key to packagecloud, we will
311
+ extract only the public key component. The private key will then be discarded.
312
+ We do not store or persist private keys at all.
313
+
314
+ #### Listing GPG keys associated with a repository
315
+
316
+ You can list the GPG keys associated with the repository `example-repository`
317
+ owned by user `example-user` by running the following command:
318
+
319
+ ```
320
+ $ package_cloud gpg_key list example-user/example-repository
321
+ ```
322
+
323
+ The key name specified in the output of this command is the key name you should
324
+ specify when deleting the key.
325
+
326
+ #### Deleting GPG keys associated with a repository
327
+
328
+ You can delete the GPG key named
329
+ `example-user-example-repository-56D06.pub.gpg` associated with the repository
330
+ named `example-repository` and owned by the user `example-user` by running the
331
+ following command:
332
+
333
+ ```
334
+ $ package_cloud gpg_key destroy example-user/example-repository example-user-example-repository-56D06.pub.gpg
335
+ ```
336
+
337
+ You can get the key name for a key you'd like to delete by using the GPG key
338
+ list command above.
339
+
340
+ ### Promoting packages between repositories
341
+
342
+ Package promotion is a feature which can be used to easily move packages
343
+ between repositories. This is useful for moving a package from a private
344
+ staging repository to a public production ready repository during a software release
345
+ workflow.
346
+
347
+ To move a package named `example_1.0-1_amd64.deb` from the user
348
+ `example-user`'s repository named `repo1` over to the same users repository
349
+ named `repo2`, you would issue the following command:
350
+
351
+ ```
352
+ $ package_cloud promote example-user/repo1/ubuntu/xenial example_1.0-1_amd64.deb example-user/repo2
353
+ ```
354
+
355
+ After the package is moved, a reindex will be triggered for both `repo1` and
356
+ `repo2`.
357
+
358
+ ### Creating, deleting, and listing master and read tokens
359
+
360
+ The [token authentication](https://packagecloud.io/docs/#token_auth) system
361
+ used for repositories allows fine grained access control of repositories.
362
+
363
+ Master tokens can be used just for creating additional read tokens. Master
364
+ tokens themselves do not provide read access to a repository. Deleting
365
+ a master token automatically deletes all associated read tokens.
366
+
367
+ A typical use case for our token system would be a SaaS service distributing
368
+ a monitoring agent who wants to control download access to their repository.
369
+
370
+ A master token can be created per customer that signs up and read tokens
371
+ associated with the generated master token can be assigned per system. Then,
372
+ the read tokens can be deleted one at a time (to disable access on a
373
+ per-machine basis) or completely by deleting the associated master token.
374
+
375
+ #### Creating master tokens
376
+
377
+ Following from the example explained in the previous section,
378
+ you can create a master token name "Example-Token" for the repository
379
+ `example-repository` owned by the user `example-user` by running the following
380
+ command:
381
+
382
+ ```
383
+ $ package_cloud master_token create example-user/example-repository Example-Token
384
+ ```
385
+
386
+ #### Listing master tokens
387
+
388
+ You can list all master tokens associated with the repository
389
+ `example-repository` owned by the user `example-user` by running the following
390
+ command:
391
+
392
+ ```
393
+ $ package_cloud master_token list example-user/example-repository
394
+ ```
395
+
396
+ #### Deleting master tokens
397
+
398
+ You can delete the token named `Example-Token` associated with the
399
+ repository `example-repository` owned by the user `example-user` by running
400
+ the following command:
401
+
402
+ ```
403
+ $ package_cloud master_token destroy example-user/example-repository Example-Token
404
+ ```
405
+
406
+ This will also automatically delete all read tokens associated with this
407
+ master token, thereby revoking read access to the repository with those
408
+ tokens.
22
409
 
23
- ## Contributing
410
+ ## Still need help?
24
411
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
412
+ Feel free to reach out to [support@packagecloud.io](mailto:support@packagecloud.io) with questions.
@@ -12,9 +12,9 @@ module PackageCloud
12
12
  autoload :GpgKey, "package_cloud/cli/gpg_key"
13
13
 
14
14
  class Base < Thor
15
- class_option "config"
16
- class_option "url"
17
- class_option "verbose"
15
+ class_option "config", :desc => "Specify a path to config file containing your API token and URL; default is ~/.packagecloud"
16
+ class_option "url", :desc => "Specify the website URL to use; default is https://packagecloud.io. Useful for packagecloud:enterprise users."
17
+ class_option "verbose", :type => :boolean, :desc => "Enable verbose mode."
18
18
 
19
19
  private
20
20
  def get_valid(prompt)
@@ -64,11 +64,20 @@ module PackageCloud
64
64
  end
65
65
 
66
66
  desc "push user/repo[/distro/version] /path/to/packages",
67
- "push package(s) to repository (in distro/version if required)"
68
- option "skip-file-ext-validation", :type => :boolean
69
- option "yes", :type => :boolean
70
- option "skip-errors", :type => :boolean
71
- option "coordinates", :type => :string
67
+ "Push package(s) to repository (in distro/version, if required). Optional settings shown above."
68
+
69
+ option "skip-file-ext-validation", :type => :boolean,
70
+ :desc => "Skip checking validation of the file extension. Package upload will be attempted even if the extension is unrecognized."
71
+
72
+ option "yes", :type => :boolean,
73
+ :desc => "Automatically answer 'yes' prompted during package push. Useful for automating uploads."
74
+
75
+ option "skip-errors", :type => :boolean,
76
+ :desc => "Skip errors encountered during a package push and continue pushing the next package."
77
+
78
+ option "coordinates", :type => :string,
79
+ :desc => "Specify the exact maven coordinates to use for a JAR. Useful for JARs without coordinates, 'fat JARs', and WARs."
80
+
72
81
  def push(repo, package_file, *package_files)
73
82
  total_time = Benchmark.measure do
74
83
  ARGV.clear # otherwise gets explodes
@@ -1,7 +1,7 @@
1
1
  module PackageCloud
2
2
  MAJOR_VERSION = "0"
3
3
  MINOR_VERSION = "2"
4
- PATCH_VERSION = "43"
4
+ PATCH_VERSION = "44"
5
5
 
6
6
  VERSION = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join(".")
7
7
  end
@@ -8,8 +8,9 @@ Gem::Specification.new do |spec|
8
8
  spec.version = PackageCloud::VERSION
9
9
  spec.authors = ["Joe Damato"]
10
10
  spec.email = ["support@packagecloud.io"]
11
- spec.description = %q{https://packagecloud.io}
12
- spec.summary = %q{https://packagecloud.io}
11
+ spec.description = %q{The https://packagecloud.io CLI for uploading Debian, RPM, RubyGem, Python, and Java packages. Check our website or the RubyDoc documentation for detailed information.}
12
+ spec.summary = %q{The https://packagecloud.io CLI for uploading Debian, RPM, RubyGem, Python, and Java packages. Check our website or the RubyDoc documentation for detailed information.}
13
+
13
14
  spec.homepage = "https://packagecloud.io"
14
15
  spec.license = "MIT"
15
16
 
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.43
4
+ version: 0.2.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Damato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-07 00:00:00.000000000 Z
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -108,7 +108,8 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- description: https://packagecloud.io
111
+ description: The https://packagecloud.io CLI for uploading Debian, RPM, RubyGem, Python,
112
+ and Java packages. Check our website or the RubyDoc documentation for detailed information.
112
113
  email:
113
114
  - support@packagecloud.io
114
115
  executables:
@@ -165,5 +166,6 @@ rubyforge_project:
165
166
  rubygems_version: 2.4.4
166
167
  signing_key:
167
168
  specification_version: 4
168
- summary: https://packagecloud.io
169
+ summary: The https://packagecloud.io CLI for uploading Debian, RPM, RubyGem, Python,
170
+ and Java packages. Check our website or the RubyDoc documentation for detailed information.
169
171
  test_files: []