ploy 0.0.23 → 0.0.24
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 +8 -8
- data/lib/ploy/command/list.rb +27 -25
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODFkNjIwYmIzMWNjZThlMzMxOTM4MWMzNDA3ZTUyZjJkYmQ0MjFlMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWZkMTEzMjFhMTE0NjY2MTk0MWY2Y2MwNmIxZmRhN2E2YTQwYmYwOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGFlMjAzYmQwYjQ1Y2UwYWJlM2Q4NjJhMjliZjA2YTFmMzhjYWYyMzU3YWI0
|
10
|
+
OWE2YWZhOTE2YjEwMGJiYjI5MWZmMGEyNmRiODY1MWZiOGYwZDExMDYxNDEw
|
11
|
+
ZDBlMDgwZGY5MmM2Mjk1Yzc4OTE3NWNlYzY2NWFjODNkYTg5MTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NWYwODUyY2UzZDBiMjMwNzdlOGY3MmY0NjQyZTYzNThmZTAxYWI3Y2I2NDVj
|
14
|
+
MDZiMmU4YWM3OTJjODdkNDhlMzM3MWY2YWI0NGZjZDkyYWYwODgwZWZlMjVh
|
15
|
+
NWZkNmZlYjdlODNhMDQ1NDQ5MGFiN2M2MzRiNzlmODU4NDJmMzc=
|
data/lib/ploy/command/list.rb
CHANGED
@@ -6,42 +6,44 @@ require 'yaml'
|
|
6
6
|
module Ploy
|
7
7
|
module Command
|
8
8
|
class List < Base
|
9
|
+
|
9
10
|
def run(argv)
|
10
11
|
o = {:branch => 'master', :all => false, :json => false, :deploy => nil, :variant => 'blessed'}
|
11
12
|
optparser(o).parse!(argv)
|
12
|
-
#puts o.to_yaml
|
13
|
-
|
14
|
-
bucket = o[:bucket]
|
15
|
-
branch = o[:branch]
|
16
13
|
|
17
|
-
packages = []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
else
|
22
|
-
packages = [o[:deploy]]
|
14
|
+
packages = o[:deploy].nil? ? Ploy::S3Storage.new(o[:bucket]).list : [o[:deploy]]
|
15
|
+
|
16
|
+
generate_list(o[:bucket], packages, o[:branch], o[:variant], o[:json], o[:all]).each do |package|
|
17
|
+
puts package
|
23
18
|
end
|
24
|
-
|
25
|
-
|
19
|
+
end
|
20
|
+
|
21
|
+
def generate_list(bucket, packages, branch, variant, json, all)
|
22
|
+
packages.each_with_object([]) do |name, collection|
|
26
23
|
current = Ploy::Package.new(bucket, name, branch, 'current').remote_version
|
27
|
-
blessed_current = Ploy::Package.new(bucket, name, branch, 'current',
|
24
|
+
blessed_current = Ploy::Package.new(bucket, name, branch, 'current', variant).remote_version
|
25
|
+
|
26
|
+
next unless all || current != blessed_current
|
28
27
|
|
29
|
-
if
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
'sha' => current,
|
34
|
-
'branch' => branch,
|
35
|
-
'blessed_sha' => blessed_current
|
36
|
-
} }
|
37
|
-
puts h.to_json
|
38
|
-
else
|
39
|
-
puts "#{name} #{branch} #{current} #{blessed_current}"
|
40
|
-
end
|
28
|
+
if json
|
29
|
+
collection << json_package(name, branch, current, blessed_current)
|
30
|
+
else
|
31
|
+
collection << "#{name} #{branch} #{current} #{blessed_current}"
|
41
32
|
end
|
42
33
|
end
|
43
34
|
end
|
44
35
|
|
36
|
+
def json_package(package, branch, current, blessed_current)
|
37
|
+
{
|
38
|
+
package => {
|
39
|
+
'name' => package,
|
40
|
+
'sha' => current,
|
41
|
+
'branch' => branch,
|
42
|
+
'blessed_sha' => blessed_current
|
43
|
+
}
|
44
|
+
}.to_json
|
45
|
+
end
|
46
|
+
|
45
47
|
def help
|
46
48
|
return <<helptext
|
47
49
|
usage: ploy -b BUCKET [-d DEPLOYMENT -B BRANCH]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bruce
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.4.2
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Multi-phase deployment tool
|