ploy 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ploy/command/bless.rb +2 -1
- data/lib/ploy/command/install.rb +6 -2
- data/lib/ploy/common.rb +3 -3
- data/lib/ploy/localpackage/debbuilder.rb +1 -1
- data/lib/ploy/package.rb +14 -5
- data/lib/ploy/packageset.rb +6 -2
- 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: b8fb0758a841e964c496a1313bdcbd3abe5628e7
|
4
|
+
data.tar.gz: 6a076cf94b6d4141065d00e71a637985e678ff0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db26435bf5cbfd386bf9331548656c03c10bc78a95c8a2aeb844e3008cc08dd87c0fc2efe645fa2fb0daf1d8c6356a612769e22f53f1682538893d546fbf652b
|
7
|
+
data.tar.gz: 3aa9a163b1c51fbd168fceba0cd126d779246268fd4fa4619576c97285c04e5b967cbd302eda0ae167fea29d52936ef840a302afa2b7edfa6a69c7ee7b1c29ed
|
data/lib/ploy/command/bless.rb
CHANGED
data/lib/ploy/command/install.rb
CHANGED
@@ -10,9 +10,10 @@ module Ploy
|
|
10
10
|
:version => 'current',
|
11
11
|
:branch => 'master',
|
12
12
|
:check => true,
|
13
|
+
:variant => nil
|
13
14
|
}
|
14
15
|
optparser(o).parse!(argv)
|
15
|
-
pkg = Ploy::Package.new(o[:bucket], o[:deploy], o[:branch], o[:version])
|
16
|
+
pkg = Ploy::Package.new(o[:bucket], o[:deploy], o[:branch], o[:version], o[:variant])
|
16
17
|
if (!o[:check] || pkg.check_new_version)
|
17
18
|
pkg.install()
|
18
19
|
puts "installed #{o[:deploy]}"
|
@@ -24,7 +25,7 @@ module Ploy
|
|
24
25
|
|
25
26
|
def help
|
26
27
|
return <<helptext
|
27
|
-
usage: ploy install -b $bucket -d $deployment -B $branch -v $version
|
28
|
+
usage: ploy install -b $bucket -d $deployment -B $branch -v $version [-r $variant]
|
28
29
|
|
29
30
|
#{optparser}
|
30
31
|
|
@@ -59,6 +60,9 @@ helptext
|
|
59
60
|
opts.on("-v", "--version VERSION", "use the given version") do |v|
|
60
61
|
o[:version] = v
|
61
62
|
end
|
63
|
+
opts.on("-r", "--variant VARIANT", "use the given vaRiant (e.g. 'blessed')") do |v|
|
64
|
+
o[:variant] = v
|
65
|
+
end
|
62
66
|
end
|
63
67
|
return options
|
64
68
|
end
|
data/lib/ploy/common.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
module Ploy
|
2
2
|
module Util
|
3
3
|
|
4
|
-
def Util.remote_name(deploy,branch,rev,
|
4
|
+
def Util.remote_name(deploy,branch,rev, variant = nil)
|
5
5
|
r = [
|
6
6
|
deploy,
|
7
7
|
branch,
|
8
8
|
"#{deploy}_#{rev}.deb"
|
9
9
|
]
|
10
|
-
if (
|
11
|
-
r.unshift(
|
10
|
+
if (variant) then
|
11
|
+
r.unshift(variant)
|
12
12
|
end
|
13
13
|
return r.join('/')
|
14
14
|
end
|
data/lib/ploy/package.rb
CHANGED
@@ -6,11 +6,14 @@ module Ploy
|
|
6
6
|
attr_accessor :deploy_name
|
7
7
|
attr_accessor :branch
|
8
8
|
attr_accessor :version
|
9
|
+
attr_accessor :variant
|
9
10
|
|
10
|
-
def initialize(bucket, deploy, branch, version)
|
11
|
+
def initialize(bucket, deploy, branch, version, variant = nil)
|
12
|
+
@bucket = bucket
|
11
13
|
@deploy_name = deploy
|
12
14
|
@branch = branch
|
13
15
|
@version = version
|
16
|
+
@variant = variant
|
14
17
|
|
15
18
|
@store = Ploy::S3Storage.new(bucket)
|
16
19
|
end
|
@@ -28,18 +31,24 @@ module Ploy
|
|
28
31
|
end
|
29
32
|
end
|
30
33
|
|
34
|
+
def blessed
|
35
|
+
return Ploy::Package.new(@bucket, @deploy_name, @branch, @version, "blessed")
|
36
|
+
end
|
37
|
+
|
31
38
|
def bless
|
39
|
+
b = self.blessed
|
32
40
|
@store.copy(
|
33
41
|
location,
|
34
|
-
|
42
|
+
b.location
|
35
43
|
)
|
44
|
+
return b
|
36
45
|
end
|
37
46
|
|
38
47
|
def location
|
39
|
-
return Ploy::Util.remote_name(@deploy_name, @branch, @version)
|
48
|
+
return Ploy::Util.remote_name(@deploy_name, @branch, @version, @variant)
|
40
49
|
end
|
41
50
|
def location_current
|
42
|
-
return Ploy::Util.remote_name(@deploy_name, @branch, 'current')
|
51
|
+
return Ploy::Util.remote_name(@deploy_name, @branch, 'current', @variant)
|
43
52
|
end
|
44
53
|
|
45
54
|
def upload(path)
|
@@ -53,7 +62,7 @@ module Ploy
|
|
53
62
|
def self.from_metadata(bucket, meta)
|
54
63
|
out = []
|
55
64
|
meta.each do |k,v|
|
56
|
-
out.push(self.new(bucket, v['name'], v['branch'], v['sha']))
|
65
|
+
out.push(self.new(bucket, v['name'], v['branch'], v['sha'], v['variant']))
|
57
66
|
end
|
58
67
|
return out
|
59
68
|
end
|
data/lib/ploy/packageset.rb
CHANGED
@@ -5,11 +5,15 @@ module Ploy
|
|
5
5
|
def initialize(conf)
|
6
6
|
self.packages = []
|
7
7
|
conf['packages'].each do |k,v|
|
8
|
+
if (not v)
|
9
|
+
v = {}
|
10
|
+
end
|
8
11
|
self.packages.push Ploy::Package.new(
|
9
12
|
conf['bucket'] || v['bucket'],
|
10
13
|
k,
|
11
|
-
v['branch'],
|
12
|
-
v['version']
|
14
|
+
v['branch'] || conf['branch'],
|
15
|
+
v['version'] || conf['version'],
|
16
|
+
v['variant'] || conf['variant'] || nil
|
13
17
|
)
|
14
18
|
end
|
15
19
|
@locked = conf['locked']
|