volley 0.1.0.alpha1 → 0.1.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/lib/volley/dsl/plan.rb +15 -5
- data/lib/volley.rb +8 -3
- data/volley.gemspec +1 -1
- metadata +1 -1
data/Gemfile
CHANGED
data/lib/volley/dsl/plan.rb
CHANGED
@@ -60,16 +60,13 @@ module Volley
|
|
60
60
|
def run_actions(*stages)
|
61
61
|
stages = [*stages].flatten
|
62
62
|
stages = [:pre, :main, :post] if stages.count == 0
|
63
|
-
#ap Volley.config if Volley.config.debug
|
64
63
|
stages.each do |stage|
|
65
64
|
Volley::Log.debug "running actions[:#{stage}]:" if @actions[stage].count > 0
|
66
65
|
@actions[stage].each do |act|
|
67
66
|
Volley::Log.debug "running action: #{act[:name]}"
|
68
|
-
#ap act if Volley.config.debug
|
69
67
|
self.instance_eval(&act[:block])
|
70
68
|
end
|
71
69
|
end
|
72
|
-
#ap self if Volley.config.debug
|
73
70
|
end
|
74
71
|
|
75
72
|
def method_missing(n, *args)
|
@@ -227,6 +224,14 @@ module Volley
|
|
227
224
|
end
|
228
225
|
|
229
226
|
def pull
|
227
|
+
argument :branch, :required => true
|
228
|
+
argument :version, :default => "latest"
|
229
|
+
|
230
|
+
dir = nil
|
231
|
+
pub = nil
|
232
|
+
file = nil
|
233
|
+
tgz = nil
|
234
|
+
|
230
235
|
action :download do
|
231
236
|
pr = @project.name
|
232
237
|
br = args.branch
|
@@ -237,14 +242,19 @@ module Volley
|
|
237
242
|
|
238
243
|
dir = File.dirname(file)
|
239
244
|
Volley::Log.info "changing directory: #{dir} (#{file})"
|
240
|
-
cmd = "volley run #{pr}:#{plan} branch:#{branch} #{arg_list.join(' ')}"
|
241
245
|
|
242
|
-
|
246
|
+
#cmd = "volley run #{pr}:#{plan} branch:#{branch} #{arg_list.join(' ')}"
|
247
|
+
#Volley::Log.info "command: #{cmd}"
|
248
|
+
end
|
249
|
+
action :unpack do
|
243
250
|
FileUtils.mkdir_p("#{dir}/unpack")
|
244
251
|
Dir.chdir("#{dir}/unpack")
|
245
252
|
tgz = %x{tar xvfz #{file} 2>/dev/null}
|
246
253
|
File.open("#{dir}/tgz.log", "w") {|f| f.write(tgz)}
|
247
254
|
end
|
255
|
+
action :run do
|
256
|
+
yield dir if dir
|
257
|
+
end
|
248
258
|
end
|
249
259
|
|
250
260
|
#def volley(opts={ })
|
data/lib/volley.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require "awesome_print"
|
1
|
+
#require "awesome_print"
|
2
2
|
require "ostruct"
|
3
3
|
require "active_support/all"
|
4
4
|
|
@@ -18,26 +18,31 @@ module Volley
|
|
18
18
|
branch = opts[:branch]
|
19
19
|
version = opts[:version]
|
20
20
|
args = opts[:args]
|
21
|
+
second = opts[:second]
|
21
22
|
|
22
23
|
begin
|
24
|
+
Volley::Log.debug "PROCESS project:#{project} plan:#{plan} branch:#{branch} version:#{version} args:#{args}"
|
23
25
|
if Volley::Dsl.project?(project)
|
24
26
|
# we have the project locally
|
25
27
|
pr = Volley::Dsl.project(project)
|
26
28
|
if pr.plan?(plan)
|
27
29
|
# plan is defined
|
28
30
|
pl = pr.plan(plan)
|
29
|
-
pl.call(:rawargs => args)
|
31
|
+
pl.call(:rawargs => [args,"branch:#{branch}","version:#{version}"].flatten)
|
30
32
|
else
|
31
33
|
# plan is not defined
|
32
34
|
raise "could not find plan #{plan} in project #{project}"
|
33
35
|
end
|
34
36
|
else
|
37
|
+
raise "second loop, downloaded volleyfile failed?" if second
|
35
38
|
# we dont have the project locally, search the publisher
|
36
39
|
pub = Volley::Dsl.publisher
|
37
40
|
if pub
|
38
41
|
if pub.projects.include?(project)
|
39
42
|
vf = pub.volleyfile(opts)
|
40
|
-
|
43
|
+
Volley::Log.debug "downloaded volleyfile: #{vf}"
|
44
|
+
Volley::VolleyFile.load(vf)
|
45
|
+
process(:project => project, :plan => plan, :branch => branch, :version => version, :args => args, :second => true)
|
41
46
|
else
|
42
47
|
raise "project #{project} does not exist in configured publisher #{pub.class}"
|
43
48
|
end
|
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}.
|
16
|
+
gem.version = "#{Volley::Version::STRING}.alpha2"
|
17
17
|
|
18
18
|
gem.add_dependency "clamp"
|
19
19
|
gem.add_dependency "fog"
|