menu-cli 0.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/menu/release.rb +10 -11
- data/lib/menu/releases.rb +1 -0
- data/lib/menu/runner.rb +2 -1
- data/lib/menu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11ebfed52f241e9d4ba3b890e5bb1e09af66fd33
|
4
|
+
data.tar.gz: 40c5fa4cf017e73812854572cf793a1050c08d66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8af7884cd085bc0cdafd1e2be084114f851863b8aa5dd190369cf63da3c2d8415b00e3829c2a90aa583d63764add9653b23d4dca21310d9045a2b621272e423d
|
7
|
+
data.tar.gz: 3dccdc5f667f7c8e0445042bce56a8dac95bee4088027de0bbd182ab30d8dac3111ea72d0f879463029039441fa216e0758ef9f2773e05fecee56204e85ee5ac
|
data/lib/menu/release.rb
CHANGED
@@ -2,36 +2,35 @@ require 'aws-sdk'
|
|
2
2
|
require 'digest'
|
3
3
|
module Menu
|
4
4
|
class Release < OpenStruct
|
5
|
+
attr_accessor :options
|
6
|
+
|
5
7
|
def <=> o
|
6
8
|
version <=> o.version
|
7
9
|
end
|
8
10
|
|
9
|
-
def upload_payload
|
11
|
+
def upload_payload
|
10
12
|
unless File.exists? @payload_file
|
11
13
|
puts "Could not open payload"
|
12
14
|
exit 1
|
13
15
|
end
|
14
16
|
s3 = Aws::S3::Client.new(region: 'us-east-1')
|
15
|
-
key = "#{options.component}/v#{self.version}-#{checksum}#{File.extname(@payload_file)}"
|
16
|
-
puts "Uploading payload (#{key}) to S3..." if options.verbose
|
17
|
+
key = "#{options.component}/v#{self.version}-#{@checksum}#{File.extname(@payload_file)}"
|
18
|
+
puts "Uploading payload (#{key}) to S3..." if @options.verbose
|
17
19
|
s3.put_object(
|
18
20
|
acl: "public-read",
|
19
21
|
body: File.open(@payload_file),
|
20
|
-
bucket: options.bucket,
|
22
|
+
bucket: @options.bucket,
|
21
23
|
key: key
|
22
24
|
)
|
23
|
-
puts "Upload complete." if options.verbose
|
25
|
+
puts "Upload complete." if @options.verbose
|
24
26
|
self.payload = ENV['MENU_SSL_URL'] + '/' + key
|
25
27
|
end
|
26
28
|
|
27
29
|
def payload_file= file
|
28
30
|
@payload_file = file
|
31
|
+
puts "Calcuating checksum..." if @options.verbose
|
29
32
|
@checksum = Digest::MD5.file(file).hexdigest
|
30
|
-
|
31
|
-
|
32
|
-
def checksum
|
33
|
-
raise "No payload" unless @checksum
|
34
|
-
@checksum
|
33
|
+
puts "Checksum: "+ @checksum
|
35
34
|
end
|
36
35
|
|
37
36
|
def to_json s
|
@@ -39,7 +38,7 @@ module Menu
|
|
39
38
|
version: version,
|
40
39
|
beta: beta,
|
41
40
|
payload: payload,
|
42
|
-
md5: checksum
|
41
|
+
md5: @checksum
|
43
42
|
}.to_json
|
44
43
|
end
|
45
44
|
end
|
data/lib/menu/releases.rb
CHANGED
data/lib/menu/runner.rb
CHANGED
@@ -19,10 +19,11 @@ module Menu
|
|
19
19
|
log "Beta release" if @options.beta
|
20
20
|
|
21
21
|
r = Release.new
|
22
|
+
r.options = @options
|
22
23
|
r.version = version
|
23
24
|
r.payload_file = @options.payload
|
24
25
|
r.beta = @options.beta
|
25
|
-
r.upload_payload
|
26
|
+
r.upload_payload
|
26
27
|
|
27
28
|
releases << r
|
28
29
|
|
data/lib/menu/version.rb
CHANGED