deb-s3 0.5.0 → 0.5.1
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.
- data/README.md +1 -0
- data/lib/deb/s3.rb +1 -1
- data/lib/deb/s3/cli.rb +14 -8
- data/lib/deb/s3/release.rb +2 -2
- data/lib/deb/s3/utils.rb +2 -0
- metadata +2 -2
data/README.md
CHANGED
|
@@ -94,6 +94,7 @@ Usage:
|
|
|
94
94
|
|
|
95
95
|
Options:
|
|
96
96
|
-f, [--fix-manifests] # Whether to fix problems in manifests when verifying.
|
|
97
|
+
[--sign=SIGN] # Sign the Release file. Use --sign with your key ID to use a specific key.
|
|
97
98
|
-b, [--bucket=BUCKET] # The name of the S3 bucket to upload to.
|
|
98
99
|
-c, [--codename=CODENAME] # The codename of the APT repository.
|
|
99
100
|
# Default: stable
|
data/lib/deb/s3.rb
CHANGED
data/lib/deb/s3/cli.rb
CHANGED
|
@@ -52,6 +52,17 @@ class Deb::S3::CLI < Thor
|
|
|
52
52
|
:desc => "The access policy for the uploaded files. " +
|
|
53
53
|
"Can be public, private, or authenticated."
|
|
54
54
|
|
|
55
|
+
class_option :sign,
|
|
56
|
+
:type => :string,
|
|
57
|
+
:desc => "Sign the Release file when uploading a package," +
|
|
58
|
+
"or when verifying it after removing a package." +
|
|
59
|
+
"Use --sign with your key ID to use a specific key."
|
|
60
|
+
|
|
61
|
+
class_option :gpg_options,
|
|
62
|
+
:default => "",
|
|
63
|
+
:type => :string,
|
|
64
|
+
:desc => "Additional command line options to pass to GPG when signing"
|
|
65
|
+
|
|
55
66
|
desc "upload FILES",
|
|
56
67
|
"Uploads the given files to a S3 bucket as an APT repository."
|
|
57
68
|
|
|
@@ -60,11 +71,6 @@ class Deb::S3::CLI < Thor
|
|
|
60
71
|
:aliases => "-a",
|
|
61
72
|
:desc => "The architecture of the package in the APT repository."
|
|
62
73
|
|
|
63
|
-
option :sign,
|
|
64
|
-
:type => :string,
|
|
65
|
-
:desc => "Sign the Release file. Use --sign with your key ID to use " +
|
|
66
|
-
"a specific key."
|
|
67
|
-
|
|
68
74
|
option :preserve_versions,
|
|
69
75
|
:default => false,
|
|
70
76
|
:type => :boolean,
|
|
@@ -91,8 +97,6 @@ class Deb::S3::CLI < Thor
|
|
|
91
97
|
# configure AWS::S3
|
|
92
98
|
configure_s3_client
|
|
93
99
|
|
|
94
|
-
Deb::S3::Utils.signing_key = options[:sign]
|
|
95
|
-
|
|
96
100
|
# retrieve the existing manifests
|
|
97
101
|
log("Retrieving existing manifests")
|
|
98
102
|
release = Deb::S3::Release.retrieve(options[:codename])
|
|
@@ -218,7 +222,9 @@ class Deb::S3::CLI < Thor
|
|
|
218
222
|
|
|
219
223
|
AWS::S3::DEFAULT_HOST.replace options[:endpoint] if options[:endpoint]
|
|
220
224
|
|
|
221
|
-
Deb::S3::Utils.bucket
|
|
225
|
+
Deb::S3::Utils.bucket = options[:bucket]
|
|
226
|
+
Deb::S3::Utils.signing_key = options[:sign]
|
|
227
|
+
Deb::S3::Utils.gpg_options = options[:gpg_options]
|
|
222
228
|
|
|
223
229
|
# make sure we have a valid visibility setting
|
|
224
230
|
Deb::S3::Utils.access_policy = case options[:visibility]
|
data/lib/deb/s3/release.rb
CHANGED
|
@@ -41,7 +41,7 @@ class Deb::S3::Release
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def parse(str)
|
|
44
|
-
parse = lambda do |field|
|
|
44
|
+
parse = lambda do |field|
|
|
45
45
|
value = str[/^#{field}: .*/]
|
|
46
46
|
if value.nil?
|
|
47
47
|
return nil
|
|
@@ -91,7 +91,7 @@ class Deb::S3::Release
|
|
|
91
91
|
# sign the file, if necessary
|
|
92
92
|
if Deb::S3::Utils.signing_key
|
|
93
93
|
key_param = Deb::S3::Utils.signing_key != "" ? "--default-key=#{Deb::S3::Utils.signing_key}" : ""
|
|
94
|
-
if system("gpg -a #{key_param} -b #{release_tmp.path}")
|
|
94
|
+
if system("gpg -a #{key_param} #{Deb::S3::Utils.gpg_options} -b #{release_tmp.path}")
|
|
95
95
|
local_file = release_tmp.path+".asc"
|
|
96
96
|
remote_file = self.filename+".gpg"
|
|
97
97
|
yield remote_file if block_given?
|
data/lib/deb/s3/utils.rb
CHANGED
|
@@ -9,6 +9,8 @@ module Deb::S3::Utils
|
|
|
9
9
|
def access_policy= v; @access_policy = v end
|
|
10
10
|
def signing_key; @signing_key end
|
|
11
11
|
def signing_key= v; @signing_key = v end
|
|
12
|
+
def gpg_options; @gpg_options end
|
|
13
|
+
def gpg_options= v; @gpg_options = v end
|
|
12
14
|
|
|
13
15
|
def safesystem(*args)
|
|
14
16
|
success = system(*args)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: deb-s3
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
12
|
+
date: 2013-07-02 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: thor
|