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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edb371b2fdd1e0a31b8a750f5c72bc35f0e02900
4
- data.tar.gz: 30e9eff5f8a814b87e930b4942836156930a8a97
3
+ metadata.gz: b8fb0758a841e964c496a1313bdcbd3abe5628e7
4
+ data.tar.gz: 6a076cf94b6d4141065d00e71a637985e678ff0d
5
5
  SHA512:
6
- metadata.gz: d15796fa9f6bfe217c941006a6f2c79c339dd528662eea33975f3942f87632bd6afa12c847c5fed9f9997cf55db300b0c20e9bd25767db4aad559757f86cbcaf
7
- data.tar.gz: 2764731d6ae3cfb308dbeb59e08a4211d24aeb09ad5c15d1a7ca25d054d3bbf488ff611812271c97f923811c72dc5f8afca83cd82edffefcce8b63671b7c71d6
6
+ metadata.gz: db26435bf5cbfd386bf9331548656c03c10bc78a95c8a2aeb844e3008cc08dd87c0fc2efe645fa2fb0daf1d8c6356a612769e22f53f1682538893d546fbf652b
7
+ data.tar.gz: 3aa9a163b1c51fbd168fceba0cd126d779246268fd4fa4619576c97285c04e5b967cbd302eda0ae167fea29d52936ef840a302afa2b7edfa6a69c7ee7b1c29ed
@@ -16,7 +16,8 @@ module Ploy
16
16
  end
17
17
 
18
18
  pkgs.each do |pkg|
19
- pkg.bless
19
+ blessed = pkg.bless
20
+ blessed.make_current
20
21
  puts "blessed #{o[:deploy]}/#{o[:branch]} at #{o[:version]}"
21
22
  end
22
23
  end
@@ -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
@@ -1,14 +1,14 @@
1
1
  module Ploy
2
2
  module Util
3
3
 
4
- def Util.remote_name(deploy,branch,rev, blessed = false)
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 (blessed) then
11
- r.unshift('blessed')
10
+ if (variant) then
11
+ r.unshift(variant)
12
12
  end
13
13
  return r.join('/')
14
14
  end
@@ -34,7 +34,7 @@ module Ploy
34
34
  write_after_install_script(file)
35
35
  ol = fpm_optlist(dir)
36
36
  ol.add("--after-install", file.path)
37
- puts "debug: fpm #{ol.as_string} ."
37
+ #puts "debug: fpm #{ol.as_string} ."
38
38
  info = eval(`fpm #{ol.as_string} .`)
39
39
  end
40
40
  end
@@ -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
- Ploy::Util.remote_name(@deploy_name, @branch, @version, true)
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
@@ -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']
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.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bruce