lib/hudson/job_config_builder.rb in hudson-0.3.0.beta.3 vs lib/hudson/job_config_builder.rb in hudson-0.3.0.beta.4
- old
+ new
@@ -2,10 +2,11 @@
module Hudson
class JobConfigBuilder
attr_accessor :scm, :git_branches
attr_accessor :job_type, :matrix_project
+ attr_accessor :assigned_node
def initialize(options = nil, &block)
if options.is_a?(Symbol)
@job_type = options.to_s
elsif options.is_a?(Hash)
@@ -23,10 +24,11 @@
b.actions
b.description
b.keepDependencies false
b.properties
build_scm b
+ b.assignedNode assigned_node if assigned_node
b.canRoam true
b.disabled false
b.blockBuildWhenUpstreamBuilding false
build_triggers b
b.concurrentBuild false
@@ -104,11 +106,11 @@
end
def build_steps(b)
b.builders do
if job_type == "rails"
- build_ruby_step b, <<-RUBY.gsub(/^ /, '')
+ build_ruby_step b, <<-RUBY.gsub(/^ /, '')
unless File.exist?("config/database.yml")
require 'fileutils'
example = Dir["config/database*"].first
puts "Using \#{example} for config/database.yml"
FileUtils.cp example, "config/database.yml"
@@ -131,10 +133,12 @@
# FileUtils.cp example, "config/database.yml"
# end</command>
# </hudson.plugins.ruby.Ruby>
def build_ruby_step(b, command)
b.tag! "hudson.plugins.ruby.Ruby" do
- b.command command
+ b.command do
+ b << command.to_xs.gsub(%r{"}, '"').gsub(%r{'}, ''')
+ end
end
end
# Usage: build_ruby_step b, "db:schema:load"
#
\ No newline at end of file