aptly_cli 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.travis.yml +8 -1
- data/README.md +65 -0
- data/aptly_cli.gemspec +3 -2
- data/bin/aptly-cli +22 -0
- data/lib/aptly_cli/version.rb +1 -1
- data/lib/aptly_file.rb +25 -3
- metadata +34 -20
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NzYwM2FhMDFmMTM2YWI5NjFkY2JmMDE4YjY4Yzk0Y2VmNDRmMmExOA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZjQ5NjZlYTJkZGYxYzcxOWMwZjlkZTAxNjZjMTA1NmEyNDFiOGQ5ZQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MTk3YTY3ODc2NWVjZjk1ZTRiYjZhODgzOTA3NjlhMTZlYmZlMWMzZDRmZTg4
|
10
|
+
NzJmYzM2MDExMjEzODkwMWQ0MTI2NTlmNjllZTVlMzBkNmY5ZTQxMGQxMjY3
|
11
|
+
NWZjNDMxNGViMTc5NzBiY2I4MGE2NzY4ZWViNDRiY2Y1Zjk4ZjE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
M2QzOWUyZjdjNDZlNjZjOWJlMDFmNTlmZWNkNWFjODVlY2I5OTkxZjY0OTcx
|
14
|
+
ZGM0M2RhYmNlMzNhZGMwMjNiNmNkOWQ4MTVmMmIxY2RjYmZmMDNkMDA5ZWM2
|
15
|
+
OTk0M2EwZWY4N2Q4ZWZhNDEzYmZlMDZiOTg2NjNiODRkYzQzZjE=
|
data/.travis.yml
CHANGED
@@ -1,3 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
|
3
|
+
- 1.9.3
|
4
|
+
- 2.2.0
|
5
|
+
- 2.2.1
|
6
|
+
- ruby-head
|
7
|
+
deploy:
|
8
|
+
provider: rubygems
|
9
|
+
api_key:
|
10
|
+
secure: EKpsyP07VCbhH4Y/kF00ylB14R1iRekrmqcsC6No1Cf2dELwqeypQfwo3lLTZXhB0DjjgZSuXcnzw+QRTx+xZ6U7gsLrGDoKMd/irr+TBb2qyQhSBmjYuxHAWnRBtFdxWztsh77qi2SVDG7VIaJ94HnTTEjvaRhabsrOUI80MD8=
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# AptlyCli
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/sepulworld/aptly_cli.svg)](https://travis-ci.org/sepulworld/aptly_cli)
|
4
|
+
|
3
5
|
A command line interace to execute Aptly commands againts a remote Aptly API server. Aptly-cli will allow you to interact with the repo, snapshot, publish, packages, graph and version API endpoints of your Aptly server.
|
4
6
|
|
5
7
|
## Installation
|
@@ -20,6 +22,69 @@ Or install it yourself as:
|
|
20
22
|
|
21
23
|
## Usage
|
22
24
|
|
25
|
+
### aptly-cli file [options]
|
26
|
+
|
27
|
+
DESCRIPTION:
|
28
|
+
|
29
|
+
All uploaded files are stored under rootDir/upload directory (see your Aptly configuration). This directory would be created automatically if it doesn’t exist. Uploaded files are grouped by directories to support concurrent uploads from multiple package sources. Local repos add API can operate on directory (adding all files from directory) or on individual package files. By default, all successfully added package files would be removed.
|
30
|
+
|
31
|
+
EXAMPLES:
|
32
|
+
|
33
|
+
# List of directories or files
|
34
|
+
aptly-cli file --list /
|
35
|
+
geoipupdate_2.0.0_amd64.deb
|
36
|
+
geoipupdate_2.0.0_i386.deb
|
37
|
+
mongo
|
38
|
+
mongodb-mms-monitoring-agent_latest_i386.deb
|
39
|
+
redis
|
40
|
+
redis-server_2.8.3_amd64-cc1.deb
|
41
|
+
test
|
42
|
+
xsp_2.11.0.0-git-master-04062013_i386.deb
|
43
|
+
|
44
|
+
# Upload file to a directory
|
45
|
+
aptly-cli file --upload /tmp/redis/test_1.0_amd64.deb --dest_uri /redis
|
46
|
+
test/test_1.0_amd64.deb
|
47
|
+
|
48
|
+
# Delete file or directory
|
49
|
+
aptly-cli file --delete /redis/test_1.0_amd64.deb
|
50
|
+
{}
|
51
|
+
|
52
|
+
OPTIONS:
|
53
|
+
|
54
|
+
--list URI_FILE_PATH
|
55
|
+
URI path to list files
|
56
|
+
|
57
|
+
--upload LOCAL_FILE_PATH/PACKAGE
|
58
|
+
Path to package to upload
|
59
|
+
|
60
|
+
--dest_uri URI_FILE_PATH
|
61
|
+
URI path to directory to upload into
|
62
|
+
|
63
|
+
--delete URI_FILE_PATH/PACKAGE
|
64
|
+
URI path to directory to delete or specific package
|
65
|
+
|
66
|
+
### aptly-cli repo [options]
|
67
|
+
|
68
|
+
TODO
|
69
|
+
|
70
|
+
### aptly-cli snapshot [options]
|
71
|
+
|
72
|
+
TODO
|
73
|
+
|
74
|
+
### aptly-cli publish [options]
|
75
|
+
|
76
|
+
TODO
|
77
|
+
|
78
|
+
### aptly-cli package [options]
|
79
|
+
|
80
|
+
TODO
|
81
|
+
|
82
|
+
### aptly-cli graph [options]
|
83
|
+
|
84
|
+
TODO
|
85
|
+
|
86
|
+
### aptly-cli version
|
87
|
+
|
23
88
|
TODO
|
24
89
|
|
25
90
|
## Development
|
data/aptly_cli.gemspec
CHANGED
@@ -23,11 +23,12 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
-
spec.add_development_dependency "bundler"
|
26
|
+
spec.add_development_dependency "bundler"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
28
28
|
spec.add_development_dependency "webmock", "~> 1.20"
|
29
29
|
spec.add_development_dependency "vcr", "~> 2.9"
|
30
|
-
|
30
|
+
spec.add_development_dependency "minitest"
|
31
|
+
|
31
32
|
spec.add_dependency "httmultiparty", "~> 0.3.16"
|
32
33
|
spec.add_dependency "commander", "~> 4.3"
|
33
34
|
end
|
data/bin/aptly-cli
CHANGED
@@ -2,10 +2,32 @@
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'commander/import'
|
5
|
+
require 'aptly_cli'
|
5
6
|
|
6
7
|
program :version, '0.0.1'
|
7
8
|
program :description, 'Aptly repository API client'
|
8
9
|
|
10
|
+
command :file do |c|
|
11
|
+
c.syntax = 'aptly-cli file [options]'
|
12
|
+
c.summary = 'Upload package files temporarily to aptly service'
|
13
|
+
|
14
|
+
c.description = 'All uploaded files are stored under <rootDir>/upload directory (see configuration). This directory would be created automatically if it doesn’t exist. Uploaded files are grouped by directories to support concurrent uploads from multiple package sources. Local repos add API can operate on directory (adding all files from directory) or on individual package files. By default, all successfully added package files would be removed.'
|
15
|
+
|
16
|
+
c.example 'List of directories or files', 'aptly-cli file --list / or aptly-cli file --list /redis'
|
17
|
+
c.example 'Upload file to a directory', 'aptly-cli file --upload /tmp/redis/test_1.0_amd64.deb --dest_uri /redis'
|
18
|
+
c.example 'Delete file or directory', 'aptly-cli file --delete /test/test_1.0_amd64.deb'
|
19
|
+
c.option '--list URI_FILE_PATH', String, 'URI path to list files'
|
20
|
+
c.option '--upload LOCAL_FILE_PATH/PACKAGE', String, 'Path to package to upload'
|
21
|
+
c.option '--dest_uri URI_FILE_PATH', String, 'URI path to directory to upload into'
|
22
|
+
c.option '--delete URI_FILE_PATH/PACKAGE', String, 'URI path to directory to delete or specific package'
|
23
|
+
c.action do |args, options|
|
24
|
+
aptly_command = AptlyCli::AptlyFile.new
|
25
|
+
puts aptly_command.file_get(options.list) if options.list
|
26
|
+
puts aptly_command.file_post(:file_uri => options.dest_uri, :package => options.upload, :local_file => options.upload) if options.upload and options.dest_uri
|
27
|
+
puts aptly_command.file_delete(options.delete) if options.delete
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
9
31
|
command :repo do |c|
|
10
32
|
c.syntax = 'aptly-cli repo [options]'
|
11
33
|
c.summary = ''
|
data/lib/aptly_cli/version.rb
CHANGED
data/lib/aptly_file.rb
CHANGED
@@ -5,13 +5,35 @@ require "httmultiparty"
|
|
5
5
|
module AptlyCli
|
6
6
|
class AptlyFile
|
7
7
|
|
8
|
-
# http://beta.aptly.info/doc/api/files/
|
9
|
-
|
10
8
|
include HTTMultiParty
|
9
|
+
attr_accessor :file_uri, :package, :local_file_path
|
11
10
|
|
11
|
+
# Load aptly-cli.conf and establish base_uri
|
12
12
|
config = AptlyCli::AptlyLoad.new.configure_with("/etc/aptly-cli.conf")
|
13
|
+
base_uri "http://#{config[:server]}:#{config[:port]}/api"
|
14
|
+
|
15
|
+
def initialize(file_uri=nil, package=nil, local_file_path=nil)
|
16
|
+
end
|
17
|
+
|
18
|
+
def file_get(file_uri)
|
19
|
+
if file_uri == "/"
|
20
|
+
uri = "/files"
|
21
|
+
else
|
22
|
+
uri = "/files" + file_uri
|
23
|
+
end
|
24
|
+
|
25
|
+
self.class.get uri
|
26
|
+
end
|
27
|
+
|
28
|
+
def file_delete(file_uri)
|
29
|
+
uri = "/files" + file_uri
|
30
|
+
self.class.delete uri
|
31
|
+
end
|
13
32
|
|
14
|
-
|
33
|
+
def file_post(post_options = {})
|
34
|
+
api_file_uri = "/files" + post_options[:file_uri].to_s
|
35
|
+
self.class.post(api_file_uri, :query => { :package => post_options[:package], :file => File.new(post_options[:local_file])} )
|
36
|
+
end
|
15
37
|
|
16
38
|
end
|
17
39
|
end
|
metadata
CHANGED
@@ -1,97 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aptly_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zane
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: webmock
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.20'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.20'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: vcr
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '2.9'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.9'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: httmultiparty
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ~>
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: 0.3.16
|
76
90
|
type: :runtime
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ~>
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: 0.3.16
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: commander
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- -
|
101
|
+
- - ~>
|
88
102
|
- !ruby/object:Gem::Version
|
89
103
|
version: '4.3'
|
90
104
|
type: :runtime
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- -
|
108
|
+
- - ~>
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '4.3'
|
97
111
|
description: Aptly API client
|
@@ -101,8 +115,8 @@ executables: []
|
|
101
115
|
extensions: []
|
102
116
|
extra_rdoc_files: []
|
103
117
|
files:
|
104
|
-
-
|
105
|
-
-
|
118
|
+
- .gitignore
|
119
|
+
- .travis.yml
|
106
120
|
- CODE_OF_CONDUCT.md
|
107
121
|
- Gemfile
|
108
122
|
- LICENSE.txt
|
@@ -127,12 +141,12 @@ require_paths:
|
|
127
141
|
- lib
|
128
142
|
required_ruby_version: !ruby/object:Gem::Requirement
|
129
143
|
requirements:
|
130
|
-
- -
|
144
|
+
- - ! '>='
|
131
145
|
- !ruby/object:Gem::Version
|
132
146
|
version: '0'
|
133
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
148
|
requirements:
|
135
|
-
- -
|
149
|
+
- - ! '>='
|
136
150
|
- !ruby/object:Gem::Version
|
137
151
|
version: '0'
|
138
152
|
requirements: []
|