lib/hudson/job_config_builder.rb in hudson-0.3.0.beta.17 vs lib/hudson/job_config_builder.rb in hudson-0.3.0.beta.18

- old
+ new

@@ -136,12 +136,13 @@ else b.buildWrappers end end - # TODO modularise this - # TODO how to customize? e.g. EngineYard template? + # The important sequence of steps that are run to process a job build. + # Can be defaulted by the +job_type+ using +default_steps(job_type)+, + # or customized via +steps+ array. def build_steps(b) b.builders do self.steps ||= default_steps(job_type) steps.each do |step| method, cmd = step @@ -161,10 +162,17 @@ example = Dir["config/database*"].first puts "Using \#{example} for config/database.yml" FileUtils.cp example, "config/database.yml" end RUBY - [:build_shell_step, "bundle exec rake db:schema:load"], + [:build_shell_step, "bundle exec rake db:create:all"], + [:build_shell_step, <<-RUBY.gsub(/^ /, '')], + if [ -f db/schema.rb ]; then + bundle exec rake db:migrate + else + bundle exec rake db:schema:load + fi + RUBY [:build_shell_step, "bundle exec rake"] ] else [ [:build_shell_step, "bundle install"], \ No newline at end of file