1

How to deploy Rails project on live server using Rake task?

For other projects I used Capistrano deployment.But for this project I wish to use rake...if anybody guide me please ... What gem I will need to install or what is the procedure I should follow?

Manish Shrivastava
  • 30,617
  • 13
  • 97
  • 101

3 Answers3

2

You already answered your question yourself:

Either you use capistrano (the recommended way) - or you write your own custom rake Tasks that do what you want.

Writing Rake tasks is nothing complicated, you simply define tasks that depend on each other for each step of your deployment and then run them. Remember: Rake tasks are just plain Ruby and you therefore can use any Gem that suits your needs.

Only if you get a bit more detailed on what tasks you want to do during your deployment I can start recommending Gems or what Tasks you may need to write.

Article by Martin Fowler on Rake: http://martinfowler.com/articles/rake.html

Generally a Rake file looks pretty much like this:

task :default => [:test]

task :test do
  # You can write regular ruby here and do anything you want
  puts "Foo"
end

task :dependant => [:test] do
  # This task will automatically make sure task test is run before running.
  puts "Hello World"
end
Tigraine
  • 23,358
  • 11
  • 65
  • 110
1

Linux or windows? which is the os you are using?

you can follow this refeerence

http://guides.rubyonrails.org/command_line.html

http://www.tutorialspoint.com/ruby-on-rails/rails-and-rake.htm

SHANib
  • 708
  • 2
  • 14
  • 44
1

Just guessing a bit.

You probably would need:

  1. A command line options parser
  2. A way to interact through ssh
  3. Some linux command execution
  4. Optionally a way to interact with git
Community
  • 1
  • 1
tommasop
  • 18,495
  • 2
  • 40
  • 51