Dieglock
Dieglock

Reputation: 169

Setup VPS (Bluehost) to deploy and update RoR apps (Heroku Style)

My goal is to setup my environment to be able to run $ git push myapp master on my local computer AND automatically deploy/update my RoR app on my VPS at Bluehost.

On my computer (Linux-Ubuntu) the RoR app is at: /var/www/myapp

I followed this GREAT explained tutorial and I have a plenty functional git installation on my VPS server at ~/git/repository/myapp

Ideally, my deployed RoR app will be located on Bluehost at ~/rails_apps/myapp

Bluehost automatically uses Pushion Passenger, and there is a symlink between ~/public_html/myapp folder and the public side of the RoR app, located at ~/rails_apps/myapp/public.

I am stuck with the post-receive git hook and I am not using Capistrano (should I?)

I have been reading many documents with similar goals, like this one, or this other one, I even found this gem.

There are different ways to achieve same goal and I am still confused because I have not found a post-receive hook example that fits my need (and have not grasp the logic).

I have been on git guides specific section for hooks and it tells what you can do but not how to do it, which is great for everyone but a rookie.

Any help with the scenario and the goal? Will it be easier if I use Capistrano and/or git-rails gem? Other suggestions?

THANKS.

ADDITION:

Hi, I am using Capistano now but have not acheved the goal yet.

I have my app at /var/www/my_app on linux local machine.

The git repository remote --bare and --share is at user@myserver:/server/user/git/repository/my_app.

I want to deploy to /server/user/rails_apps/my_app.

At deploy.rb I have

set:application, "my_app".

set :respository, "user@myserver:/server/git/repository/my_app.

set:user, "my_user_name".

set: domain, "mysite.com".

set :scm, :git.

set_scm_command, "/server/user/bin/git".

set :scm_passphrase, "my_phrase".

set :deploy_to, "/server/user/rails_apps/my_app".

set :deploy_via, :remote_cache.

set :tmp_dir, "/server/user/tmp".

When I run it, tels me: fatal: No remote configured to list refs from. Can you give me some guidance? Thanks.

Upvotes: 0

Views: 346

Answers (1)

j_mcnally
j_mcnally

Reputation: 6958

Yes, The standard way is Capistrano or Mina and provisioning a rails environment in a hosted directory. If you are hell bent on doing it the heroku way you can use Vagrant to provision your own heroku environment here: https://github.com/openruko/vagrant-openruko

Upvotes: 1

Related Questions