I am in the process of setting up an auto scaling group in AWS with a custom AMI. I know that AWS reserves a section for "user-data" where people can input their scripts and they can be executed at instance creation but I guess I am more comfortable having a start up script baked in to the image itself.
I will create the custom image (set up web server and all additional packages needed) and then need to create a start up script that will clone my git repository (ssh) into "/var/www/" for example.
My question would be: Any downside to cloning a repository directly into a web server folder? The whole idea is: when the load gets too high on the balancer, then a new instance will be created from the AMI, and at start up, the instance will grab the source code from the private git repository. --> Any advice for the best way to carry this process out?? I would appreciate some guidance!
As for deployment of new code to already running instances, I will be using Capistrano for that.
Thanks in advance!