hudson 0.3.0.beta.9 → 0.3.0.beta.10
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 +1 -1
- data/lib/hudson.rb +1 -1
- data/lib/hudson/cli.rb +1 -1
- data/lib/hudson/job_config_builder.rb +12 -3
- data/spec/fixtures/rails.single.config.xml +9 -24
- data/spec/job_config_builder_spec.rb +2 -4
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/hudson.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
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.10"
|
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"]
|
data/lib/hudson.rb
CHANGED
data/lib/hudson/cli.rb
CHANGED
@@ -56,7 +56,7 @@ module Hudson
|
|
56
56
|
unless scm = Hudson::ProjectScm.discover
|
57
57
|
error "Cannot determine project SCM. Currently supported: #{Hudson::ProjectScm.supported}"
|
58
58
|
end
|
59
|
-
job_config = Hudson::JobConfigBuilder.new(:
|
59
|
+
job_config = Hudson::JobConfigBuilder.new(:rails) do |c|
|
60
60
|
c.scm = scm.url
|
61
61
|
c.assigned_node = options[:assigned_node] if options[:assigned_node]
|
62
62
|
end
|
@@ -108,6 +108,7 @@ module Hudson
|
|
108
108
|
def build_steps(b)
|
109
109
|
b.builders do
|
110
110
|
if job_type == "rails"
|
111
|
+
build_shell_step b, "bundle install"
|
111
112
|
build_ruby_step b, <<-RUBY.gsub(/^ /, '')
|
112
113
|
unless File.exist?("config/database.yml")
|
113
114
|
require 'fileutils'
|
@@ -116,15 +117,23 @@ module Hudson
|
|
116
117
|
FileUtils.cp example, "config/database.yml"
|
117
118
|
end
|
118
119
|
RUBY
|
119
|
-
|
120
|
-
|
121
|
-
build_rake_step b, "spec"
|
120
|
+
build_shell_step b, "bundle exec rake db:schema:load"
|
121
|
+
build_shell_step b, "bundle exec rake"
|
122
122
|
elsif job_type == "rubygem"
|
123
123
|
build_rake_step b, "features"
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
|
+
# <hudson.tasks.Shell>
|
129
|
+
# <command>bundle install</command>
|
130
|
+
# </hudson.tasks.Shell>
|
131
|
+
def build_shell_step(b, command)
|
132
|
+
b.tag! "hudson.tasks.Shell" do
|
133
|
+
b.command command.to_xs.gsub(%r{"}, '"').gsub(%r{'}, ''')
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
128
137
|
# <hudson.plugins.ruby.Ruby>
|
129
138
|
# <command>unless File.exist?("config/database.yml")
|
130
139
|
# require 'fileutils'
|
@@ -38,6 +38,9 @@
|
|
38
38
|
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
39
39
|
<concurrentBuild>false</concurrentBuild>
|
40
40
|
<builders>
|
41
|
+
<hudson.tasks.Shell>
|
42
|
+
<command>bundle install</command>
|
43
|
+
</hudson.tasks.Shell>
|
41
44
|
<hudson.plugins.ruby.Ruby>
|
42
45
|
<command>
|
43
46
|
unless File.exist?("config/database.yml")
|
@@ -48,30 +51,12 @@ unless File.exist?("config/database.yml")
|
|
48
51
|
end
|
49
52
|
</command>
|
50
53
|
</hudson.plugins.ruby.Ruby>
|
51
|
-
<hudson.
|
52
|
-
<
|
53
|
-
|
54
|
-
|
55
|
-
<
|
56
|
-
|
57
|
-
<silent>false</silent>
|
58
|
-
</hudson.plugins.rake.Rake>
|
59
|
-
<hudson.plugins.rake.Rake>
|
60
|
-
<rakeInstallation>(Default)</rakeInstallation>
|
61
|
-
<rakeFile/>
|
62
|
-
<rakeLibDir/>
|
63
|
-
<rakeWorkingDir/>
|
64
|
-
<tasks>features</tasks>
|
65
|
-
<silent>false</silent>
|
66
|
-
</hudson.plugins.rake.Rake>
|
67
|
-
<hudson.plugins.rake.Rake>
|
68
|
-
<rakeInstallation>(Default)</rakeInstallation>
|
69
|
-
<rakeFile/>
|
70
|
-
<rakeLibDir/>
|
71
|
-
<rakeWorkingDir/>
|
72
|
-
<tasks>spec</tasks>
|
73
|
-
<silent>false</silent>
|
74
|
-
</hudson.plugins.rake.Rake>
|
54
|
+
<hudson.tasks.Shell>
|
55
|
+
<command>bundle exec rake db:schema:load</command>
|
56
|
+
</hudson.tasks.Shell>
|
57
|
+
<hudson.tasks.Shell>
|
58
|
+
<command>bundle exec rake</command>
|
59
|
+
</hudson.tasks.Shell>
|
75
60
|
</builders>
|
76
61
|
<publishers/>
|
77
62
|
<buildWrappers/>
|
@@ -11,8 +11,7 @@ describe Hudson::JobConfigBuilder do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
it "builds config.xml" do
|
14
|
-
config_xml
|
15
|
-
config_xml.should == @config.to_xml
|
14
|
+
config_xml("rails", "single").should == @config.to_xml
|
16
15
|
end
|
17
16
|
end
|
18
17
|
|
@@ -23,8 +22,7 @@ describe Hudson::JobConfigBuilder do
|
|
23
22
|
end
|
24
23
|
end
|
25
24
|
it "builds config.xml" do
|
26
|
-
config_xml
|
27
|
-
config_xml.should == @config.to_xml
|
25
|
+
config_xml("rubygem").should == @config.to_xml
|
28
26
|
end
|
29
27
|
end
|
30
28
|
|
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: 62196359
|
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
|
+
- 10
|
12
|
+
version: 0.3.0.beta.10
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Charles Lowell
|