volley 0.1.0.alpha3 → 0.1.0.alpha4

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.
@@ -23,9 +23,13 @@ module Volley
23
23
  @argdata = {}
24
24
  @actions = {:pre => [], :main => [], :post => []}
25
25
  instance_eval &block if block_given?
26
+
27
+ argument :branch, :required => true
28
+ argument :version, :default => "latest"
26
29
  end
27
30
 
28
31
  def call(options={})
32
+ @origargs = options[:rawargs]
29
33
  process_arguments(options[:rawargs])
30
34
  #instance_eval &@block
31
35
  run_actions
@@ -64,7 +68,12 @@ module Volley
64
68
  Volley::Log.debug "running actions[:#{stage}]:" if @actions[stage].count > 0
65
69
  @actions[stage].each do |act|
66
70
  Volley::Log.debug "running action: #{act[:name]}"
67
- self.instance_eval(&act[:block])
71
+ begin
72
+ self.instance_eval(&act[:block])
73
+ rescue => e
74
+ Volley::Log.info "error running action: #{act[:name]}: #{e.message} at #{e.backtrace.first}"
75
+ Volley::Log.debug e
76
+ end
68
77
  end
69
78
  end
70
79
  end
@@ -224,8 +233,6 @@ module Volley
224
233
  end
225
234
 
226
235
  def pull
227
- argument :branch, :required => true
228
- argument :version, :default => "latest"
229
236
 
230
237
  dir = nil
231
238
  pub = nil
@@ -277,27 +284,12 @@ module Volley
277
284
  def volley(opts={ })
278
285
  o = {
279
286
  :project => @project.name,
280
- #:branch => args.branch,
281
- #:version => "latest",
282
287
  :plan => "pull",
283
288
  }.merge(opts)
284
289
 
285
- pr = o[:project]
286
- pl = o[:plan]
287
-
288
- action "volley-#{pr}-#{pl}" do
289
- plan = Volley::Dsl.project(pr).plan(pl)
290
- plan.call(:rawargs => @rawargs)
290
+ action "volley-#{o[:project]}-#{o[:plan]}" do
291
+ Volley.process(o.merge(:branch => args.branch, :version => args.version, :args => @origargs))
291
292
  end
292
-
293
- #desc = [o[:project], o[:branch], o[:version], o[:plan]].compact.join(":")
294
- #actionname = "volley-#{desc}"
295
- #action actionname do
296
- # Volley::Log.info "VOLLEY: #{desc}"
297
- # cmd = ["volley"]
298
- # cmd << desc
299
- # shellout(cmd.join(" "), :output => true)
300
- #end
301
293
  end
302
294
 
303
295
  def command(*args)
@@ -336,9 +328,12 @@ module Volley
336
328
  end
337
329
 
338
330
  def process_arguments(raw)
331
+ Volley::Log.debug "process arguments: #{raw.inspect}"
339
332
  if raw
340
333
  kvs = raw.select{|e| e =~ /\:/}
341
334
  raw = raw.reject{|e| e =~ /\:/}
335
+ Volley::Log.debug "KVS: #{kvs.inspect}"
336
+ Volley::Log.debug "RAW: #{raw.inspect}"
342
337
  @rawargs = raw
343
338
  @argdata = kvs.inject({ }) { |h, a| (k, v) = a.split(/:/); h[k.to_sym]= v; h }
344
339
  end
data/lib/volley.rb CHANGED
@@ -28,7 +28,9 @@ module Volley
28
28
  if pr.plan?(plan)
29
29
  # plan is defined
30
30
  pl = pr.plan(plan)
31
- pl.call(:rawargs => [args,"branch:#{branch}","version:#{version}"].flatten)
31
+ args << "branch:#{branch}" if branch && args.select{|e| e =~ /^branch\:/}.count == 0
32
+ args << "version:#{version}" if version && args.select{|e| e =~ /^version\:/}.count == 0
33
+ pl.call(:rawargs => args)
32
34
  else
33
35
  # plan is not defined
34
36
  raise "could not find plan #{plan} in project #{project}"
data/volley.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = "volley"
15
15
  gem.require_paths = ["lib"]
16
- gem.version = "#{Volley::Version::STRING}.alpha3"
16
+ gem.version = "#{Volley::Version::STRING}.alpha4"
17
17
 
18
18
  gem.add_dependency "clamp"
19
19
  gem.add_dependency "fog"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volley
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha3
4
+ version: 0.1.0.alpha4
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: