volley 0.1.0.alpha7 → 0.1.0.alpha8
Sign up to get free protection for your applications and to get access to all the features.
- data/conf/common.volleyfile +1 -2
- data/lib/volley/dsl/pull_action.rb +0 -5
- data/lib/volley/publisher/amazons3.rb +1 -1
- data/lib/volley/publisher/base.rb +7 -6
- data/lib/volley.rb +7 -10
- data/volley.gemspec +1 -1
- metadata +1 -1
data/conf/common.volleyfile
CHANGED
@@ -20,8 +20,7 @@ project :volley do
|
|
20
20
|
end
|
21
21
|
plan :latest do
|
22
22
|
default do
|
23
|
-
|
24
|
-
(project,branch,version) = args.descriptor.get
|
23
|
+
(project,branch,_) = args.descriptor.get
|
25
24
|
raise "project and branch must be specified" unless project && branch
|
26
25
|
|
27
26
|
pub = Volley::Dsl.publisher
|
@@ -40,11 +40,6 @@ module Volley
|
|
40
40
|
raise "failed to unpack: #{dir}/unpack" unless dir && File.directory?("#{dir}/unpack")
|
41
41
|
yield "#{dir}/unpack"
|
42
42
|
end
|
43
|
-
|
44
|
-
@plan.action :meta do
|
45
|
-
Volley.meta[project.name] = "#{args.descriptor.branch}:#{args.descriptor.version}"
|
46
|
-
Volley.meta.save
|
47
|
-
end
|
48
43
|
end
|
49
44
|
end
|
50
45
|
end
|
@@ -109,7 +109,7 @@ module Volley
|
|
109
109
|
hash[:all] ||= {}
|
110
110
|
hash[:latest] ||= {}
|
111
111
|
v = "#{pr}/#{br}/#{vr}"
|
112
|
-
hash[:latest]["#{pr}/#{br}"] ||= latest(pr, br)
|
112
|
+
#hash[:latest]["#{pr}/#{br}"] ||= latest(pr, br)
|
113
113
|
hash[:all][v] = hash["latest"] == v
|
114
114
|
end
|
115
115
|
#ap hash
|
@@ -10,6 +10,7 @@ module Volley
|
|
10
10
|
@encrypted = optional(:encrypted, false)
|
11
11
|
@local = optional(:local, Volley.config.directory)
|
12
12
|
@loglevel = @debug ? :info : :debug
|
13
|
+
@latest = {}
|
13
14
|
|
14
15
|
load_configuration
|
15
16
|
end
|
@@ -39,12 +40,12 @@ module Volley
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def latest(project, branch)
|
42
|
-
|
43
|
-
"#{project}/#{branch}/#{v}"
|
43
|
+
@latest["#{project}/#{branch}"] ||= pull_file(dir(project,branch), "latest")
|
44
44
|
end
|
45
45
|
|
46
46
|
def volleyfile(project, branch, version="latest")
|
47
|
-
|
47
|
+
d = dir(project,branch,version)
|
48
|
+
contents = pull_file(d, "Volleyfile")
|
48
49
|
|
49
50
|
dest = "#{@options[:local]}/Volleyfile-#{Time.now.to_i}-#{$$}"
|
50
51
|
raise "File #{dest} already exists" if File.exists?(dest)
|
@@ -69,7 +70,7 @@ module Volley
|
|
69
70
|
push_file(dir, "Volleyfile", File.open(Volley.config.volleyfile))
|
70
71
|
end
|
71
72
|
|
72
|
-
push_file(dir(project, branch), "latest", version)
|
73
|
+
push_file(dir(project, branch), "latest", "#{project}/#{branch}/#{version}")
|
73
74
|
|
74
75
|
true
|
75
76
|
end
|
@@ -123,12 +124,12 @@ module Volley
|
|
123
124
|
end
|
124
125
|
|
125
126
|
def remote_file(branch, version)
|
126
|
-
version = version == 'latest' ?
|
127
|
+
version = version == 'latest' ? latest(project, branch) : version
|
127
128
|
"#{branch}-#{version}.tgz#{".cpt" if @encrypted}"
|
128
129
|
end
|
129
130
|
|
130
131
|
def dir(project, branch, version=nil)
|
131
|
-
version = version == 'latest' ?
|
132
|
+
version = version == 'latest' ? latest(project, branch).split("/").last : version
|
132
133
|
[project, branch, version].compact.join("/")
|
133
134
|
end
|
134
135
|
|
data/lib/volley.rb
CHANGED
@@ -35,18 +35,14 @@ module Volley
|
|
35
35
|
desc = opts[:descriptor]
|
36
36
|
second = opts[:second]
|
37
37
|
|
38
|
-
|
39
|
-
branch
|
40
|
-
|
41
|
-
|
42
|
-
(project, plan) = plan.split(/:/) if plan =~ /\:/
|
43
|
-
(project, branch, version) = Volley::Descriptor.new(desc).get unless project
|
38
|
+
(runpr, plan) = plan.split(/:/) if plan =~ /\:/
|
39
|
+
(project, branch, version) = Volley::Descriptor.new(desc).get rescue [nil,nil,nil]
|
40
|
+
runpr ||= project
|
44
41
|
|
45
42
|
begin
|
46
|
-
Volley::
|
47
|
-
if Volley::Dsl.project?(project)
|
43
|
+
if Volley::Dsl.project?(runpr)
|
48
44
|
# we have the project locally
|
49
|
-
pr = Volley::Dsl.project(
|
45
|
+
pr = Volley::Dsl.project(runpr)
|
50
46
|
if pr.plan?(plan)
|
51
47
|
# plan is defined
|
52
48
|
pl = pr.plan(plan)
|
@@ -57,6 +53,7 @@ module Volley
|
|
57
53
|
Volley.meta[project] = data
|
58
54
|
end
|
59
55
|
Volley.meta.save
|
56
|
+
Volley::Log.debug "== #{runpr} = #{data}"
|
60
57
|
else
|
61
58
|
# plan is not defined
|
62
59
|
raise "could not find plan #{plan} in project #{project}"
|
@@ -70,7 +67,7 @@ module Volley
|
|
70
67
|
vf = pub.volleyfile(project, branch, version)
|
71
68
|
Volley::Log.debug "downloaded volleyfile: #{vf}"
|
72
69
|
Volley::Dsl::VolleyFile.load(vf)
|
73
|
-
process(:
|
70
|
+
process(:plan => plan, :desc => desc, :args => args, :second => true)
|
74
71
|
else
|
75
72
|
raise "project #{project} does not exist in configured publisher #{pub.class}"
|
76
73
|
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}.alpha8"
|
17
17
|
|
18
18
|
gem.add_dependency "clamp"
|
19
19
|
gem.add_dependency "fog"
|