aptly_cli 0.3.10 → 0.4.0

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: 78bc1dfa2d2c3dd298fbbb8e5f9525645fce2c82
4
- data.tar.gz: 0ddce3611086b22d48b81b09920745e3470efa56
3
+ metadata.gz: e642d93419b2a6d81bf04bac54c1d24dc69eaa33
4
+ data.tar.gz: 55f8cea82245ec516e704cb97db949dae6309f33
5
5
  SHA512:
6
- metadata.gz: ad30a3f4ad9908f64f729f680580a21b94ccff5e000e8fb84b78317d4c94753e5cf09e42820a1af93e3d8d89fc858c3c8d53fa56357edaffe0f478dc6bbe9afb
7
- data.tar.gz: 6caba78a3bedc3c2cab6ca24d4e35e4bd92f380b5a92fb692cb57b8b91148025c1e088f733d3c5b37e3888115ade2d7113a553ed4bcf956b9e7525e285db34ee
6
+ metadata.gz: 755d5865351c1e0610407b67defc8e7d8406bc91f3f8384684d442d33efdb6a18ee7c051b5a014a7d0ef3bcec744a8bbc58183e5fb727db9db7ba171baf566ac
7
+ data.tar.gz: c72b85c4a25cb6965c9fa58f2bf397d1aa81147a14960afff59f98b15784a4c2701037b2b2d4d2191b48f4e7301e4fd34949823b8e3f8ebd945199467bc76cc8
data/bin/aptly-cli CHANGED
@@ -183,6 +183,34 @@ command :repo_list do |c|
183
183
  end
184
184
  end
185
185
 
186
+ command :repo_package_add do |c|
187
+ c.syntax = 'aptly-cli repo_package_add [options]'
188
+ c.summary = 'Add existing package to local repository'
189
+ c.description = 'Add existing package to local repository'
190
+ c.example 'Add packages to local repository', 'aptly-cli repo_package_add --name megatronsoftware \'Pamd64 geoipupdate 2.0.0 87f1591307e50817\' \'Pi386 geoipupdate 2.0.0 87f1591307e50817\''
191
+ c.option '--name NAME', String, 'Local repository name, required'
192
+ c.action do |args, options|
193
+ config = AptlyCli::AptlyLoad.new.configure_with($config_file)
194
+ handle_global_options options
195
+ aptly_command = AptlyCli::AptlyRepo.new(config, options)
196
+ puts aptly_command.repo_package_add({ :name => options.name }, args)
197
+ end
198
+ end
199
+
200
+ command :repo_package_delete do |c|
201
+ c.syntax = 'aptly-cli repo_package_delete [options]'
202
+ c.summary = 'Delete package from local repository'
203
+ c.description = 'Delete package from local repository'
204
+ c.example 'Delete packages from local repository', 'aptly-cli repo_package_delete --name megatronsoftware \'Pamd64 geoipupdate 2.0.0 87f1591307e50817\' \'Pi386 geoipupdate 2.0.0 87f1591307e50817\''
205
+ c.option '--name NAME', String, 'Local repository name, required'
206
+ c.action do |args, options|
207
+ config = AptlyCli::AptlyLoad.new.configure_with($config_file)
208
+ handle_global_options options
209
+ aptly_command = AptlyCli::AptlyRepo.new(config, options)
210
+ puts aptly_command.repo_package_delete({ :name => options.name }, args)
211
+ end
212
+ end
213
+
186
214
  command :repo_package_query do |c|
187
215
  c.syntax = 'aptly-cli repo_package_query [options]'
188
216
  c.summary = 'List all packages or search on repo contents, requires --name'
@@ -249,6 +277,20 @@ command :repo_show do |c|
249
277
  end
250
278
  end
251
279
 
280
+ command :package_show do |c|
281
+ c.syntax = 'aptly-cli package_show [options]'
282
+ c.summary = 'Show package info'
283
+ c.description = 'Show package info'
284
+ c.example 'Show package', 'aptly-cli package_show --package-key \'Pamd64 geoipupdate 2.0.0 87f1591307e50817\''
285
+ c.option '--package-key PACKAGE', String, 'package key'
286
+ c.action do |args, options|
287
+ config = AptlyCli::AptlyLoad.new.configure_with($config_file)
288
+ handle_global_options options
289
+ aptly_command = AptlyCli::AptlyPackage.new(config, options)
290
+ puts aptly_command.package_show(URI.escape(options.package_key))
291
+ end
292
+ end
293
+
252
294
  command :publish_drop do |c|
253
295
  c.syntax = 'aptly-cli publish_drop [options]'
254
296
  c.summary = 'Delete published repository'
@@ -1,3 +1,3 @@
1
1
  module AptlyCli
2
- VERSION = '0.3.10'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  end
data/lib/aptly_repo.rb CHANGED
@@ -51,6 +51,32 @@ module AptlyCli
51
51
  self.class.get(uri)
52
52
  end
53
53
 
54
+ def repo_package_add(repo_options, packages)
55
+ if !repo_options.is_a?(Hash) || repo_options[:name].nil?
56
+ raise ArgumentError.new('Must pass a repository name')
57
+ end
58
+
59
+ uri = '/repos/' + repo_options[:name] + '/packages'
60
+ self.class.post(
61
+ uri,
62
+ body: { PackageRefs: packages }.to_json,
63
+ headers: { 'Content-Type' => 'application/json' }
64
+ )
65
+ end
66
+
67
+ def repo_package_delete(repo_options, packages)
68
+ if !repo_options.is_a?(Hash) || repo_options[:name].nil?
69
+ raise ArgumentError.new('Must pass a repository name')
70
+ end
71
+
72
+ uri = '/repos/' + repo_options[:name] + '/packages'
73
+ self.class.delete(
74
+ uri,
75
+ body: { PackageRefs: packages }.to_json,
76
+ headers: { 'Content-Type' => 'application/json' }
77
+ )
78
+ end
79
+
54
80
  def repo_package_query(repo_options = { name: nil, query: nil,
55
81
  with_deps: false,
56
82
  format: nil })
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptly_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-16 00:00:00.000000000 Z
11
+ date: 2016-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler