hudson 0.3.0.beta.16 → 0.3.0.beta.17
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/hudson.gemspec +2 -2
- data/lib/hudson/job_config_builder.rb +25 -32
- data/lib/hudson/version.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/hudson.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{hudson}
|
5
|
-
s.version = "0.3.0.beta.
|
5
|
+
s.version = "0.3.0.beta.17"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Charles Lowell", "Dr Nic Williams"]
|
9
|
-
s.date = %q{2010-11-
|
9
|
+
s.date = %q{2010-11-03}
|
10
10
|
s.default_executable = %q{hudson}
|
11
11
|
s.description = %q{A suite of utilities for bringing continous integration to your projects (not the other way around) with hudson CI}
|
12
12
|
s.email = ["cowboyd@thefrontside.net", "drnicwilliams@gmail.com"]
|
@@ -10,6 +10,8 @@ module Hudson
|
|
10
10
|
|
11
11
|
InvalidTemplate = Class.new(StandardError)
|
12
12
|
|
13
|
+
VALID_JOB_TEMPLATES = %w[rails rails3 ruby rubygem]
|
14
|
+
|
13
15
|
# +job_type+ - template of default steps to create with the job
|
14
16
|
# +steps+ - array of [:method, cmd], e.g. [:build_shell_step, "bundle initial"]
|
15
17
|
# - Default is based on +job_type+.
|
@@ -23,6 +25,7 @@ module Hudson
|
|
23
25
|
yield self
|
24
26
|
|
25
27
|
self.git_branches ||= ["master"]
|
28
|
+
raise InvalidTemplate unless VALID_JOB_TEMPLATES.include?(job_type.to_s)
|
26
29
|
end
|
27
30
|
|
28
31
|
def builder
|
@@ -108,20 +111,6 @@ module Hudson
|
|
108
111
|
end
|
109
112
|
end
|
110
113
|
end
|
111
|
-
|
112
|
-
# <triggers class="vector">
|
113
|
-
# <hudson.triggers.SCMTrigger>
|
114
|
-
# <spec># every minute
|
115
|
-
# * * * * *</spec>
|
116
|
-
# </hudson.triggers.SCMTrigger>
|
117
|
-
# </triggers>
|
118
|
-
def build_triggers(b)
|
119
|
-
b.triggers :class => "vector" do
|
120
|
-
b.tag! "hudson.triggers.SCMTrigger" do
|
121
|
-
b.spec "# every minute\n* * * * *"
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
114
|
|
126
115
|
# TODO
|
127
116
|
def build_axes(b)
|
@@ -151,14 +140,22 @@ module Hudson
|
|
151
140
|
|
152
141
|
# TODO modularise this
|
153
142
|
# TODO how to customize? e.g. EngineYard template?
|
154
|
-
VALID_JOB_TEMPLATES = %w[rails rails3 ruby rubygem]
|
155
143
|
def build_steps(b)
|
156
144
|
b.builders do
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
145
|
+
self.steps ||= default_steps(job_type)
|
146
|
+
steps.each do |step|
|
147
|
+
method, cmd = step
|
148
|
+
send(method.to_sym, b, cmd) # e.g. build_shell_step(b, "bundle install")
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def default_steps(job_type)
|
154
|
+
case job_type.to_sym
|
155
|
+
when :rails, :rails3
|
156
|
+
[
|
157
|
+
[:build_shell_step, "bundle install"],
|
158
|
+
[:build_ruby_step, <<-RUBY.gsub(/^ /, '')],
|
162
159
|
unless File.exist?("config/database.yml")
|
163
160
|
require 'fileutils'
|
164
161
|
example = Dir["config/database*"].first
|
@@ -166,18 +163,14 @@ module Hudson
|
|
166
163
|
FileUtils.cp example, "config/database.yml"
|
167
164
|
end
|
168
165
|
RUBY
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
method, cmd = step
|
178
|
-
send(method.to_sym, b, cmd)
|
179
|
-
end
|
180
|
-
end
|
166
|
+
[:build_shell_step, "bundle exec rake db:schema:load"],
|
167
|
+
[:build_shell_step, "bundle exec rake"]
|
168
|
+
]
|
169
|
+
else
|
170
|
+
[
|
171
|
+
[:build_shell_step, "bundle install"],
|
172
|
+
[:build_shell_step, "bundle exec rake"]
|
173
|
+
]
|
181
174
|
end
|
182
175
|
end
|
183
176
|
|
data/lib/hudson/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hudson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196401
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 0.3.0.beta.
|
11
|
+
- 17
|
12
|
+
version: 0.3.0.beta.17
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Charles Lowell
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2010-11-
|
21
|
+
date: 2010-11-03 00:00:00 -07:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|