Deploying With Git Using a Remote Repository

Im deploying Ruby on Rails applications with Git. The code of my personal application was hosted in Beanstalkapp.com because it gives me one free private repo. Following steps can give a basic deployment:

  • On the remote server in which your application is running.
  1. cd /var/www/your_application_directory
  2. git init
  3. git remote add production git@acount.beanstalkapp.com:/repository.git
  4. git pull production master (*)(**)
  • On the local machine in which you are changing your code.
  1. Change/Add some code
  2. git add .
  3. git commit -m “Changing some stuff”
  4. git push beanstalk master
  • On the remote server in which your application is running in order to get the new modifications
  1. git pull production master
  2. stop the server, in my case mongrel 
    mongrel_rails stop
  3. restart the server 
    mongrel_rails start -p PORT_NUMBER -d -e production -P log/mongrel.pid
* If you have the erro
Permission denied (publickey,keyboard-interactive). fatal: The remote end hung up unexpectedly

you have to set a new RSA key for the remote server. To set a new RSA public key in the remote server, you just need to run 

ssh-keygen

, answer some questions, and copy the content of ~/.ssh/id_rsa.pub.

** You have to add your RSA public key to grant the access from the server in which your application is running. On Beanstalk, accessing the https://acount.beanstalkapp.com/public_keys you can dot it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: