3

I am new to ruby on rails and i would like to use git for my future updates on my app etc... the question is that there are so many tutorials that each one of them are different and that confuses me.. .

so, is it possible to add a git server in my ec2 instance and manage it from my local machine whenever i want to push new code and automatically be seen in the site?

if not any walkaround with this method?

any better method?

1 Answer 1

6

I'd recommend you first set up Capistrano to enable you to automate the process of deploying your application:

https://github.com/capistrano/capistrano

Once you have Capistrano set up and verify that it can successfully deploy your application correctly to your EC2 instance then you have a number of options. The simplest method is just to run cap deploy when you push and want to deploy to the EC2 instance.

You don't need to host the git server on your EC2 instance but there is nothing stopping you doing so. If you do host the git server on the EC2 instance then you can use git hooks to automatically run the the capistrano deployment when you push:

http://git-scm.com/book/en/Customizing-Git-Git-Hooks

If you set it up to automatically deploy on push then I'd make sure you do development work in a different branch to the branch/master you set up Capistrano to deploy from so you don't accidently deploy unstable/buggy development code to your live site.

For larger projects I'd recommend setting up a CI server that runs the project's unit tests automatically deploying the application.

1
  • @fxuer I think this ans is exactly what you are looking for
    – Bijendra
    Jul 29, 2012 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.