lib/shuttle/deployment/rails.rb in shuttle-deploy-0.2.0 vs lib/shuttle/deployment/rails.rb in shuttle-deploy-0.2.1
- old
+ new
@@ -42,13 +42,16 @@
error "Unable to install bundler: #{res.output}"
end
end
end
- def rake(command)
- res = ssh.run("cd #{release_path} && bundle exec rake #{command}")
- if res.failure?
+ def rake(command, print_output = false)
+ result = ssh.run("cd #{release_path} && bundle exec rake #{command}")
+
+ if result.success?
+ puts result.output if print_output
+ else
error "Unable to run rake command: #{command}. Reason: #{res.output}"
end
end
# Precompile rails assets. If no changes detected between last and
@@ -116,10 +119,10 @@
end
end
if migrate == true
log "Migrating database"
- rake 'db:migrate'
+ rake("db:migrate", true)
ssh.run("echo #{checksum} > #{schema_file}")
else
log "Database migration skipped"
end
end
\ No newline at end of file